我正在使用Azure 移动服务向我的客户端应用程序发送推送通知。我使用 push.wns 对象(第一个正方形,然后是宽)发送正方形和平铺通知。下面是发送推送通知的服务器端代码的样子(基本上每当我的数据库表中的记录更新时都会调用它):
function update(item, user, request) {
request.execute({
success: function() {
request.respond();
sendNotifications();
}
});
function sendNotifications() {
var channelTable = tables.getTable('channel');
channelTable.read({
success: function(channels) {
channels.forEach(function(channel) {
push.wns.sendTileSquarePeekImageAndText02(channel.pushuri,
{image1src: '<imgPath>',
text1: 'New Game',
text2: item.playername },
{
success: function(pushResponse) { console.log("Sent Square:", pushResponse); },
error: function(error) {
console.log("error sending push notification to ", channel.pushuri);
if (error.statusCode == 410) {
console.log("Deleting ", channel);
channelTable.del(channel.id);
}
}
});
push.wns.sendTileWidePeekImage01(channel.pushuri,
{image1src: <imgPath>,
text1: 'New Game',
text2: item.playername },
{
success: function(pushResponse) { console.log("Sent Square:", pushResponse); },
error: function(error) {
console.log("error sending push notification to ", channel.pushuri);
if (error.statusCode == 410) {
console.log("Deleting ", channel);
channelTable.del(channel.id);
}
}
});
});
}
});
}
}
我注意到当我的应用程序磁贴很宽时,宽通知会正确显示。但是,当我将应用程序的磁贴大小设置为方形时,不会显示方形通知。我该如何纠正?