程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话?

开发过程中遇到离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话的问题如何解决?下面主要结合日常开发的经验,给出你关于离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话的解决方法建议,希望对你解决离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话有所启发或帮助;

我正在使用 Ionic 4 开发 AndroID 应用程序,现在我在使用 @ionic-native/Google-maps 和 @ionic-native/firebase-messaging 时遇到了问题。我无法接收推送通知和触发 Firebase 分析。但我的谷歌地图正常工作。另外,我正在为这些应用程序使用 Jscrambler

我总是在调用 fcm.getToken() 方法时出现此错误,即 fcm 是 firebase-messaging 插件的别名。这是错误:

ERROR Error: Uncaught (in promisE): Default FirebaseApp is not initialized in this process com.xxx.xxx. Make sure to call FirebaseApp.initializeApp(Context) first.
at resolvePromise (/polyfills-es2015.Js:4153)
at /polyfills-es2015.Js:4063
at Object.callBACkFromNative (cordova.Js:297)
at processmessage (cordova.Js:1134)
at processmessages (cordova.Js:1157)
at ZoneDelegate.invoke (/polyfills-es2015.Js:3715)
at Object.onInvoke (/vendor-es2015.Js:82899)
at ZoneDelegate.invoke (/polyfills-es2015.Js:3714)
at Zone.run (/polyfills-es2015.Js:3480)
at /polyfills-es2015.Js:4211

在 app.component.ts 上调用 firebase getToken 的函数在这里:

async initializeApp() {
  await this.platform.ready().then(() => {
    this.params.getUserData().then(userdata => {
      thiS.UserData = userdata;
      // set fcm token when there is saved session on storage for all environment
      this.fcm.getToken().then(this.setdevicEID);
      this.fcm.onTokenrefresh().subscribe(this.setdevicEID);
      if(environment.production) {
        // init fbase analytics only on production & there is saved session on storage
        this.initFbAnalytics();
      }else{
        // subscribe to topic guest_dev when in deveLeopment mode
        this.fcm.subscribe("guest_dev");
      }
    });
  });
};

还有我的 package.Json 文件依赖项:

"dependencIEs": {
"@angular/animations": "^8.2.0","@angular/common": "^8.2.0","@angular/core": "^8.2.0","@angular/forms": "^8.2.0","@angular/platform-browser": "^8.2.0","@angular/platform-browser-dynamic": "^8.2.0","@angular/router": "^8.2.0","@ionic-native/app-rate": "^5.33.1","@ionic-native/camera": "^5.11.0","@ionic-native/clipboard": "^5.27.0","@ionic-native/core": "^5.11.0","@ionic-native/facebook": "^5.28.0","@ionic-native/file": "^5.27.0","@ionic-native/file-opener": "^5.27.0","@ionic-native/firebase-analytics": "^5.11.0","@ionic-native/firebase-messaging": "^5.11.0","@ionic-native/Google-maps": "^5.5.0","@ionic-native/in-app-browser": "^5.12.0","@ionic-native/keyboard": "^5.29.0","@ionic-native/market": "^5.26.0","@ionic-native/mobile-accessibility": "^5.30.0","@ionic-native/social-sharing": "^5.11.0","@ionic-native/splash-screen": "^5.11.0","@ionic-native/sqlite": "^5.29.0","@ionic-native/status-bar": "^5.11.0","@ionic/angular": "^4.7.1","@types/hAMMerJs": "^2.0.36","compare-func": "^2.0.0","cordova-androID": "9.0.0","cordova-browser": "6.0.0","cordova-clipboard": "^1.3.0","cordova-plugin-androIDx": "^1.0.2","cordova-plugin-androIDx-adapter": "^1.1.0","cordova-plugin-appsflyer-sdk": "^4.4.22","cordova-plugin-camera": "4.1.0","cordova-plugin-device": "2.0.2","cordova-plugin-facebook4": "^6.4.0","cordova-plugin-file": "^6.0.2","cordova-plugin-file-opener2": "^3.0.4","cordova-plugin-firebase-analytics": "^3.0.0","cordova-plugin-firebase-messaging": "^3.0.0","cordova-plugin-inappbrowser": "^3.1.0","cordova-plugin-ionic-keyboard": "^2.0.5","cordova-plugin-ionic-webview": "^3.0.0","cordova-plugin-market": "^1.2.0","cordova-plugin-splashscreen": "5.0.2","cordova-plugin-statusbar": "2.4.2","cordova-plugin-whiteList": "1.3.3","cordova-plugin-x-socialsharing": "^5.4.7","cordova-sqlite-storage": "^5.1.0","cordova-support-androID-plugin": "^1.0.1","cordova-support-Google-services": "^1.3.1","core-Js": "^2.6.9","crypto-Js": "^4.0.0","dom-to-image-more": "^2.8.0","es6-promise-plugin": "^4.2.2","hAMMerJs": "^2.0.8","ion-bottom-drawer": "^2.0.0","ion2-calendar": "^3.0.0-rc.0","ionic-long-press": "2.0.3","Jscrambler": "^5.5.25","Jspdf": "^1.5.3","moment": "^2.27.0","rxJs": "~6.5.2","text-mask-core": "^5.1.2","tslib": "^1.10.0","zone.Js": "~0.9.1"
}

哦,这是我的离子信息

Ionic:

   Ionic Cli                     : 6.14.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 4.11.13
   @angular-devkit/build-angular : 0.803.29
   @angular-devkit/scheR_242_11845@atics    : 8.3.29
   @angular/cli                  : 8.2.2
   @ionic/angular-toolkit        : 2.3.3

Cordova:

   Cordova Cli       : 10.0.0
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.4.0) : 1.3.0

System:

   AndroID SDK Tools : 26.1.1 (/home/nt/AndroID/Sdk)
   NodeJs            : v10.19.0 (/usr/bin/nodE)
   npm               : 6.14.4
   OS                : linux 5.8

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话全部内容,希望文章能够帮你解决离子 4:插件 firebase 和 google-maps 的问题 - 默认 FirebaseApp 在此过程 com.superagent.agent 中未初始化。一定要打电话所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。