• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 581
  • Last Modified:

Push Notifications in Windows Phone 7

Hi,

I'm developping a webservice in WCF.
Windows Phone devices will get data from the webservice but i would like to know if push notification will work or i need to subscribe to a windows cloud service (azure)

So my question is : is it possible to send push notification without microsoft cloud services? and if yes, how the device can subscribe?

i read article to send notification to the device :

http://msdn.microsoft.com/en-us/library/ff402545%28v=vs.92%29.aspx

and

http://msdn.microsoft.com/en-us/library/ff941124%28v=vs.92%29.aspx

but to send the notification, they have written this line :

// The URI that the Push Notification Service returns to the Push Client when creating a notification channel.
string subscriptionUri = "<Notification Channel URI>";

how can i get the "notification channel uri"?


Thank you for helping,

Kind Regards.
0
Dnx_7
Asked:
Dnx_7
  • 3
3 Solutions
 
regevhaCommented:
The URI is the Azure channel service URI.
The following code gets a URI of an Azure service based on the service channel name:

private void GetPushNotificationURI()
{
    string channelName = "AzureStockTestChannel";
    HttpNotificationChannel channel; 
    channel = HttpNotificationChannel.Find(channelName);
    if (channel != null)
        pushNotificationUri = channel.ChannelUri.ToString();
    else
    {
        channel = new HttpNotificationChannel(channelName);
        channel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(channel_ChannelUriUpdated);
        channel.Open();
        channel.BindToShellToast();
    }
}
 
void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
{
    pushNotificationUri = e.ChannelUri.ToString();
}

Open in new window


(answer based on Dan Waters's blog on MSDN - http://blogs.msdn.com/b/dawate/archive/2011/01/18/phone-cloud-series-bringing-it-all-together-with-windows-phone-7.aspx)
0
 
Dnx_7Author Commented:
Thank you but do i need to subscribe to an Azure Service?

both answer use Azure service but i don't have any azure service...

i just want to write my own webservice in wcf and send notification to the mobile device via WCF or whatever else with no cost of cloud service...
0
 
Mikal613Commented:
Are you using Mango (7.1)?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now