How can I open/send a URL to another app on iOS with a Gluon application?

点点圈 提交于 2019-12-06 15:56:38

In the end I made a custom service implementation to ios by following this example: http://docs.gluonhq.com/samples/gonative/

When doing this and after learning some Objective-C I noticed the BrowserService which already had been hinted by José Pereda in the comments to the question - the similarity to my own MyService.m Objective-C file.

After investigating this futher the check in 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]) - makes it unavailable to launch my custom URL Scheme.

By removing that if- statement in the BrowserService the BrowserService can launch another app that has registered a URL-Scheme. And it does it without launching safari/default browser can be mentioned.

So here is a Gluon app launching another Gluon app (that listens for LAUNCH_URL_KEY with RuntimeArgsService)

The correct format also given by José was: outputHello://<your text here>. So I could both leave it empty or adding (a URL to a file for instance) directly after the URL-Scheme part.

However a URL leading to an app's local storage can´t be read from another app due to iOS app Sandbox: What is Sandbox in ios , Can i Trans data between in one App to Another App in iPhone,if possible how

It should be possible to "open url with options" though as suggested here: https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey?language=objc.

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