【问题标题】:Can we access keychain items that are saved before enabling keychain sharing from app sharing same app group?我们可以访问在共享同一应用组的应用启用钥匙串共享之前保存的钥匙串项目吗?
【发布时间】:2017-10-25 13:45:18
【问题描述】:

我们能否访问在共享同一应用组的应用启用钥匙串共享之前保存的钥匙串项目?如果否,那么最好的解决方法是什么?

【问题讨论】:

    标签: ios iphone ipad ios-app-group uickeychainstore


    【解决方案1】:

    开启keychain共享所有keychain项前“accessGroup”为(AppIdentifierPrefix).bundleIdentifier,开启后改为(AppIdentifierPrefix).keyChainGroupName。

    解决方法是通过钥匙串访问所有钥匙串项目。

    AWSUICKeyChainStore *keychain = [AWSUICKeyChainStore keyChainStoreWithService:@"ServiceName"];
    for (NSDictionary *dictionary in keychain.allItems)
        if ([dictionary[@"accessGroup"] isEqualToString:"(AppIdentifierPrefix).bundleIdentifier"])
            [keychain removeItemForKey:dictionary[@"key"]];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-06
      • 2020-12-25
      • 2017-01-02
      • 1970-01-01
      • 1970-01-01
      • 2018-12-12
      相关资源
      最近更新 更多