是否可以创建一个包含 url 链接的彩信来启动本地应用程序
如果我在短信中嵌入一个网址,然后用户从消息应用程序中单击该网址,我就可以启动我的应用程序。我这一切都在工作。
然而,我希望能够做的是向设备发送一条彩信,其中包含填充屏幕的许多图像和文本,当用户单击彩信中的网址时,我的应用程序将按原样启动如果从短信中单击。
是否可以模拟这个以便我可以看到它的工作原理?即我如何创建一个包含有效活动链接的彩信来演示概念证明(我不是在谈论在 iOS 上以编程方式创建彩信,只是如何创建包含要发送到设备的应用程序 url 的彩信)?
I can launch my app if I embed a url in an SMS and then the user clicks on the url from within the message app. I have this all working.
What I would like to be able to do however is send an MMS to the device which contains a number of image(s) and text filling the screen and when the user clicks on the url within the MMS my app is launched same as it is if clicked from within an SMS.
Is it possible to mock this up so I can see it working? i.e. how could I create an MMS containing a working active link to demo a proof of concept (I'm not talking about creating an MMS programatically on iOS, just how to create one containing my app's url to send to the device)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:这个答案是在 URL 处理部分需要实现细节的假设下编写的。我将把技术细节留在这里供未来的 Google 员工参考。
此处是论坛主题的链接这似乎表明您无法以编程方式从 iPhone 发送彩信(我知道您说过您无论如何都不想知道这一点,但在这里是为了完整性)。建议直接使用消息提供商的彩信网关(例如http://www.smsglobal.com)。
有关如何将超链接添加到彩信中的说明位于此处。您可以用纯文本编写它,或者使用锚点:不过,不能 100% 确定 iPhone 会正确解析彩信中的这些锚标记。
阅读这篇文章。要点是,您将“URL 类型”行添加到 Info.plist 并将其设置为任何有效协议,例如
myapp
,然后用户在彩信中打开一个指向的链接。 myapp
网址。文章摘录:Edit: This answer was written under the assumption that implementation details were required for the URL handling part. I'll leave the technical details here for future Googlers.
Here is a link to a forum thread which seems to indicate you can't send MMSes from the iPhone programmatically (I know you said you didn't want to know this anyway, but it's here for completeness). The suggestion is to use a message provider's MMS gateway directly (e.g http://www.smsglobal.com).
Instructions on how to get a hyperlink into an MMS are here. You can just write it in plain text, or use an anchor: <a href="myapp://"> Not 100% sure the iPhone will properly parse those anchor tags in an MMS though.
Read this article. The gist is that you add a "URL types" row to your Info.plist and set it to any valid protocol, say
myapp
, and then a user opens a link in an MMS to amyapp
URL. Article excerpt: