クライアント アプリにプッシュ通知を送信するためにAzure Mobile Servicesを使用しています。push.wns オブジェクトを使用して、正方形とタイルの両方の通知を送信します (最初に正方形、次にワイド)。以下は、プッシュ通知を送信するサーバー側のコードがどのように見えるかです (これは基本的に、DB テーブルでレコードが更新されるたびに呼び出されます)。
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);
}
}
});
});
}
});
}
}
アプリ タイルが広い場合、ワイド通知が正しく表示されることに気付きました。しかし、アプリのタイルサイズを正方形にすると、正方形の通知が表示されません。どうすればこれを修正できますか?