Firebase通知令牌问题

时间:2017-02-01 10:39:28

标签: android eclipse cordova firebase

我正在尝试使用Eclipse IDE实现firebase通知。当我运行应用程序时,我必须收到一个令牌,但我没有在我的日志中获取任何令牌,但我的logcat中出现了一些错误。我已经实现了FCM插件在下面的链接。我附加了错误文件和我使用的fcm的链接。如果有人试图帮助我解决错误,我会很高兴.Thankyou。

链接: - https://github.com/fechanique/cordova-plugin-fcm

Here I am attaching the images of errors that i got in my logcat when i run my app

码(FCMPlugin.js): -

var exec = require('cordova/exec');

function FCMPlugin() { 
console.log("FCMPlugin.js: is created");
}
// GET TOKEN //
FCMPlugin.prototype.getToken = function( success, error ){
exec(success, error, "FCMPlugin", 'getToken', []);
}
// SUBSCRIBE TO TOPIC //
FCMPlugin.prototype.subscribeToTopic = function( topic, success, error ){
exec(success, error, "FCMPlugin", 'subscribeToTopic', [topic]);
}
// UNSUBSCRIBE FROM TOPIC //
FCMPlugin.prototype.unsubscribeFromTopic = function( topic, success, error )                 {
exec(success, error, "FCMPlugin", 'unsubscribeFromTopic', [topic]);
}
// NOTIFICATION CALLBACK //
FCMPlugin.prototype.onNotification = function( callback, success, error ){
FCMPlugin.prototype.onNotificationReceived = callback;
exec(success, error, "FCMPlugin", 'registerNotification',[]);
}
// DEFAULT NOTIFICATION CALLBACK //
FCMPlugin.prototype.onNotificationReceived = function(payload){
console.log("Received push notification")
console.log(payload)
}
// FIRE READY //
exec(function(result){ console.log("FCMPlugin Ready OK") }, function(result) {   console.log("FCMPlugin Ready ERROR") }, "FCMPlugin",'ready',[]);
var fcmPlugin = new FCMPlugin();
module.exports = fcmPlugin;

在上面的代码中:1我收到错误要求未定义

0 个答案:

没有答案