Check full access for custom keyboard extension

后端 未结 2 1695
名媛妹妹
名媛妹妹 2020-12-30 17:53

I need to check full access for custom keyboard extension. I found this link.

How to check the "Allow Full Access" is enabled in iOS 8?

It say we c

相关标签:
2条回答
  • 2020-12-30 18:31
    +(bool)fullAccessAccessible{
        NSUserDefaults *myDefaults = [[NSUserDefaults alloc]
                                  initWithSuiteName:APP_GROUP_NAME];
        NSString* test_key = @"extension test full access";
        [myDefaults setBool:TRUE forKey:test_key];
        BOOL res = [myDefaults boolForKey:test_key];
        return res == TRUE;//set and get compare
    }
    
    0 讨论(0)
  • 2020-12-30 18:33

    You can try reading a value from the shared NSUserDefaults - if the value is null, then allowFullAccess is off

    Or you can try reading files from the shared file system using containerURLForSecurityApplicationGroupIdentifier

    0 讨论(0)
提交回复
热议问题