颤动:如果禁用了应用程序委托模糊处理,则需要将UIApplicationDelegate收到的远程通知转发到FIRAuth的 [英] flutter: If app delegate swizzling is disabled, remote notifications received by UIApplicationDelegate need to be forwarded to FIRAuth's
问题描述
当我要在Firebase中使用sms auth时,该应用程序仅在iOS上失败
When i want to use sms auth with firebase the app fails only on iOS
已在Firebase上配置了APN证书,并且Info.plist
中的FirebaseAppDelegateProxyEnabled
为否.在verifyPhoneNumber方法期间发生错误.
The APN certificate is alredy configured on firebase and FirebaseAppDelegateProxyEnabled
is NO in Info.plist
. The error is occuring during the verifyPhoneNumber method.
这是flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, v1.7.0, on Mac OS X 10.14.5 18F132, locale en-PE)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2019.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.36.1)
[✓] Connected device (1 available)
这是我的代码
void sendSms(String fullNumber) {
FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: fullNumber,
timeout: Duration(minutes: 1),
verificationCompleted: (AuthCredential phoneAuthCredential) async {
_smsController?.add('loading');
FirebaseUser firebaseUser = await FirebaseAuth.instance
.signInWithCredential(phoneAuthCredential);
_verifyUser(firebaseUser);
},
verificationFailed: (err) {
print(err.message);
print(err.code);
_smsController?.add('UNKNOWN_ERROR');
},
codeSent: (verificationId, [forceResendingToken]) {
_verificationId = verificationId;
_smsController?.add('code_sent');
},
codeAutoRetrievalTimeout: (verificationId) {},
);
}
错误消息:
flutter: If app delegate swizzling is disabled, remote notifications received by UIApplicationDelegate need to be forwarded to FIRAuth's canHandleNotificaton: method.
flutter: verifyPhoneNumberError
推荐答案
解决方案:
我在flutter存储库中找到了此,目前可以使用.
I found this in flutter repository and currently works.
将当前的firebase_auth
版本替换为
firebase_auth:
git:
url: https://github.com/collinjackson/plugins.git
ref: 441417c2fed0ff26bf84a49ab2c5ffd2aa5487de
path: packages/firebase_auth
这篇关于颤动:如果禁用了应用程序委托模糊处理,则需要将UIApplicationDelegate收到的远程通知转发到FIRAuth的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!