tjanczuk / wns

Send push notifications to Windows 8 devices using WNS
Apache License 2.0
52 stars 30 forks source link

toast notifications coming through as raw. #14

Open elliotstokes opened 9 years ago

elliotstokes commented 9 years ago

Great plugin. We are currently working on getting wns notifications working for our app and are having a few problems.

When the notification is sent we receive the notification when the app is open and the toasts are coming through as raw. If the app is closed then we see no notification at all.

To send Im using var options = { client_id: settings.push.windows.clientId, client_secret: settings.push.windows.clientSecret
}; wns.sendToastText02(channel, { text1 : title, text2 : message }, options, callback); };

on the client it calls the httpnotificationreceived event not the toastnotificationreceived event.

joviol commented 9 years ago

Getting exactly the same problem

matteocontrini commented 9 years ago

Have you tried using the send() for low level notifications? That's working fine for me.

https://github.com/tjanczuk/wns#low-level-notifications

joviol commented 9 years ago

Yes, This is the way I am sending the notifications right now. I think however that the problem might be with the channel obtained by the client app. In out case the client app was written with phonegap (cordova) and using the push plugin which might be obtaining mpns channels. In fact if I use the same channel with the mpns module, it works correctly. I do not have a lot of experience with push notification as this is the first app I am writing that supports them, but this would be my guess.

matteocontrini commented 9 years ago

What's the format of the channel URI? The WNS one should contain notify.windows.com. The MPNS one is s.notify.live.net. If you use a MPNS URI with WNS, it will work but the result might be unexpected.

joviol commented 9 years ago

In fact the format is: http://s.notify.live.net

And thats why I ended up using mpns after a brief research. Also, I was wondering if the wns channel shouldn't be https and not http?

matteocontrini commented 9 years ago

In fact it is.

elliotstokes commented 9 years ago

I am also using the cordova push plugin. I thought that mpns was going to be retired to assumed I needed wns. Waht mpns module are you using https://github.com/jeffwilcox/mpns? or another.

joviol commented 9 years ago

Yes that is the one I am using and it is pretty straightforward to use. The limitation of working with mpns is that without a TLS certificate, there is a limit of 500 push in a day. Hope that helps.