简体   繁体   中英

Can we detect which ios application is using my Custom keyboard

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

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

ios 16+, "_hostBundleID" the value is nil

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM