RN 0.60.0 & new AK v2.0.0 lead to native crash on iOS (Phone Login)
caetius opened this issue · 5 comments
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 inExpected 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
Also crash app on Android
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.
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.
Still doesn't work,
RN: 0.59.1
React Native Facebook Account Kit: 1.2.0 or 2.1.0
it's working in 2.1.0. thanks