0
我試圖從web(Javascript)發送推送推送消息已成功添加到隊列中的quickblox帳戶和狀態發送,但我沒有收到它在設備上(iPhone )。當我從Web控制檯發送推送時,我能夠成功接收它。請告訴我代碼有什麼問題或需要進行任何設置。無法使用QuickBlox接收推送通知
發送推送的代碼如下:
var params = {
login: .....,
password: .....
}
QB.createSession(params, function(err, result) {
if(!err){
var pushCustomParams = {
message: 'Message sent successfully',
ios_badge: 1,
ios_sound: 'ringtone.wav',
user_id: app.caller.id
}
var params1 = {
notification_type: 'push',
user: {ids: [recp_id]}, // recipients.
environment: 'development', // environment, can be 'production' as well.
message: QB.pushnotifications.base64Encode(JSON.stringify(pushCustomParams)) // See how to form iOS or Android spesific push notifications
};
QB.pushnotifications.events.create(params1, function(err, response) {
if (err) {
console.log(err);
} else {
// success
}
});
}
});