0

I recently got an app from an iOS developer, and it is working with his bundle identifier in xCode. but when I change the bundle identifier to mine, it stops working(database is not connecting). What should I do to make it work? Making a new Firebase account and use my bundle identifier to get a new GoogleService-Info.plist and replace it with his GoogleService-Info.plist is enough ? (I did that too but still not connecting to the database) what have I missed ?

UPDATE

I want to connect to my new empty database that comes with the new firebase account , not the previous database.

adjuremods
  • 2,938
  • 2
  • 12
  • 17

2 Answers2

1

If you read the GoogleService-Info.plist the DATABASE_URL should be different in two files. Thats why you can't connect to the previous database. You can export data from the first one and then import those json to the new database. Is this solution okay for your case?

Updated

Okay, step by step. There are error messages showing in the XCode console. Do you know how to find them? I created a Firebase file, replaced a new plist. And then I run the app, when I try to sign up. It shows a pop up "Problem with creating a new user, Problem connecting to database, Pleaes try again later". But the important thing is! This is not the error code. When you look at the XCode console, it shows:

<FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=501 "(null)" UserInfo={msg=Missing device credentials. Retry later.}
<FIRInstanceID/WARNING> Failed to retrieve the default GCM token after 5 retries

Then you can google it. How to fix Failed to fetch default token error?

Community
  • 1
  • 1
Pang Ho Ming
  • 1,299
  • 10
  • 29
  • I want to connect to my new empty database, not the previous one , thanks for the answer – theModerator713 Dec 01 '16 at 09:53
  • Base on your code you provide to us @ the last question, the code should be fine. Yes you need a plist from the new account. And I doubt that if you really cannot connect to the new database. Any error code? Or may be it does connect to the new one but nothing shows up just because the database is empty. – Pang Ho Ming Dec 01 '16 at 09:58
  • I can't even sign up, if the database is connecting , I should be able to sign up right ? there is no error code showing , please try changing the firebase account if possible – theModerator713 Dec 01 '16 at 10:05
  • I seems like you need to do a lot of effort to create those token. The official document is a good starting point. https://firebase.google.com/docs/ios/setup. And feel free to ask question @ Stackoverflow. Have a nice day. – Pang Ho Ming Dec 01 '16 at 10:35
  • actually , I did that earlier , I enabled keychain sharing , but even after that i get the "cannot connect to the database" – theModerator713 Dec 01 '16 at 10:35
  • The GCM is the most troublesome part :'( https://firebase.google.com/docs/cloud-messaging/ios/certs. Gook luck bro – Pang Ho Ming Dec 01 '16 at 10:39
  • thank you bro !! means a lot ! you made my day :) @PangHoMing – theModerator713 Dec 01 '16 at 10:42
0

after trying so much time I found the error it was

FIRAuthErrorCodeOperationNotAllowed = 17006

Indicates that email and password accounts are not enabled. Enable them in the Auth section of the Firebase console

to get rid of this all I have to do was go to,

https://console.firebase.google.com/project/myproject/authentication/providers

and select Sign-In method and enable email and password