我正在尝试使用cordova对iOS进行auth0锁定.它似乎工作,但是当我在插件完成后解除视图时我做错了.它被解雇但我不能再与科尔多瓦视图互动.它变得反应迟钝.
这是插件代码:
@implementation lockPlugin
-(void)init:(CDVInvokedUrlCommand*)command {
A0Lock *lock = [A0Lock sharedLock];
A0LockViewController *controller = [lock newLockViewController];
controller.onAuthenticationBlock = ^(A0UserProfile *profile, A0Token *token) {
CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:@{
@"idToken":token.idToken,
@"refreshToken":token.refreshToken,
@"tokenType":token.tokenType,
@"accessToken":token.accessToken,
@"email":profile.email
}];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
[self.viewController dismissViewControllerAnimated:YES completion:nil];
};
[lock presentLockController:controller fromController:self.viewController];
}
@end
Run Code Online (Sandbox Code Playgroud)