如何从其App Extension启动父iOS应用程序 [英] How to launch a parent iOS App from its App Extension

查看:463
本文介绍了如何从其App Extension启动父iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道如何从应用扩展程序的视图控制器启动父应用程序?

Does any one know how to launch the parent app from the app extension's view controller?

我只想从其应用扩展程序启动主应用程序。

I just want to launch the main app from its app extension.

推荐答案

在WWDC会议中创建iOS和OS X扩展,第1部分大约22分钟标记使用 openURL:completionHandler:来自UIViewController的方法 extensionContext 打开自定义URL方案

In the WWDC session Creating Extensions for iOS and OS X, Part 1 around the 22 minute mark the say to use the openURL:completionHandler: method from the UIViewController's extensionContext to open a custom URL scheme

[self.extensionContext openURL:[NSURL URLWithString:@"your-app-custom-url-scheme://your-internal-url"]
             completionHandler:nil];

这篇关于如何从其App Extension启动父iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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