小编use*_*630的帖子

iOS 11模拟器不允许LAContext和FaceID

我已经运行了最新的Xcode 9 GM(2017年9月13日)并且已经设置Hardware > Face ID > Enrolled了模拟器以及Deployment Target 11.0.但是我收到错误代码-6 LAErrorTouchIDNotAvailable.

有什么设置我不见了?

let myContext = LAContext()
let myLocalizedReasonString = "You are pretty"

var authError: NSError?
if #available(iOS 8.0, macOS 10.12.1, *) {
    if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
        myContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: myLocalizedReasonString) { success, evaluateError in
            if success {

                print("// User authenticated successfully, take appropriate action")
            } else {
                 print(" // User did not authenticate successfully, look at error and take appropriate action")
            }
        }
    } else …
Run Code Online (Sandbox Code Playgroud)

ios ios-simulator ios11 iphone-x face-id

6
推荐指数
2
解决办法
4985
查看次数

如何使用跟踪代码管理器跟踪Firebase Analytics安装

我们正在使用Firebase Analytics(FA) - >跟踪代码管理器(GTM) - > Google Analytics(GA),这适用于传统事件以及session_start和屏幕视图.

如何跟踪Firebase自动事件,例如Install(first_open)/ Uninstall/Crash?这些事件没有记录在GA中,下面是它的设置方式.

事件名称为first_open

google-analytics firebase google-tag-manager firebase-analytics

5
推荐指数
0
解决办法
395
查看次数

如何检索MSConversation中的参与者名称?

MSConversation为我们提供了本地参与者和远程参与者.但是,我无法检索自己或其他人的显示名称.我如何得到这些名字? https://developer.apple.com/reference/messages/msconversation

let ids = activeConversation?.remoteParticipantIdentifiers
let otherId = ids?[0].uuidString
let ownId = activeConversation?.localParticipantIdentifier.uuidString
let predicate = CNContact.predicateForContacts(withIdentifiers: [otherId!]);

do { 
    let contacts = try CNContactStore().unifiedContacts(matching: predicate, keysToFetch: [CNContactFamilyNameKey, CNContactGivenNameKey, CNContactNicknameKey, CNContactIdentifierKey])

    for contact in contacts{
        print(contact.givenName)
        print(contact.familyName)
        print(contact.identifier)
    }

} catch let err{
    print(err)
}
Run Code Online (Sandbox Code Playgroud)

如上所述,我试图搜索CNContactsStore,MSConversation中的UUID与CNContact不同.

imessage nsuuid swift ios10

3
推荐指数
1
解决办法
1479
查看次数