本文介绍了默认FirebaseApp在此过程中未初始化.确保首先调用FirebaseApp.initializeApp(Context)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认FirebaseApp在此过程中未初始化.确保首先调用FirebaseApp.initializeApp(Context).

Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first.

我尝试了很多事情,但无法在设备中获取通知.

i have tried with many things but i am not able to Get notifications in devices.

我也尝试了以下方法.

在属性"窗格中,设置构建操作",然后在解决方案资源管理器"窗口中选择google-services.json.

In the Properties pane, set the Build Action Select google-services.json in the Solution Explorer window.

在属性"窗格中,将生成操作"设置为GoogleServicesJson(如果未显示GoogleServicesJson生成操作,请保存并关闭解决方案,然后重新打开它):至GoogleServicesJson

In the Properties pane, set the Build Action to GoogleServicesJson (if the GoogleServicesJson build action is not shown, save and close the Solution, then reopen it):to GoogleServicesJson

之前,通知是有效的,但是在我将xamarin表单更新为2.5.0.280555和Xamarin.Firebase.Messaging.42.1021.1之后,它停止了工作.

Notification was working before, but after I update the xamarin forms to 2.5.0.280555 and Xamarin.Firebase.Messaging.42.1021.1, it stopped working .

推荐答案

请确保:

  1. AndroidManifest.xml中的软件包名称与google-services.json
  2. 中的软件包名称相同
  3. google-services.json构建操作设置为GoogleServicesJson
  4. 第2步后,重新启动您的IDE&清洁重建
  5. LoadApplication(..)
  6. 之前在MainActivity.OnCreate中明确调用FirebaseApp.InitializeApp(Application.Context);
  1. Package name in AndroidManifest.xml is identical to one in the google-services.json
  2. google-services.json build action is set to GoogleServicesJson
  3. After step 2 restart your IDE & clean & rebuild
  4. Explicitly call FirebaseApp.InitializeApp(Application.Context); in MainActivity.OnCreate just before the LoadApplication(..)

这篇关于默认FirebaseApp在此过程中未初始化.确保首先调用FirebaseApp.initializeApp(Context)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-03 17:02