Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue with Initializing Firebase in Avalonia Application on Android #6068

Unanswered
aspepper asked this question in Q&A
Discussion options

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:

  1. Set up an Avalonia application with Firebase.
  2. Configure FirebaseOptions.Builder in the OnCreate method of the MainActivity.
  3. 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

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /