AFKViewController没有调用委托方法

时间:2018-01-13 17:58:15

标签: ios objective-c

我正在尝试使用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上的文档,但它无效。 还有其他人面临这个问题吗?

0 个答案:

没有答案