我正在尝试使用fbaccountKit一切正常,但代理人没有被调用。这是我的代码:
- (void)viewDidLoad {
[super viewDidLoad];
[PikMe drawDropShadowOnView:self.cardView shadowSize:5];
_accountKit = [[AKFAccountKit alloc]
initWithResponseType:AKFResponseTypeAuthorizationCode];
self.textField.keyboardType = UIKeyboardTypeNumberPad;
}
- (void)loginWithPhone:(id)sender{
AKFPhoneNumber *number = [[AKFPhoneNumber alloc]initWithCountryCode:@"+92" phoneNumber:self.textField.text];
NSString *inputState = [[NSUUID UUID] UUIDString];
UIViewController<AKFViewController> *viewController =
[_accountKit viewControllerForPhoneLoginWithPhoneNumber:number
state:inputState];
[self _prepareLoginViewController:viewController]; // see above
[self presentViewController:viewController animated:YES completion:NULL];
}
- (void)_prepareLoginViewController:(UIViewController<AKFViewController> *)loginViewController{
loginViewController.delegate = self;
loginViewController.uiManager = [[AKFSkinManager alloc]
initWithSkinType:AKFSkinTypeContemporary
primaryColor:pikMeColor];
}
- (void)didCompleteLoginWithAccessToken:(id<AKFAccessToken>)accessToken
viewController:(UIViewController<AKFViewController> *)viewController
state:(NSString *)state{
NSLog(@"delegate");
}
- (void)didCompleteLoginWithAuthorizationCode:(NSString *)code
viewController:(UIViewController<AKFViewController> *)viewController
state:(NSString *)state{
NSLog(@"delegate");
}
- (void)didFailWithError:(NSError *)error
viewController:(UIViewController<AKFViewController> *)viewController{
NSLog(@"%@ did fail with error: %@", viewController, error);
}
- (void)viewControllerDidCancel:(UIViewController<AKFViewController> *)viewController{
NSLog(@"delegate");
}
请帮助,我在这里做错了什么? 我已经关注了facebookdeveloper.com上的文档,但它无效。 还有其他人面临这个问题吗?