[英]How do I build ASP.NET web site to send push notification to windows store app
[英]How to send push notification from azure to windows mobile cordova app
嗨,我正在使用azure進程將推送通知發送到Windows 10以上版本的混合應用程序,我使用下面的代碼發送通知
https://docs.microsoft.com/zh-CN/azure/app-service-mobile/app-service- mobile-cordova-get-started-push
我在那里得到了這個文檔pushRegistration.on('registration',function(data){此方法未觸發,在發送通知之前是否有任何要注冊的過程
您必須實現一個registerForPushNotifications方法,並在用戶每次打開該應用程序時對其進行調用:
var pushRegistration = null;
function registerForPushNotifications() {
pushRegistration = PushNotification.init({
android: { senderID: 'Your_Project_ID' },
ios: { alert: 'true', badge: 'true', sound: 'true' },
wns: {}
});
如果未調用pushRegistration.on,則可能是注冊未完成或存在一些錯誤。 在以下位置創建斷點或打印一些消息:
pushRegistration.on('error', handleError);
看看有什么問題。
另外,您可以按照通知中心診斷指南檢查是否缺少某些配置: https : //docs.microsoft.com/zh-cn/azure/notification-hubs/notification-hubs-push-notification-fixer
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.