Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN 0.60.0 & new AK v2.0.0 lead to native crash on iOS (Phone Login) #200

Closed
caetius opened this issue Aug 1, 2019 · 5 comments
Closed

Comments

@caetius
Copy link

caetius commented Aug 1, 2019

Issue Description

I upgraded my project from RN 0.56.0 to 0.60.0, and as a part of that I've spent significant time working through the details of getting v2.0.0 (the breaking version) of this library working on Android. Android works using the trick of setting the SDK version to 5.0.0 as discussed in #195.

HOWEVER, the iOS version is giving me inexplicable trouble. Both versions of the code call AccountKit.loginWithPhone() (via the LoginButton), yet the iOS app crashes with a native NSException:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AKFNavigationController setEnableInitialSMSButton:]: unrecognised selector sent to instance 0x107014000'

Steps to Reproduce / Code Snippets

Start a demo project with a single view containing the LoginButton below. I use CocoaPods to auto-link all the modules (react-native-facebook-account-kit 2.0.0 and AccountKit 5.0.0). When you click this button, the app will crash. I see it relates to setEnableInitialSMSButton, and I am aware that after AccountKit 5.2.0 (#199 ) there's no such function, but this shouldn't affect me. I've also considered a misconfiguration, but my Info.plist is fine. This sounds like a problem with the iOS linking, but I'm out of ideas. HELP!

-> Imports

import AccountKit, {
LoginButton,
Color,
StatusBarStyle,
} from 'react-native-facebook-account-kit'

-> Commands
AccountKit.configure({theme: {...})

-> View

this.onLogin(token)} onError={(e) => this.onLoginError(e)}> Log in

Expected Results

The view prompting the user to enter their phone number should appear (this behaviour worked for RN 0.56.0 on both platforms, and it works on Android for RN 0.60.0).

Additional Information

  • React Native Account Kit version: 5.0.0 or 5.0.1 (tried both)
  • React Native version: 0.60.0
  • Platform(s) (iOS, Android, or both?): iOS
  • Platform Version(s): 12.2
@yosukapro
Copy link

Also crash app on Android

@caetius
Copy link
Author

caetius commented Aug 4, 2019

For anyone who runs into this issue on iOS, you can go inside the node_modules:
react-native-facebook-account-kit/ios/RNAccountKitViewController
and comment out line 54: "viewController.enableInitialSMSButton = self.setEnableInitialSmsButton;"

This selector is not defined in the Obj-C library 5.0.0.

@caetius caetius closed this as completed Aug 4, 2019
@jpgarcia
Copy link
Contributor

jpgarcia commented Aug 5, 2019

Guys, I've just published a new 2.1.0 version which solves the issue you reported in this issue and in #199.

Before running the project make sure you refresh all the dependencies by doing this:

rm -rf ./node_modules ./ios/Pods ./ios/Podfile.lock
cd android
./gradlew clean
cd ../
yarn

Let me know if you found any issue.

@dannyyaou
Copy link

Still doesn't work,

RN: 0.59.1
React Native Facebook Account Kit: 1.2.0 or 2.1.0

@anniewey
Copy link

anniewey commented Oct 1, 2019

it's working in 2.1.0. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants