Addressed an issue where if the FirebaseApp is initialized before the RequestNativeToken in Android is invoked, the FirebaseApp fails to load.
Issues Resolved
This resolves an issue where Google Crashlytics needs FirebaseApp instance in Maui App's onCreate handler either by using ConfigureLifecycleEvents in MauiProgram or by implementing Shiny.Hosting.IAndroidLifecycle.IOnActivityOnCreate.
Avoids FirebaseApp name [DEFAULT] already exists! error with following StackTrace:
at Java.Interop.JniEnvironment.StaticMethods.CallStaticObjectMethod(JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 21452
at Java.Interop.JniPeerMembers.JniStaticMethods.InvokeObjectMethod(String encodedMember, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:line 165
at Firebase.FirebaseApp.InitializeApp(Context context, FirebaseOptions options) in C:\a\_work\1\s\generated\com.google.firebase.firebase-common\obj\Release\net7.0-android\generated\src\Firebase.FirebaseApp.cs:line 627
at Shiny.Push.PushManager.DoInit()
at Shiny.Push.PushManager.RequestNativeToken()
at Shiny.Push.PushManager.RequestAccess(CancellationToken cancelToken)
API Changes
None
Platforms Affected
Android
Behavioral Changes
None
Testing Procedure
None
PR Checklist
[x] Rebased on top of the target branch at time of PR
Description of Change
Issues Resolved
ConfigureLifecycleEvents
in MauiProgram or by implementingShiny.Hosting.IAndroidLifecycle.IOnActivityOnCreate
.FirebaseApp name [DEFAULT] already exists!
error with following StackTrace:API Changes
None
Platforms Affected
Behavioral Changes
None
Testing Procedure
None
PR Checklist