EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 442 forks source link

can't get token registration on ios... #489

Open Niko87 opened 7 years ago

Niko87 commented 7 years ago

Im not getting the token registration in version 4.1.1, but yes in 3.10.2.. idk why... its frustrating... the log not saying anything special... only in ios, android is working perfect...


`{
  "description": "Demoapp App",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.app.demo",
    "tns-android": {
      "version": "3.1.1"
    },
    "tns-ios": {
      "version": "3.2.0"
    }
  },
  "scripts": {
    "tslint": "tslint -p tsconfig.json",
    "ns-bundle": "ns-bundle",
    "publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
    "generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
    "start-android-bundle": "npm run ns-bundle --android --run-app",
    "start-ios-bundle": "npm run ns-bundle --ios --run-app",
    "build-android-bundle": "npm run ns-bundle --android --build-app",
    "build-ios-bundle": "npm run ns-bundle --ios --build-app"
  },
  "dependencies": {
    "@angular/common": "~4.1.0",
    "@angular/compiler": "~4.1.0",
    "@angular/core": "~4.1.0",
    "@angular/forms": "~4.1.0",
    "@angular/http": "~4.1.0",
    "@angular/platform-browser": "~4.1.0",
    "@angular/router": "~4.1.0",
    "email-validator": "^1.0.7",
    "nativescript-angular": "3.1.3",
    "nativescript-fresco": "^3.0.4",
    "nativescript-iqkeyboardmanager": "1.0.1",
    "nativescript-ngx-fonticon": "^2.2.3",
    "nativescript-permissions": "^1.2.3",
    "nativescript-plugin-firebase": "^3.10.2",
    "nativescript-social-share": "~1.3.2",
    "nativescript-telerik-ui": "^3.0.4",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-videoplayer": "^3.0.9",
    "reflect-metadata": "^0.1.8",
    "rxjs": "^5.4.0",
    "tns-core-modules": "3.1.1",
    "zone.js": "^0.8.11"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~4.1.0",
    "@ngtools/webpack": "~1.5.3",
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.0",
    "codelyzer": "^3.0.1",
    "copy-webpack-plugin": "~4.0.1",
    "extract-text-webpack-plugin": "~2.1.0",
    "filewalker": "^0.1.3",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "^0.4.5",
    "nativescript-dev-webpack": "0.7.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.1.0",
    "tslint": "^5.4.2",
    "typescript": "~2.3.4",
    "webpack": "~3.0.0",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1"
  }
}`
papangproduction commented 7 years ago

Hi, We have the same issue. After some debug, the onPushTokenReceivedCallback and onMessageReceivedCallback are not fired.

firebase.getCurrentPushToken().then((token: string) => {
    // may be null if not known yet
    console.log("Current push token: " + token);
  });

this function retrieves correctly the token. So the init is done, and its not firebase communication issue with APNS.

and yes, its very frustrating :)

Niko87 commented 7 years ago

Thanks for your response, in my case this function returns null .. in 4.1.1 ..

Frustrating is has been chosen nativescript over ionic.. i don’t think the time wasted making it work (different libraries versions, angular, firebase, fresco, etc) is recompensed in any case... development was a nightmare (just because libraries don't work as expected!!!!).. and the production app its heavy, and not fast.. nativescript is overrated.. but i have to finish this app for go ahead !

AlbertoVP commented 7 years ago

The same has happened to me with push notifications. Completely agree with you. The idea of ​​nativescript is good, but it's all very poorly documented. Each step is a little hell until you get what you need.

EddyVerbruggen commented 7 years ago

@AlbertoVP Would you mind channeling those frustrations into PR's to make the documentation better?

papangproduction commented 7 years ago

@EddyVerbruggen have you been able to reproduce this issue please ?

henrychavez commented 7 years ago

@Niko87 @papangproduction @EddyVerbruggen @AlbertoVP I notice that the onPushTokenReceivedCallback method is called once when the user install the app then u have to use the getCurrentPushToken and to handle the push notification just need to use the addOnMessageReceivedCallback method