我们可以检测哪个ios应用程序正在使用我的自定义键盘

时间:2022-02-15 05:31:19

I want to detect in my custom keyboard extension app which application is using my extension. Can we detect any information in keyboard extension about application which is using my extension.I dont think it is possible .if any body have have knowledge about this kindly share it.

我想在我的自定义键盘扩展应用中检测哪个应用程序正在使用我的扩展程序。我们可以检测键盘扩展中有关使用我的扩展程序的应用程序的任何信息。我​​不认为这是可能的。如果任何机构已经有这方面的知识分享它。

Thanks

1 个解决方案

#1


12  

You can try this code in your UIInputViewController

您可以在UIInputViewController中尝试此代码

override public func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)
    if let parentViewController = self.parentViewController {
        var hostBundleID = parentViewController.valueForKey("_hostBundleID")
        println(hostBundleID)
    }
}

But I'm not sure that Apple will approved when you release to App Store

但是当我发布到App Store时,我不确定Apple是否会批准

#1


12  

You can try this code in your UIInputViewController

您可以在UIInputViewController中尝试此代码

override public func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)
    if let parentViewController = self.parentViewController {
        var hostBundleID = parentViewController.valueForKey("_hostBundleID")
        println(hostBundleID)
    }
}

But I'm not sure that Apple will approved when you release to App Store

但是当我发布到App Store时,我不确定Apple是否会批准