Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deep link to specific message in Gmail app

Tags:

ios

gmail

I successfully have a message url from the gmail api:

https://mail.google.com/mail/[email protected]#all/155134b5e66a9b06

However, when i call the [[UIApplication sharedApplication] openURL:url] method, the web client gets opened up instead of the native iOS application (and just shows the inbox, not the specific message). Not sure if it has to do with the LSApplicationQueriesSchemes or not, but regardless - couldn't find any documentation on this in the Gmail iOS documentation, so if anyone has any ideas!

Thanks

like image 355
royherma Avatar asked Sep 14 '25 05:09

royherma


2 Answers

Through the links the Brett posted, this deep link url allowed me to open gmail:

googlegmail://

Still searching for instructions on deep linking to a specific email though

like image 162
royherma Avatar answered Sep 15 '25 18:09

royherma


It seems that the openURL method is designed to do what you want to do. But any URL which starts with http: or https: is going to open in Safari. Here is a quote from the doco.

A URL (Universal Resource Locator). UIKit supports many common schemes, including the http, https, tel, facetime, and mailto schemes. You can also employ custom URL schemes associated with apps installed on the device.

I presume that if you wanted to compose a message in the built-in Mail app, you would use a mailto: URL. Not sure about opening an existing message. And if you want to open an existing message in another app, then that app would need to define a custom URL scheme, and you'd need to use that.

like image 44
Brett Donald Avatar answered Sep 15 '25 20:09

Brett Donald