Hello,
I have a Firebase authentication problem - but I do not know what is the problem
I followed the instructions
1. Register with Firebase and create a new project
2. Add Android app under project setting
3. the package name matches my app's package name -> b4a.firebase
4. Create a private Key with B4A / Tools/Private-Key and copy the SHA1 Key
5. I use thecreate SHA1 Key for Fingerprint to register the APP at Firebase
6. Download the google-services.json in the b4a project root
after programstart
-> auth.CurrentUser.IsInitialized get false return !?
Where is the problem now?
I hope someone has an idea
Thank you
the manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
I have a Firebase authentication problem - but I do not know what is the problem
I followed the instructions
1. Register with Firebase and create a new project
2. Add Android app under project setting
3. the package name matches my app's package name -> b4a.firebase
4. Create a private Key with B4A / Tools/Private-Key and copy the SHA1 Key
5. I use thecreate SHA1 Key for Fingerprint to register the APP at Firebase
6. Download the google-services.json in the b4a project root
after programstart
-> auth.CurrentUser.IsInitialized get false return !?
Where is the problem now?
I hope someone has an idea
Thank you
B4X:
Region Project Attributes
#ApplicationLabel: B4A Firebase Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Private auth As FirebaseAuth
End Sub
Sub Globals
Private lblName As Label
Private btnSignIn As Button
Private btnSignOut As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
auth.Initialize("auth")
End If
Activity.LoadLayout("layout1")
If auth.CurrentUser.IsInitialized Then
Auth_SignedIn(auth.CurrentUser)
Else
Msgbox("connection error " ,"Firebase")
End If
End Sub
Sub btnSignIn_Click
auth.SignInWithGoogle
End Sub
Sub btnSignOut_Click
auth.SignOutFromGoogle
lblName.Text = "Goodbye!"
End Sub
Sub Auth_SignedIn (User As FirebaseUser)
Log("SignedIn: " & User.DisplayName)
lblName.Text = "Hello: " & User.DisplayName
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
the manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.