IOS 8 App Group Access Container Application File in Keyboard Extension

I want to access the container application file in my custom keyboard extension through the application group function. For this purpose, I created a group identifier on my Apple portal, and also added it to both of my targets (keyboard and application). I successfully access the data through NSUserDefaultsmy work, I can access the data. But I'm stuck in getting a file from a container application. I have an access url

NSURL *containerURL = [[NSFileManager defaultManager] 
           containerURLForSecurityApplicationGroupIdentifier:@"group.com.company.app"];

NSURL Returns the URL as follows.

/Users/AxisCyberTech1/Library/Developer/CoreSimulator/Devices/1649BBF4-6615-4E53-BFC9-A3D07F3CA70A/data/Containers/Shared/AppGroup/49A4F24B-30A8-474E-8FFA-072E0DF61CBD/

but this path does not have access to any file from the container source package. How can I access the container container file

+4
source share
2 answers

There is another limitation for keyboard expansion. You must set RequestsOpenAccess to YES in Info.plist, after which it will be able to access the files.

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html#//apple_ref/doc/uid/TP40014214-CH16-SW2

-2
source

To access the containing application package, the sandbox is isolated, not alloew for access from outside the application. Call [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:YOUR_APP_GROUP_ID]to get the container url for the application group.

, NSFileCoordinator . .

-2

All Articles