我正在尝试使用 bluemix 和 mobilefirst 实现推送通知。我已经使用以下链接来实现
- http://www.ibm.com/developerworks/library/mo-cordova-push-app/
- http://mbaas-gettingstarted.ng.bluemix.net/hybrid#initialize-push -
当我运行以下代码时,我在控制台中收到以下消息:
initPush 调用---------------- main.js:29 调用 bluemix 初始化值---------------------- IBMBluemixHybrid.js:2956 [INFO] [DEFAULT] 混合初始化 ["applicationid","applicationsecret","applicationroute"]
我没有看到 bluemix 注册列表中反映的设备详细信息。你能帮我解决这个问题吗?
var values = {
applicationId:"applicationId",
applicationRoute:"applicationRoute",
applicationSecret:"applicationSecret"
};
console.log("initPush called---------------------------------");
console.log("calling bluemix initialize with values--------------------------------");
IBMBluemix.initialize(values).then(function(status) {
console.log("IBM Bluemix Initialized", status);
return IBMPush.initializeService();
}, function (err) {
console.error("IBM Bluemix initialized failed" , err);
}).then(function(pushObj) {
function pushReceived(info) {
console.log("registerListener - " + info.alert);
alert('got a push message! ' + info.alert);
}
console.log("IBM Push Initialized", pushObj);
push = pushObj;
return push.registerDevice("LisaTest","Lisa123","pushReceived");
}, function (err) {
console.error("IBM Bluemix Push initialized failed" , err);
});