I'm working on push notifications through WNS and WINJS (windows Phone 8.1). I followed this article https://msdn.microsoft.com/en-us/library/windows/apps/hh465460.aspx. Right now i can't receive push notifications on my devices, but the WNS servers answer me with status 200 and message received
HTTP/1.1 200 OK
Content-Length: 0
X-WNS-DEVICECONNECTIONSTATUS: connected
X-WNS-NOTIFICATIONSTATUS: received
X-WNS-STATUS: received
X-WNS-MSG-ID: 77B3599101A23AB8
X-WNS-DEBUG-TRACE: DB3WNS2010831
Strict-Transport-Security: max-age=31536000; includeSubDomains
Date: Wed, 18 Mar 2015 13:58:29 GMT
My request's header (looped in php) is:
[0] => Content-Type: text/xml
[1] => Content-Length: 142
[2] => X-WNS-TTL: 3600000
[3] => X-WNS-Type: wns/toast
[4] => X-WNS-RequestForStatus: true
[5] => Authorization: Bearer EgAeAQMAAAAEgAAAC4AA90q2GTPfvxMbeV....
My xml test payload is:
<toast>
<visual lang="it-IT">
<binding template="ToastText02">
<text id="1">Hello</text>
</binding>
</visual>
</toast>
So apparently for the server, my request is fine, but nothing is sent to the device (neither with closed app or running app with associated pushnotificationreceived event). I also checked this list https://msdn.microsoft.com/en-us/library/windows/apps/dn457490.aspx#push_200_OK , but with no success, it seems (to me) that everything is set fine. I'm literally getting mad at this , I don't know where the error really is. Anyone had the same problem? thanks a lot
#<Net::HTTPMethodNotAllowed 405 Method Not Allowed readbody=true>
error. @user3149172.. tried your solution but its not helping either. This is my code snippet for the request -request = Net::HTTP::Post.new(uri.path, {"Authorization" => "#{windows_access_token}", "Content-Type" => "text/xml", 'Content-Length' => '0', 'X-WNS-Type' => 'wns/toast' })
– Neha