Я использую Azure Mobile Services для отправки push-уведомлений моему клиенту. приложение. Я отправляю как квадратное, так и тайловое уведомление, используя объект push.wns (сначала квадратное, а затем широкое). Ниже показано, как выглядит код на стороне сервера, который отправляет push-уведомления (в основном это вызывается всякий раз, когда запись обновляется в моей таблице БД):
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);
}
}
});
});
}
});
}
}
Я заметил, что широкое уведомление отображается правильно, когда моя плитка приложения широкая. Однако, когда я делаю размер плитки своего приложения квадратным, квадратное уведомление не отображается. Как я могу это исправить?