问题
When attempting to beta test my application with some external users, none of them could properly enter the app using the phone number sms verification. The developers could all use the application when built directly from Xcode, but anyone who installed via a link could not use it.
Each user attempting to sign in / sign up would get an error readout of Token Mismatch - with no other info.
I have a valid production APNS certificate, why is this not working??
回答1:
Steps I took to solve the problem:
- Ensure I had both a valid
developmentandproductionAPNS certificate uploaded to the Firebase Dashboard, under 'Project Settings' > 'Cloud Messaging'
- In Xcode, in the
<my app>.entitlements file, make sure the APS Environment value is set to either 'development' or 'production', depending on your testing situation.
- Finally (this is what I was missing), check inside your
AppDelegate.swiftand inside the method fordidRegisterForRemoteNotificationsWithDeviceToken, change the value from.sandboxto.prod, or to.unknownto let the app bundle determine which token type to use, based on your provisioning profile.
来源:https://stackoverflow.com/questions/46490693/firebase-sms-verification-on-ios-token-mismatch