如何使用Gluon应用程序在iOS上打开/发送URL到另一个应用程序?
我希望在我自己的应用程序中利用iOS上其他应用程序的现有function。 据我所知,应该能够使用URL自定义方案: https : //developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html
现在在我的TryingService
应用程序中充当监听器,我使用RuntimeArgsService
来监听LAUNCH_URL_KEY
。 在我的应用程序的Default-Info.plist
文件中,我添加了URL Identifier
: com.tryingservice.TryingService
和URL Scheme
: outputHello
。 我应该如何设置我的“发送者”胶子应用程序 – 使用URL Scheme
打开TryingService
应用程序?
现在我被困在一个可操作的URL:
最后,我通过以下示例对ios进行了自定义服务实现: http : //docs.gluonhq.com/samples/gonative/
当这样做并且在学习了一些Objective-C之后,我注意到了BrowserService
已经在问题的评论中暗示的BrowserService
– 与我自己的MyService.m
Objective-C文件的相似性。
在调查了这个进一步的检查后, https: //bitbucket.org/gluon-oss/charm-down/src/11c36e187921/plugins/plugin-browser/ios/src/main/native/Browser.m?at = default & fileviewer = file -view-default … if ([[UIApplication sharedApplication] canOpenURL:nsUrl])
– 使其无法启动我的自定义URL方案。
通过在BrowserService
删除if
语句, BrowserService
可以启动另一个已注册URL-Scheme
应用程序。 它可以提到没有启动safari /默认浏览器。
所以这是一个Gluon应用程序启动另一个LAUNCH_URL_KEY
应用程序(使用RuntimeArgsService
侦听LAUNCH_URL_KEY
)
José给出的正确格式是: outputHello://
。 所以我可以将它留空或者在URL-Scheme
部分之后直接添加(例如,文件的URL-Scheme
)。
但是,由于iOS应用程序沙盒,导致应用程序本地存储的URL无法从另一个应用程序读取: 什么是ios中的沙盒,我可以在iPhone中的一个应用程序到另一个应用程序之间传输数据,如果可能的话
尽管如下所示,应该可以“打开带有选项的URL”: https : //developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey?language = objc 。
- 如何从谷歌日历API中获取JSON?
- canOpenUrl失败“org-appextension-feature-password-management”(PayPal)
- Touchesbegan没有检测到正在触摸的东西
- UIGraphicsGetImageFromCurrentImageContext()提供更高质量的图像
- 如何用branch.io捕获参数?
- 我如何使sprite工具包中的popup菜单快捷?
- parsingCocoapod打破本地化
- Game Center排行榜(Sandbox)中只显示一名玩家
- IBM Worklight 6.1 – iOS 7(iPad)WebView将高度扩展为分离键盘的大小