1

LocalAuthentication处理设备的正确方法是什么NSIntent?目前它没有显示在 Siri 中弹出的付款已发送INSendPaymentIntent

- (void)handleSendPayment:(INSendPaymentIntent *)intent
           completion:(void (^)(INSendPaymentIntentResponse *response))completion {

        __block INSendPaymentIntentResponse *siriResponse;

        LAContext *context = [[LAContext alloc] init];
        NSError *error = nil;

        // Check if device supports TouchID
        if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {

            // TouchID supported, show it to user
            [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics

                    localizedReason:@"Unlock using Touch ID to transaction”
                              reply:^(BOOL success, NSError *error) {

                                  if (success) {
                                      // This action has to be on main thread and must be synchronous
                                      dispatch_async(dispatch_get_main_queue(), ^{
                                        //  Payment handling code goes here
                                      });
                                  }
                                  else if (error) {
                                      dispatch_async(dispatch_get_main_queue(), ^{
                                          siriResponse = [[INSendPaymentIntentResponse alloc] initWithCode:INSendPaymentIntentResponseCodeSuccess userActivity:nil];
                                      });
                                  }
                              }];
        }
}

如果我删除本地身份验证付款就可以了!!

4

0 回答 0