3

I successfully have a message url from the gmail api:

https://mail.google.com/mail/?authuser=roy@companyemail.co#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

rmaddy
  • 314,917
  • 42
  • 532
  • 579
royherma
  • 4,095
  • 1
  • 31
  • 42

2 Answers2

4

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

royherma
  • 4,095
  • 1
  • 31
  • 42
0

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.

Brett Donald
  • 6,745
  • 4
  • 23
  • 51