Can we detect which ios application is using my Custom keyboard

北城余情 提交于 2019-12-05 18:41:55

问题


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:


You can try this code in your 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



来源:https://stackoverflow.com/questions/29642669/can-we-detect-which-ios-application-is-using-my-custom-keyboard

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