我要疯了已经, 我试图与phonegap-plugin-push
这样的工作:离子-1和PhoneGap的-插件推我让“PushNotification没有定义”
var options = {
android: {
senderID: "****"
},
ios: {
alert: "true",
badge: "true",
sound: "true"
},
windows: {}
};
// initialize
$cordovaPushV5.initialize(options).then(function (data) {
alert(data);
console.log(data);
// start listening for new notifications
$cordovaPushV5.onNotification();
// start listening for errors
$cordovaPushV5.onError();
// register to get registrationId
$cordovaPushV5.register().then(function (registrationId) {
alert(registrationId);
console.log(registrationId);
$localStorage.token = registrationId;
})
});
,我得到错误:
Uncaught ReferenceError: PushNotification is not defined
at Object.initialize (ng-cordova.js:6378)
at app.js:69
与“远程设备”我甚至不看phonegap-plugin-push
我试图改变和WO与cordova-plugin-firebase
rk,但我不gat令牌, 我试图与window.FirebasePlugin.onTokenRefresh
和window.FirebasePlugin.getToken
工作我真的尝试了一切,但没有为我工作。
我的插件:
cordova-inappbrowser 1.0.6 "InAppBrowser"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-firebase 0.1.24 "Google Firebase Plugin"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 2.0.0 "PushPlugin"
离子信息:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
Gulp CLI : CLI version 3.9.1 Local version 3.9.1
local packages:
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic1 1.3.3
System:
ios-sim : 6.0.0
Node : v6.10.2
npm : 5.3.0
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
我建立与ionic package build android
任何应用程序对我有一个解决方案吗?请!
你可以试试这个链接https://stackoverflow.com/questions/38345799/pushnotification-is-undefined-ng-cordova –
@sunielkalwani我尝试这一点,你可以在图片插件未装载看甚至,顺便说一句,它的工作PhoneGet的建设,但我与离子的工作,因为PhoneGap我无法取代图标和飞溅 –