我已经开始在基于official documentation的Fighter中设置Firebase电话身份验证.不幸的是,无论我如何try ,我都会在verifyPhoneNumber
方法的verificationFailed
回调中得到具有以下值的FirebaseAuthException
:
code: "invalid-app-credential"
credential: null
email: null
message: "Token mismatch"
phoneNumber: null
plugin: "firebase_auth"
stackTrace: null
tenantId: null
我已经创建了一个简单的存储库来重现这个问题:https://github.com/peternagy1332/basic_phone_auth
- 我使用
flutterfire configure
将该应用程序添加到现有的Firebase项目中,并在那里创建了iOS应用程序. - 我加了
firebase_core@2.1.1
和firebase_auth@4.1.1
- 我已经在Firebase上启用了电话登录方法,并添加了+447123456作为测试号码,代码是000000
- 我已经添加了具有
Background fetch
和Remote notifications
选项的Push notification
和Background modes
功能. - 我把
GoogleService-Info.plist
的REVERSED_CLIENT_ID
加成了URL Scheme
. - 在苹果开发者页面上,我生成了一个
Apple Push Notifications service (APNs) service
的新密钥,并将其作为APNs Authentication Key
上传到Firebase.
官方文件中的setup section个让我想到了this documentation个.这表明可能需要对SWIFT代码进行额外的修改,但这一点真的不清楚.我是一名Ffltter开发人员,而不是原生iOS开发人员,我认为我实际上不需要做所有这些事情.