Azure移动服务推送磁贴通知和清除磁贴属性

Azure Mobile Services Push Tile Notification and Clear Tile Properties

本文关键字:清除 属性 通知 移动 Azure 服务      更新时间:2023-09-26

我正在使用Azure Mobile Services Scheduler服务定期访问另一个api,并发送带有更新信息的实时磁贴推送通知。然而,有时一段数据无法从外部api获得,我需要清除其中一个tile属性。问题是,当我发出新通知时,似乎无法从磁贴中清除值。我尝试过发送null、空字符串和undefined。但我所做的一切都无法清除它。这是我的调度程序代码:

push.mpns.sendFlipTile(channel.uri, 
{
    title: 'My Title',
    backgroundImage: getTileUrl('front', 'medium', word),
    backBackgroundImage: getTileUrl('back', 'medium', word),
    wideBackgroundImage: getTileUrl('front', 'wide', word),
    wideBackBackgroundImage: getTileUrl('back', 'wide', word),
    backTitle: null,        // Doesn't clear value
    //backTitle: '',        // Doesn't clear value
    //backTitle: undefined, // Doesn't clear value
    count: '0'              // Sending 0 as a string will clear the counter
}, 
{
    success: function(pushResponse) {
        console.log("Sent push:", pushResponse);
    },
    error: function(errorResponse) {
        console.error("Error push:", errorResponse);
    }
});

有人能帮我吗?

谢谢你提起这件事。目前,我们不支持清除值的功能。此bug正在跟踪该功能的添加。请在我们的UserVoice页面上输入条目,帮助我们优先解决此问题!

根据本文档:http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206971(v=vs.105).aspx

您需要将该backTitle的Action属性设置为Clear。不知道如何在Windows Azure移动服务MPNS上做到这一点。