invertase / react-native-firebase

πŸ”₯ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.53k stars 2.19k forks source link

error in phone authentication in ios #2029

Closed seongminchoob closed 5 years ago

seongminchoob commented 5 years ago

Issue

phone auth was working fine until not but suddenly it started to not work.

I run firebase.auth().signInWithPhoneNumber('MY PHONE NUMBER') .then(confirmResult => { this.setState({confirmResult, verificationOpened: false}) }) .catch(error => console.log(error));

and then I get

Error: {"error":{"code":403,"message":"Requests from this ios client application are blocked.","errors":[{"message":"Requests from this ios client application are blocked.","domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED"}} at createErrorFromErrorData (NativeModules.js:155) at NativeModules.js:104 at MessageQueue.invokeCallback (MessageQueue.js:414) at MessageQueue.js:127 at MessageQueue.guard (MessageQueue.js:314) at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126) at e (RNDebuggerWorker.js:1)

in my console.

It's quite bizarre that it was working fine until not and suddenly is not working

Project Files

iOS

ios/Podfile:

target 'studyDot' do

Uncomment the next line if you're using Swift or would like to use dynamic frameworks

use_frameworks!

rn_path = '../node_modules/react-native' rn_maps_path = '../node_modules/react-native-maps'

Pods for studyDot

pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'CxxBridge', 'DevSupport', 'RCTText', 'RCTActionSheet', 'RCTNetwork', 'RCTWebSocket', 'RCTGeolocation', 'RCTAnimation', 'RCTImage', 'RCTVibration', 'RCTSettings', 'RCTLinkingIOS', ] pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-ccs-naver-login', :path => '../node_modules/react-native-ccs-naver-login' pod 'react-native-blur', :path => '../node_modules/react-native-blur' pod 'react-native-fast-image', :path => '../node_modules/react-native-fast-image'

pod 'Firebase/Core', '~> 5.15.0' pod 'Firebase/Auth', '~> 5.15.0' pod 'Firebase/Messaging', '~> 5.15.0'

pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin' pod 'GoogleSignIn', '~> 4.4.0'

pod 'react-native-maps', :path => '../node_modules/react-native-maps' pod 'react-native-google-maps', path: rn_maps_path # Uncomment this line if you want to support GoogleMaps on iOS pod 'GoogleMaps' # Uncomment this line if you want to support GoogleMaps on iOS pod 'Google-Maps-iOS-Utils' # Uncomment this line if you want to support GoogleMaps on iOS

React Native third party dependencies podspecs

pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

pod 'react-native-async-storage', :path => '../node_modules/@react-native-community/async-storage'

end

post_install do |installer| installer.pods_project.targets.each do |target| if target.name == 'react-native-google-maps' target.build_configurations.each do |config| config.build_settings['CLANG_ENABLE_MODULES'] = 'No' end end if target.name == "React" target.remove_from_project end end end

# N/A

Environment


Think react-native-firebase is great? Please consider supporting the project with any of the below:

mikehardy commented 5 years ago

Looks similar. Maybe you restricted something? https://stackoverflow.com/questions/54720651/firebase-error-requests-from-this-ios-application-empty-are-blocked

seongminchoob commented 5 years ago

I don't think I restricted anything..

abegehr commented 5 years ago

I'm having the same problem – How can I fix this?

mikehardy commented 5 years ago

This showed up for other users recently. It appears to work if you upgrade your Pods to the maximum current version supported by react-native-firebase 5.3.1 (the current max version on the 5.x series). Those pods are 5.20.2

abegehr commented 5 years ago

Thank you for your quick reply @mikehardy! I am running RNFirebase 5.3.1 and just updated the pods from 5.20.1 to 5.20.2. I'm still getting the error. Could I try something else? Do you have further ideas or can I provide more info/logs? I also enabled push notifications, added an APN key in Firebase Console, and added the URL Scheme as described here: https://firebase.google.com/docs/auth/ios/phone-auth#enable-app-verification – I this link could be added to the docs?

mikehardy commented 5 years ago

Hmm - if it's straight up blocking them, it sounds like maybe the Google-services.plist bundle id is not 100% equal to the bundle id from your ipa or something? But honestly I'm not sure beyond what you're doing. Sorry..

abegehr commented 5 years ago

I was missing the development provisioning profile as described here: https://firebase.google.com/docs/cloud-messaging/ios/certs#create_the_provisioning_profile Thanks for the help, @mikehardy !