Push notification problem in Windows Phone 7 - windows-phone-7

I tried the following tutorials to create the push notification in Windows Phone 7.
http://www.sgtconker.com/2010/03/article-windows-phone-7-push-notifications/
http://www.silverlightshow.net/items/Implementing-Push-Notifications-in-Windows-Phone-7.aspx
I can create the channel uri in the WP7 emulator without any error.
However, when I post the push notification from the server to the channel uri. I could only receive the 404 error.
Could anyone give me some help ?
Thanks.
=====
Update 1 (28-Oct):
Thank you very much for the answers.
After I read the latest resources and sample codes, I just sent a push notification to the WP7 emulator successfully.
The channel setup part in WP7 does not change much in the latest SDK.
The problem that I encountered before was from the POST message part of the sender.
The following website is quite useful.
http://www.thisisfanzoo.com/Blog/JeffF/archive/2010/08/02/a-really-long-post-about-the-windows-phone-7-push.aspx
He shows how to correcty build the POST message and it is very critical.
Also the channel uri that created before will expire, when the WP7 emulator (handset) turns off over an hour. Hence, we need to keep track of the channel uri and update the server once it changes.
Have a nice day.
=====
Update 2 (28-Oct):
I just created the POST message using cURL in Linux server, and successfully delivered it to the WP7 emulator by push notification.
Text encoding like ASCII-UTF-8 conversion issue was fixed too.

There were some changes to notification handling through the ctp and beta as Matt advices.
I'd recommend checking out this documentation for an overview, detailed code samples and response codes.
Push Notifications for Windows Phone
How to: Set Up a Notification Channel for Windows Phone
How to: Send a Push Notification from a Web Service for Windows Phone
Also if you'd like to get some more overview I'd recommend checking out the Mix 10 and Tech Ed 2010 NA talks by Peter Torr. If you'd like points in the video to skip forward to I can get these.

The articles you refer to are very old and relate to the Beta and CTP versions of the tools. Unfortunately Push notifications is an area which saw much change before RTM/RTW.
Have a look at the up to date instructions on MSDN at http://msdn.microsoft.com/en-us/library/ff402537(v=VS.92).aspx. I suspect you'll have much better luck with instructions which match the current tools.

Related

how send offline notification in phonegap?

how send offline notification in phone gap.? please anyone know about offline notification.please help me. It works properly even if online but I wanted to get notification after app is closed.It gives notification Only for 3-5 hours after app is closed but I wanted to show them repeating 10 times per day for 10 days offline.
you can use Cordova Local-Notification Plugin to send offline push notification https://github.com/katzer/cordova-plugin-local-notifications

Sending and receiving own message

Hi everyone.
I have right now a simple multiplayer game but it is out of sync.
If I could receive my own message from the RealTimeMessageReceivedListener that would be awesome but I can't.
How I am sending my info:
for(Participant p : participants){
Games.RealTimeMultiplayer.sendUnreliableMessage(_gameHelper.getApiClient(),message.getBytes(),roomId,p.getParticipantId());
}
As you can see I'm sending my messages to everyone (even to myself). However at the RealTimeMessageReceivedListener I don't receive any information about my own message.
can you help me with this?
The API does not allow this according to:
the Real-time Multiplayer documentation. See section on Sending Messages. Also, the "sender participant" needs to be excluded if you intend to switch to sending broadcast messages with the API instead;
rationale provided in issue submitted to the Google Play Plugin for Unity project on GitHub.

Debugging Google cloud messaging push messages

I am trying to send push messages to an android application.
The POST https://android.googleapis.com/gcm/send
seems to succeed and I get something (with some numbers changed) like:
{"multicast_id":9999063399994069899,
"success":1,
"failure":0,
"canonical_ids":0,
"results":[{"message_id":"0:1416520599679103%8d7d198de508343a"}]}
but I don't seem to get the notification on the device...
Is there anything that can be done with the message_id it track it forward ?
Can I somehow tell me if Google actually tired to deliver it to the device and what was the result of the attempt?
I know it's an old question and you might have solved it yourself by now, but for completeness I would like to post a solution here.
By now you can find the option GCM Diagnostics in your Google Play Developer Console when you have your app selected. It's placed on the left hand side.
You just post a registration token or a message id and will shortly see a summary of push notifications connected to this token/id, plus additional debug information.
Cheers!
well, at least until someone would provide a better answer about debugging based on message ids.
It turns out the problem in my case was that the phone gap plugin in I was using was expecting a "message" field in the push notification message payload.
A bug on my server side made this message not to exist so it was not displayed in the phones notification area...
my thanks to #Eran for partially pushing my towards the right line of thought.

Azure Notification Hub Register iOS Device Always Returns Unauthorized

Early on in developing an iOS app with Xamarin, another developer and I got push notifications working for it using the Azure Messaging Component. It's a few months later now, and sometime between then and now, the push notifications stopped working. The code is still basically the same as before (which is nearly identical to the example code for the component), it was just moved to its own class for maintainability.
On Hub.UnregisterAllAsync(DeviceToken, error =>, error is:
The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
On Hub.RegisterNativeAsync(DeviceToken, tags, error =>, error is:
URLRequest failed for <NSMutableURLRequest: 0x167dbd80>
{ URL: https://[our namespace].servicebus.windows.net/[our hub name]/Registrations/?$filter=deviceToken+eq+'[long token]'&api-version=2013-04 }
with status code: unauthorized
We tried a new hub, and a new namespace with a new hub, but without luck. I've rolled back the changes we've made since it was working, but with no luck there either. The same error happens on multiple devices, on multiple networks. It never shows any errors in the portal for APNS, so I'm assuming this is something with authenticating to the Hub itself. What is really weird is that a Windows Store app that we wrote to test this registers and receives notifications using the same credentials without any issue. Can anyone point me in the right direction on this? The error messages above aren't very helpful.
It turns out that the test devices all had the automatic date and time synchronization turned off. The iPad I was primarily testing with was only off by about 20 or 30 seconds, so I didn't notice it was off. Another question involving the same thing with a Windows or Windows Phone registration clued me into it, but I can't find the link to it now. Apologies for that, thanks to whoever that was!
Looking at the API, it makes sense why it's so sensitive to this. It uses the date and time to generate the SAS Token, thus the unauthorized response when the time is just a few seconds off.

Animate application icon in windows phone

I have tried googling for this and came up empty. What I want is a tutorial or example code of how to change my icon on the windows phone like the people application or SMS. For example when you get a new SMS message it puts a number next to the face in the icon. Is there any way for me to do that in my app?
You need to send a Tile Push Notification.
This allows you to update the image, text and (optionally) a number.
Push notifications shoudl be triggered from a remote [web] service.
You can also have the tile update periodically using a ShellTileSchedule.
You can update your application's Tile using Push Notifications from a web service registered with a Microsoft Push Notification Service. However, this isn't absolutely necessary. You can even update your tiles without push notifications, by setting a ShellTileSchedule. The minimum update interval is 1 hour, however.
See here.

Resources