Deep link to specific message in Gmail app

和自甴很熟 提交于 2019-12-11 13:59:57

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/37690035/deep-link-to-specific-message-in-gmail-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!