1
votes

Refer to this article: http://www.glimsoft.com/06/28/ios-8-today-extension-tutorial/. I did a Today extension can share data with containing app.

But when I move the same code into my Custom Keyboard extension, My custom keyboard never read data from containing app NSUserDefaults file.

I want to know if ios8 don't allow Keyboard extension sharing data with containing app?

xcode 6 (beta5) + ios8 beta5

1
I double check apple article: developer.apple.com/library/prerelease/ios/documentation/… ios8 default don't allow this. It is only set RequestsOpenAccess with YES. But I think RequestsOpenAccess will cause customer think my custom keyboard have big risk.Rick Wu

1 Answers

1
votes

Containing app and extensions are considered as different apps. You can use:

NSUserDefaults *ud = [[NSUserDefaults alloc] initWithSuiteName:@"com.yourname.yourapp"];

To sync data between app and extension.