locked
Push Notification always gets a channel uri whether I use Identity from store or not

    Question

  • I am trying to use push notification in my Windows 8.1 app using C#. I reserved an application name on Windows store, and used the Identity from the store. I faced a strange thing, When I open any new windows app project, and uses this code:

    PushNotificationChannel PushNotificationChannel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

    It always returns a valid PushNotificationChannel object with a Uri string. It shouldn't return this because I didn't use Identity from the store and didn't reserve an app name for it.

    Also, every time I change the Publisher string value in appmanifest file, and undo the change, the returned channel Uri changed.

    Very confusing two things:

    First, the app that is NOT using Identity from store shouldn't return a push notification channel !!

    Second, the app that uses Identity from store and has a reserved app name should always return the same Uri for the same Identity whether I changed Published string and undo the change !!

    Can any one help in this please ??!!

    Wednesday, January 21, 2015 12:22 PM

Answers

  • I found the answer.

    To use push notifications in Windows Store apps WITHOUT publishing to Windows Store, you should associate it to a reserved app name on the store. That is from Project menu, select Store, then associate app, then sign in with a valid windows store developer account and select which app to associate with from the apps that will appear.

    This way it will have a reserved push notification URI.


    Ahmed Abd El-Karim

    Saturday, February 7, 2015 12:44 PM

All replies

  • Hi Ahmed,

    >>First, the app that is NOT using Identity from store shouldn't return a push notification channel

    Looks like there are some misconceptions here, ref to MSDN document: https://msdn.microsoft.com/en-us/library/windows/apps/hh913756.aspx

    Please focus on the first three steps in the complete data flow:

    1. Your app sends a request for a push notification channel to the Notification Client Platform.
    2. The Notification Client Platform asks WNS to create a notification channel. This channel is returned to the calling device in the form of a Uniform Resource Identifier (URI).
    3. The notification channel URI is returned by Windows to your app.

    So the request is made to the Notification Client Platform, which in turn requests the channel URI from WNS

    So far, it has no relevance to Store Identity, thus you can receive notification channel through the CreatePushNotificationChannelForApplicationAsync method.

    >>Second, the app that uses Identity from store and has a reserved app name should always return the same Uri for the same Identity whether I changed Published string and undo the change !!

    Quote from the above reference:

    We do not guarantee that the notification channel URI for an app will always remain the same. We advise that the app requests a new channel every time it runs and updates its service when the URI changes. The developer should never modify the channel URI and should consider it as a black-box string. At this time, channel URIs expire after 30 days.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 22, 2015 6:42 AM
    Moderator
  • Firstly, thanks for reply. I know every single word you say, but my problem is: YES any new Windows app I create receives push notification Uri and this is very strange as It shouldn't!!

    And also YES my app that uses store identity changes the Uri every time I update identity and undo the update, and also this shouldn't happen !!

    That's why I am very confused and cannot go and continue my work with push notifications :)


    Ahmed Abd El-Karim

    Thursday, January 22, 2015 6:56 AM
  • I found the answer.

    To use push notifications in Windows Store apps WITHOUT publishing to Windows Store, you should associate it to a reserved app name on the store. That is from Project menu, select Store, then associate app, then sign in with a valid windows store developer account and select which app to associate with from the apps that will appear.

    This way it will have a reserved push notification URI.


    Ahmed Abd El-Karim

    Saturday, February 7, 2015 12:44 PM