简体   繁体   English

自定义网址方案在短信应用中无法识别为链接(仅限iphone 4 iOS 5.0)

[英]Custom URL scheme not recognized as link in SMS app(only in iphone 4 iOS 5.0)

Summary: In my application, I've defined a custom URL in the format "myapp://.." . 简介:在我的应用程序中,我已经以“myapp:// ..”格式定义了一个自定义URL。 But the URL is not recognized as a link when it comes in an SMS. 但是当它出现在SMS中时,URL不会被识别为链接。 So the user is not able to tap it and launch the app. 因此,用户无法点击它并启动应用程序。 Instead, he has to copy & paste it in browser. 相反,他必须在浏览器中复制并粘贴它。 This happens only in iPhone4(iOS v5.0) 这仅在iPhone4(iOS v5.0)中发生

Steps to Reproduce: Define a custom URL for the app by specifying a new URL scheme in info.plist. 重现步骤:通过在info.plist中指定新的URL方案,为应用程序定义自定义URL。 Send an SMS with the custom URL of the app to iPhone4(iOS v5.0). 将带有应用程序自定义URL的SMS发送到iPhone4(iOS v5.0)。 Open the SMS. 打开短信。

Expected Result: The URL must be displayed as link in the SMS. 预期结果:URL必须在SMS中显示为链接。

Actual Result: The URL is displayed there as plain text and not as a link. 实际结果:URL以纯文本形式显示,而不是链接。

Regression: Before upgrading to iOS 5, in the same iPhone4(iOS version 4.3), the URL was displayed as link always. 回归:在升级到iOS 5之前,在同一iPhone4(iOS版本4.3)中,URL始终显示为链接。

Notes: The funny side is that, if I forward the message from the same iPhone to itself, in the sent SMS and the newly received SMS, the URL will appear as a link. 注意:有趣的一面是,如果我将消息从同一个iPhone转发给自己,在发送的短信和新收到的短信中,该URL将显示为链接。

It seems the SMS url parser is not clever enough to work out that your url is for an app - my suggestion would be to use an http:// based url that will then redirect to the url for your app. 似乎SMS网址解析器不够巧妙,无法确定您的网址是否为应用 - 我的建议是使用基于http://的网址,然后重定向到您的应用的网址。

This would allow you to show a message to non iPhone users who might have inadvertently got the message and would also allow you to register that the SMS linked has clicked on all this is in addition to also working on iOS 5. 这将允许您向可能无意中收到消息的非iPhone用户显示消息,并且还允许您注册已链接的SMS已点击所有这些以及还在iOS 5上工作。

Check if you're using uppercase/mixed scheme (as in MyApp://...) versus an all lowercase (myapp://...). 检查您是否使用大写/混合方案(如在MyApp:// ...中)与全小写(myapp:// ...)。 Under iOS 5, the OS won't recognize and will throw exceptions if you try to use uppercase in a custom URL scheme. 在iOS 5下,如果您尝试在自定义URL方案中使用大写,操作系统将无法识别并将抛出异常。 If that doesn't work, it's almost certainly a bug with the SMS code in which case you should file a bug. 如果这不起作用,那几乎肯定是SMS代码的错误,在这种情况下你应该提交一个bug。 Let me know if that worked. 如果有效,请告诉我。

在iOS 5.0.1中它可以工作,但你应该在链接之前附加一些任意文本。

重新启动手机shell可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM