我已经运行了最新的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) 我们正在使用Firebase Analytics(FA) - >跟踪代码管理器(GTM) - > Google Analytics(GA),这适用于传统事件以及session_start和屏幕视图.
如何跟踪Firebase自动事件,例如Install(first_open)/ Uninstall/Crash?这些事件没有记录在GA中,下面是它的设置方式.
google-analytics firebase google-tag-manager firebase-analytics
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不同.