In iOS 8, when develop a custom keyboard and set RequestsOpenAccess property to YES in info.plist, there is a toggle button at Settings-> Add New Keyboard named \"Allow Full
This code works for me, I also on App Groups : https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW61
May be it will work without App Groups also.
And I used this code :
if(isOpenAccessGranted()){
NSLog("FULL ACCESS ON")
}
else{
NSLog("FULL ACCESS OFF")
}
}
func isOpenAccessGranted() -> Bool {
return UIPasteboard.generalPasteboard().isKindOfClass(UIPasteboard)
}
just use
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
AudioServicesPlaySystemSound(1104);
});
the tirck is ,when the full access is enabled ,the sound will play ,if not ,because it's call is in the background thread will no block the main thread
Apps with app group can use :
func isOpenAccessGranted() -> Bool {
let fm = NSFileManager.defaultManager()
let containerPath = fm.containerURLForSecurityApplicationGroupIdentifier(
AppGroup)?.path
return fm.isWritableFileAtPath(containerPath!)
}
Useful Swift solution by @hoiberg42:
func isOpenAccessGranted() -> Bool {
return UIPasteboard.generalPasteboard().isKindOfClass(UIPasteboard)
}
Works like a charm!
Today, for iOS 9.2, you can check opened access by:
func isOpenAccessGranted() -> Bool {
return UIPasteboard(name: "checkOpenedAccess", create: true) != nil
}
This is the simplest answer by far and doesn't require you to setup app groups. It is tested in production on the app store.
+ (BOOL)isOpenAccessGranted
{
return [UIPasteboard generalPasteboard];
}