-
Notifications
You must be signed in to change notification settings - Fork 646
-
Hi,
I am experiencing an issue with initializing Firebase in my Avalonia application on Android. The Firebase initialization is not working correctly, and I encounter an error when building in Release mode. Here are the details:
Steps to Reproduce:
- Set up an Avalonia application with Firebase.
- Configure FirebaseOptions.Builder in the OnCreate method of the MainActivity.
- Ensure the ApplicationId is correctly defined as
com.acades.AppUsingPushNotify.
Current Configuration:
- FirebaseOptions.Builder setup:
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var options = new FirebaseOptions.Builder() .SetProjectId("your_project_id") .SetApplicationId("com.acades.AppUsingPushNotify") .SetApiKey("your_api_key") .SetDatabaseUrl("https://your-database-url.firebaseio.com") .Build(); FirebaseApp.InitializeApp(this, options); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); LoadApplication(new App()); }
- ApplicationId in AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.acades.AppUsingPushNotify"> <application android:name=".MainApplication" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <!-- Other configurations --> </application> </manifest>
Expected Behavior:
Firebase should initialize without errors, and the application should receive push notifications as expected.
Actual Behavior:
- Push notifications are not working.
Additional Information:
- I have verified that the ApplicationId matches the ID configured in the Firebase Console.
- Suggestions from other users indicated moving the FirebaseOptions.Builder setup to the OnCreate method and ensuring the ApplicationId is correct, but the issue persists.
Any guidance or assistance would be greatly appreciated.
Environment:
- Firebase SDK version: [Last Version]
- Android version: [9 API 28]
- Avalonia version: [11.0.11]
Thank you,
Alex Pimenta
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment