iOS Tutorial FirebaseAuth - Authenticate your users (Google + Facebook)

Start with this tutorial: https://www.b4x.com/android/forum/threads/firebase-integration.68623/

FirebaseAuth allows your app to identify the user based on their Google or Facebook accounts.

We will start with Google integration.

upload_2016-7-4_15-22-44.png


1. Make sure that Google is enabled under Authentication - Sign-in methods:

SS-2016-07-04_15.25.27.png


2. Open GoogleService-Info.plist with a text editor and copy the key that is under REVERSED_CLIENT_ID:

SS-2016-07-04_15.28.07.png


3. Add this value with:
B4X:
#UrlScheme: com.googleusercontent.apps.250280117927-3n8kkn0a8oveo2olg2tcnuefmntv5toi

4. Handle Application_OpenUrl and call FirebaseAuth.OpenUrl. Note that the signature of Application_OpenUrl has changed in v2.80:

B4X:
Private Sub Application_OpenUrl (Url As String, Data As Object, SourceApplication As String) As Boolean
   If auth.OpenUrl(Url, Data, SourceApplication) Then Return True
   Return False
End Sub

See the attached project. Don't forget to download GoogleService-Info.plist to Files\Special.

iFirebaseAuth v2.51 is attached. It is an internal library. It adds a SignError (Error As Exception) event.
 

Attachments

  • FirebaseAuthGoogle.zip
    26.5 KB · Views: 1,337
  • iFirebaseAuth.zip
    69.6 KB · Views: 639
Last edited:

narek adonts

Well-Known Member
Licensed User
Longtime User

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
For me really NOT SHOWING any error messages, just die the app when pass in the "auth" line.

I can´t see where I put some wrong, it´s just like use the sample attach by Erel.

face1.png


fire1.png




#UrlScheme: com.googleusercontent.apps.172587243087-o2lb4ol8gr6s1h0nntc8vm46a7clhigl
#QueriesSchemes: fbapi
#QueriesSchemes: fb-messenger-api
#QueriesSchemes: fbauth2
#QueriesSchemes: fbshareextension
#UrlScheme: fb989479777824608


Someboady can help me? Or use another solution to login with Facebook?

 
Top