使用Worklight 6.1在Windows Phone 8上推送推送通知 [英] Toast for Push Notification on Windows Phone 8 using Worklight 6.1

查看:182
本文介绍了使用Worklight 6.1在Windows Phone 8上推送推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Worklight 6.1并使用未经身份验证的程序向Windows Phone 8发送推送通知。

I'm using Worklight 6.1 and sending push notifications to Windows Phone 8 using unauthenticated procedure.

我正在使用以下过程创建通知。此过程更新磁贴和徽章但不生成Toast通知:

WL.Server.createDefaultNotification(notificationText,badgeDigit,{custom:data});

I am creating the notification by using the following procedure. This procedure updates the tile and badge but doesn't generates a toast notification:
WL.Server.createDefaultNotification(notificationText, badgeDigit, {custom:"data"});


  1. 在Windows Phone 8上为收到的推送通知添加toast的正确程序是什么?

  2. 此外,有什么方法可以通过点击启动应用程序来清除磁贴上的通知吗?


推荐答案


  1. WL.Server.createDefaultNotiication API方法仅返回Windows Phone 8的原始 tile 通知类型。添加 toast 通知,请参阅下面的示例。

  1. The WL.Server.createDefaultNotiication API method returns only the raw and tile notification types for Windows Phone 8. To add a toast notification, see the example below.

var notification = WL.Server.createDefaultNotification("You have " + numCoupons + " coupons.", numCoupons, {foo: "bar"});

notification.MPNS.toast = {};
notification.MPNS.toast.text1 = "Toast title";
notification.MPNS.toast.text2 = "Toast content";


  • 要清除应用程序图标中的数字或平铺应使用WL.Badge 方法。但是,在Worklight 6.1中此方法仅适用于iOS环境(另请参阅这个问题可能的替代方案。)

  • To clear the number from the application icon, or tile, the WL.Badge method should be used. However, in Worklight 6.1 this method is applicable only for the iOS environment (see also this question for a possible alternative).

    启动Worklight 6.2, WL.Badge也适用于Windows Phone 8

    Starting Worklight 6.2, WL.Badge is applicable for Windows Phone 8 as well.

    这篇关于使用Worklight 6.1在Windows Phone 8上推送推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆