Communicate with Custom Keyboard extension with Host App not working in device but works in simulator

混江龙づ霸主 提交于 2019-12-04 17:52:27

I got solution that i create new provisional profile and enable app-groups and setting app group from my Xcode project from target-->capability--Expand App Group and by tap on + add app group like following screenshot:

And doing same thing for my keyboard extension target. Then i used this setting app groups identifier in NSuserDefault:

 _defaultvalue = [[NSUserDefaults alloc] initWithSuiteName:@"group.keyboaredExtention"];
     [_defaultvalue setBool:NO forKey:@"Layout"];
    [_defaultvalue synchronize];

now that working fine in my device and simulator. hope that helps to others.

In iOS8, a custom keyboard and the containing app can communicate using a shared container.

This is achieved by asking the user to allow full access, which is a setting in the iOS settings app under General->Keyboard->your keyboard->Full Access (ON/OFF).

You should add this setting to your keyboard's Info.plist:

RequestsOpenAccess

For further info, read Apple's iOS8 Custom Keyboards API Documentation: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html#//apple_ref/doc/uid/TP40014214-CH16-SW11

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