在此处输入图像描述在此处输入图像描述我在成功后编写用于 otp 验证的代码,它没有导航到其他视图控制器。
Digits *digits = [Digits sharedInstance];
DGTAuthenticationConfiguration *configuration = [[DGTAuthenticationConfiguration alloc] initWithAccountFields:DGTAccountFieldsDefaultOptionMask];
configuration.phoneNumber = completePhoneNumber;
[digits authenticateWithViewController:nil configuration:configuration completion:^(DGTSession *newSession, NSError *error){
if (newSession.userID) {
// TODO: associate the session userID with your user model
NSString *msg = [NSString stringWithFormat:@"Phone number: %@", newSession.phoneNumber];
NSLog(@"Phone number message %@",msg);
UIStoryboard *storyboard1=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
Hello *welcom=[storyboard1 instantiateViewControllerWithIdentifier:@"hello"];
[self.navigationController pushViewController:welcom animated:YES];
} else if (error) {
NSLog(@"Authentication error: %@", error.localizedDescription);
}
}];
检查此代码
UIViewController *bbp=[[UIViewController alloc]initWithNibName:@"UIViewController" bundle:nil];
UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:bbp];
//[self.navigationController presentModalViewController:passcodeNavigationController animated:YES];
[self.navigationController pushViewController:passcodeNavigationController animated:YES];