【发布时间】:2016-04-02 06:58:47
【问题描述】:
我正在尝试从 web (Javascript) 发送推送,推送消息已成功添加到 quickblox 帐户的队列中,状态为已发送,但我没有在设备 (iPhone) 上收到它。当我从 Web 控制台发送推送时,我能够成功接收它。请告诉我代码有什么问题或需要任何设置。
发送push的代码如下:
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
}
});
}
});
【问题讨论】:
标签: javascript push-notification quickblox