chemerisuk / cordova-plugin-firebase-messaging

Cordova plugin for Firebase Cloud Messaging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error - getToken() - Could not connect to the server

cosmicdust471 opened this issue · comments

I have an app in production, running for a few months (Certificates are not expired)

All off a sudden I stopped getting notifications.

Cordova: 10.0.0
iOS: 6.2.0

Calling

cordova.plugins.firebase.messaging.getToken().then(function(token) {
    console.log("Got device token: ", token);
});

Returns Unhandled Promise Rejection: Could not connect to the server.

Package.json dependencies and plugins

{
  "dependencies": {
    "cordova-plugin-buildinfo": "4.0.0",
    "cordova-plugin-customurlscheme": "5.0.2",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-inappbrowser": "^5.0.0",
    "cordova-plugin-keyboard": "^1.2.0",
    "cordova-plugin-safariviewcontroller": "^2.0.0",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.3"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-statusbar": {},
      "cordova-plugin-keyboard": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-device": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-safariviewcontroller": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-x-socialsharing": {
        "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
      },
      "cordova-plugin-network-information": {},
      "cordova-plugin-advanced-http": {
        "ANDROIDBLACKLISTSECURESOCKETPROTOCOLS": "SSLv3,TLSv1"
      },
      "cordova-plugin-customurlscheme": {
        "URL_SCHEME": "admint"
      },
      "cordova-plugin-sign-in-with-apple": {},
      "cordova-plugin-taptic-engine": {},
      "cordova-plugin-qrscanner": {},
      "cordova-plugin-firebase-messaging": {
        "ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.+",
        "ANDROIDX_CORE_VERSION": "1.6.+",
        "IOS_FIREBASE_POD_VERSION": "~> 8.8.0"
      },
      "cordova-plugin-firebase-analytics": {},
      "cordova-plugin-proguard": {},
      "cordova-plugin-nativeclicksound": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  },
  "devDependencies": {
    "cordova-android": "^9.1.0",
    "cordova-ios": "^6.2.0",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-advanced-http": "^3.2.2",
    "cordova-plugin-analytics": "^2.0.0",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-firebase-analytics": "^6.1.0",
    "cordova-plugin-firebase-messaging": "^6.1.0",
    "cordova-plugin-nativeclicksound": "0.0.4",
    "cordova-plugin-network-information": "^3.0.0",
    "cordova-plugin-proguard": "^2.2.0",
    "cordova-plugin-purchase": "^10.6.1",
    "cordova-plugin-qrscanner": "^3.0.1",
    "cordova-plugin-sign-in-with-apple": "^0.1.2",
    "cordova-plugin-taptic-engine": "^2.2.0",
    "cordova-plugin-whitelist": "^1.3.5",
    "cordova-plugin-x-socialsharing": "^6.0.3",
    "cordova-support-android-plugin": "^1.0.2",
    "es6-promise-plugin": "^4.2.2",
    "jetifier": "^2.0.0"
  }
}

Firebase configuration:
Screen Shot 2021-12-28 at 00 11 29

Screen Shot 2021-12-28 at 00 09 22

Turns out it was just my VPN configuration blocking the Firebase API...