Gmail是否有适用于iOS的URL处理程序来撰写邮件? [英] Is there a URL handler for Gmail for iOS to compose a message?

查看:97
本文介绍了Gmail是否有适用于iOS的URL处理程序来撰写邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iOS应用程序包括发送电子邮件作为其功能的一部分。 MFMailComposeViewController 允许应用程序内部组成电子邮件,操作系统在后台使用Mail.app发送消息。但是,我想允许用户发送一封电子邮件,其中包含适用于iOS的Gmail应用程序。



由于远程视图控制器不是公共API,唯一的方法这可能是一个URL处理程序,但我无法在任何地方找到一个在线文档。有人知道吗?如果有的话,Gmail团队是否公开承认(即他们是否认为它是公开的API,还是仅在Chrome和Gmail之间使用它,并且还没准备好将包装纸取下)?

解决方案

傻了,我没有完成我的研究。一旦我打开Gmail应用程序的.ipa,并在中找到 googlegmail 列为 CFBundleURLTypes Info.plist ,网络为此提供了一些很好的资源:


  1. 查找适用于iOS的Gmail URL方案

  2. 查找适用于iOS的Gmail URL方案:第2部分

  3. handleOpenURL:Shared Interapp Communication!有一个可搜索的URL列表 b


    长话短说,这适用于我的iPhone 5运行iOS 7.0和Gmail for iOS v2.4.1,并打开撰写即使应用程序已被明确杀死:

    googlegmail:/// co?subject = Hello& body = Hi



    我仍在寻找合作伙伴确认这被视为Gmail的公开API。有没有人对Gmail团队对此感觉如何?


    My iOS application includes sending emails as part of its functionality. MFMailComposeViewController allows in-app composition of an email, with the OS using Mail.app in the background to send the message. However, I want to allow users to send an email with the Gmail app for iOS if they so choose.

    Since remote view controllers aren't public API, the only way this would be possible is with a URL handler, but I couldn't find one documented online anywhere. Does anyone know of one? If there is one, is it publicly acknowledged by the Gmail team (i.e. do they consider it public API, or are they using it only between Chrome and Gmail and aren't quite ready to take the wrapping paper off)?

    解决方案

    Silly me, I didn't finish doing my research. Once I opened up the Gmail app's .ipa and found googlegmail as a listed CFBundleURLTypes in the Info.plist, the web turned up a few great resources for this:

    1. Finding the Gmail URL scheme for iOS
    2. Finding the Gmail URL scheme for iOS: Part 2
    3. handleOpenURL: Shared Interapp Communication! has a searchable list of URL handlers.

    Long story short, this worked on my iPhone 5 running iOS 7.0 and Gmail for iOS v2.4.1, and opened a compose pane in the Gmail app, even when the app had been explicitly killed:

    googlegmail:///co?subject=Hello&body=Hi

    I'm still looking for confirmation that this is considered a public API of Gmail. Does anyone have any knowledge about how the Gmail team feels about this?

    这篇关于Gmail是否有适用于iOS的URL处理程序来撰写邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆