【问题标题】:how to use prefillPhonenuber in account kit in ios如何在ios的account kit中使用prefillPhonenuber
【发布时间】:2016-12-29 19:43:35
【问题描述】:

我正在使用 accountkit 进行无密码登录,我想使用 prefillphonenumber 但是当我发送字符串应用程序崩溃时,我得到了

[__NSCFConstantString phoneNumber]: 无法识别的选择器发送到实例 0x10a84f0e0

preFillPhoneNumber如何使用?

【问题讨论】:

  • 你能显示你崩溃的代码吗

标签: ios facebook account


【解决方案1】:

我假设你正在使用这个 API

/*!
 @abstract Returns a view controller to be presented to initiate a phone login.

 @param phoneNumber the phone number to be used for login.
 @param state the state for the login request.
 */
- (UIViewController<AKFViewController> *)viewControllerForPhoneLoginWithPhoneNumber:(nullable AKFPhoneNumber *)phoneNumber
                                                                              state:(nullable NSString *)state;

如果是这样,请确保您正在创建 PhoneNumber 对象,而不是直接传递字符串。比如:

AKFPhoneNumber *phoneNumber = [[AKFPhoneNumber alloc] initWithCountryCode:@"+1" phoneNumber:@"123456789"];
UIViewController *vc = [_accountKit viewControllerForPhoneLoginWithPhoneNumber:phoneNumber];
...

从错误看来,您可能正在传递一个字符串。 Xcode 应该将其检测为错误,除非您专门使用 (id) 进行强制转换

【讨论】:

    猜你喜欢
    • 2017-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多