0
A
回答
2
1
我向您发送吐司推送通知的工作代码。
String toastMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1> Welcome To Windows Push </wp:Text1>" +
"</wp:Toast> " +
"</wp:Notification>";
byte[] notificationMessage = toastMessage.getBytes();
url = new URL(subscriptionURI); //You must have the subscription URI provided by MPNS to client side.
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("ContentLength", String.valueOf(notificationMessage.length));
connection.setRequestProperty("ContentType", "text/xml");
connection.addRequestProperty("X-WindowsPhone-Target", "toast");
connection.addRequestProperty("X-NotificationClass", "2");
connection.connect();
DataOutputStream out =
new DataOutputStream(
connection.getOutputStream());
out.write(notificationMessage, 0, notificationMessage.length);
out.close();
+0
我们可以从应用程序发送推送通知给自己吗? – 2013-04-26 06:57:13
0
是的,你可以发送,但你为什么要发送推送通知?使用活动磁贴通知。 从Windows手机工具包使用hubtile并将Hub添加到Visual树中,并执行 hubtile1.Notification ="Something you want to send as push notification";
相关问题
- 1. 发送从Windows Phone设备到webservice的推送通知
- 2. 设备上的Windows Phone推送通知
- 3. Windows Phone 7.x本地推送通知
- 4. windows phone 8.1推送通知
- 5. 尝试将推送通知发送到iOS设备 - 未收到推送通知
- 6. 直接从设备发送苹果推送通知到设备
- 7. pushChannel在windows phone 8.1设备中始终为空(推送通知)
- 8. Windows Phone推送通知多个设备在一个请求中
- 9. 无法通过APNS将MDM推送通知发送到设备。
- 10. 推送通知:如何使用Pubnub向特定设备发送推送通知?
- 11. 如何通过Firebase将设备发送到设备推送通知
- 12. 如何将iPhone推送通知发送到多个设备。
- 13. MobieFirst V7.1应用中心不发送推送通知到设备
- 14. 如何将推送通知发送到多个设备?
- 15. PHP代码发送Android的推送通知到多个设备
- 16. iOS发送推送通知到一次更多的设备PHP
- 17. 发送推送通知到多个设备点击
- 18. 天青发送推送通知到多个设备/广播
- 19. 推送通知不会发送到某些设备
- 20. 发送SNS推送通知消息到多个设备
- 21. 推送通知中的Windows Phone 8
- 22. Windows Phone 8.1中的推送通知
- 23. 推送通知没有达到设备
- 24. 推送通知问题7
- 25. 推送通知到Windows Mobile
- 26. 无法构建HTTP消息推送通知在Windows Phone 7
- 27. 与推送通知不同的正常启动Windows Phone 7
- 28. 如何开始使用Windows Phone 7推送通知
- 29. Windows Phone 7推送通知不显示在我的电话上
- 30. 发送通用推送通知 - Xcode
谢谢我检查链接现在;)我会使用Raw。 – me101 2011-05-22 16:49:29