One way to approach this is to encode the trusted data as a JSON Web Token (JWT), which is digitally signed. This is then transmitted to the server by the application, and the server authenticates it.
As you already mentioned, Gmail and other software do not recognize custom URL schemes, such as app://. To work around this, provide an HTTPS link to your server of a similar form (for example https://example.com/redirect/gf234h23f4j234342342), which then redirects HTTP to a custom URL scheme using the information provided in the HTTPS URL. As an optimization, you can also configure the universal URL in iOS 9+ to directly redirect the HTTPS URL directly to your application without having to bounce through Safari.
Android.