从iOS8自定义键盘启动包含应用程序 [英] launch containing app from iOS8 Custom Keyboard

查看:124
本文介绍了从iOS8自定义键盘启动包含应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想启动我的包含应用。

I want to launch my containing app.

我尝试使用网址方案。

网址方案从其他地方推出应用程序 - 所以问题不存在。

The URL scheme launched the app from other places - so the problem is not there.

看起来这个对象是零:

   self.extensionContext

因此我无法运行此方法:

thus i can't run this method:

[self.extensionContext openURL:url completionHandler:nil];

我可以启动我的应用吗? URL方案是否可以在自定义键盘中使用?

Can I launch my app? Do URL Schemes work in a custom keyboard?

谢谢!

推荐答案

回答我自己的问题:

在iOS8自定义键盘中,extensionContext对象为nil,因此我无法使用它来启动包含应用程序。

In an iOS8 custom keyboard, the extensionContext object is nil, thus I can't use it to launch the containing app.

我想出的解决方法是:


  1. 为您的应用创建网址方案

  2. 向您的inputView添加UIWebView

  3. 在webview中加载包含应用的网址方案

我不确定苹果是否会允许这种情况发生,但它现在有效。

I'm not sure if Apple will allow this to happen, but it works now.

这篇关于从iOS8自定义键盘启动包含应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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