Ich benutze Ionic2 und baue eine Chat App mit Push Messaging. Ich verwende FCM (Firebase Cloud Messaging). Ich folgte der following tutorial, die das phonegap-plugin-push Plugin verwendet, und alles funktionierte perfekt.Ionic Native Push stürzt ab mit Firebase Cloud Messaging
Mein PC stürzte dann und ich musste alle meine Cordova-Plugins neu installieren. Seitdem verursachen die Push-Benachrichtigungen einen Absturz der App. Wenn ich versuche, Push
initialisieren und der folgende Code wird aufgerufen:
import { StatusBar, Push, SQLite } from 'ionic-native';
...
let push = Push.init({
android: {
senderID: "XXXXXXXXXXXXXX",
topics: topics
},
ios: {
alert: "true",
badge: false,
sound: "true",
topics: topics
},
windows: {}
});
ich folgende Fehlermeldung erhalten, mit nichts in den Protokollen:
Wenn ich es nicht nutzen Push-machen funktioniert ohne Fehler, aber ich möchte natürlich Push-Benachrichtigungen verwenden.
Wenn jemand irgendwelche Vorschläge hat, würde ich es begrüßen.
Ich habe die folgenden ohne Erfolg versucht:
- Neu installieren aller Cordova Plugins
- Erstellt ein neues FCM Projekt und verwendet seine SENDER_ID
- & entfernen In der Android-Plattform (
ionic platform remove android
&ionic platform add android
) - Erprobte Neuinstallation von Ionic Native (
npm install ionic-native --save
)
Weitere Informationen:
E:\Development\IDE\ionic-apps\theWhoZoo>cordova plugin list cordova-plugin-camera 2.2.0 "Camera" cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-console 1.0.3 "Console" cordova-plugin-crop 0.1.0 "CropPlugin" cordova-plugin-device 1.1.2 "Device" cordova-plugin-geolocation 2.2.0 "Geolocation" cordova-plugin-network-information 1.3.0 "Network Information" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-statusbar 2.1.3 "StatusBar" cordova-plugin-whitelist 1.2.2 "Whitelist" cordova-sqlite-plugin 3.0.0 "Cordova SQLite Plugin" cordova-sqlite-storage 1.4.8 "Cordova sqlite storage plugin" ionic-plugin-keyboard 2.2.1 "Keyboard" phonegap-plugin-push 1.8.3 "PushPlugin" plugin.google.maps 1.3.9 "phonegap-googlemaps-plugin"
npm install
gibt mir folgendes:
....
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. > [email protected] postinstall E:\Development\IDE\ionic-apps\theWhoZoo\node_modules\ionic-gulp-sass-build\node_modules\gulp-sass\node_modules\node-sass > node scripts/build.js "E:\Development\IDE\ionic-apps\theWhoZoo\node_modules\ionic-gulp-sass-build\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-48\binding.node" exists. testing binary. Binary is fine; exiting. npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Richard\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! node v6.2.2 npm ERR! npm v2.15.11 npm ERR! code EPEERINVALID npm ERR! peerinvalid The package @angular/[email protected] does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]^2.0.0-rc.4 npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected] npm ERR! peerinvalid Peer [email protected] wants @angular/[email protected]^2.0.0 npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected] npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected] npm ERR! Please include the following file with any support request: npm ERR! E:\Development\IDE\ionic-apps\theWhoZoo\npm-debug.log