locked
Unable to add / update tags in Push notification hub via Mobile App backend RRS feed

  • Question

  • I had been used following code to successfully add tags to Push notification hub via Mobile App backend

    var installation = await hubClient.GetInstallationAsync(Id);
    installation.Tags = validTags;
    await hubClient.CreateOrUpdateInstallationAsync(installation);

    But recently, I change the notification hub and mobile app service to another one, and unable to use above code to add tags to Push notification hub anymore. After executed above code, those tags will be drop immediately.

    So I change the code to use "await hubClient.PatchInstallationAsync(Id, updates);" and it works this time. But I can't use "hubClient.CreateOrUpdateInstallationAsync(installation)" anymore!

    Please advise.

    Tuesday, April 18, 2017 7:43 AM

Answers

  • I found the answer now which related to code App.MobileService.GetPush().RegisterAsync(channel.Uri);

    See details in http://tips-tricksa.blogspot.com.au/2017/07/registered-tags-are-drooped-by-push.html
    Saturday, July 8, 2017 7:09 AM

All replies

  • Whats the error?
    Tuesday, April 18, 2017 7:03 PM
  • There is no error message received.  I found this issue is that I can't receive the push notification message target to the particular tags anymore. So I try to investigate the issue and found out that those tags unable to add to the Push notification hub by using code "hubClient.CreateOrUpdateInstallationAsync(installation);". I can execute it successfully as I get the return successful message in the client side - windows UWP App.

    I found out the issue by adding a line to get current tags (var currTags=installation.Tags ) and then add this to the return message and saw it always blank. 

    Sp I change to another way "hubClient.PatchInstallationAsync(Id, updates)" which I can get the current tags from the hub and receive push message again in mobile.

    However, I found those tags are lost again in next day!!!

    What's on in here?

    Wednesday, April 19, 2017 12:06 AM
  • See my reply as below.
    Friday, April 21, 2017 2:10 AM
  • Please see my below feedback.

    I found more issue that those tags will be dropped in next day!!!!

    Any suggestions?

    Thursday, May 11, 2017 4:49 AM
  • I have a looked the "Device Registration" within "Server Explorer" in Visual Studio and saw those tags are disappeared and received error message "The Notification was received and dropped by the Push Notification Service as device in disconnect state"when I sent the test message within "Server Explorer".
    Sunday, May 28, 2017 1:57 AM
  • I found the answer now which related to code App.MobileService.GetPush().RegisterAsync(channel.Uri);

    See details in http://tips-tricksa.blogspot.com.au/2017/07/registered-tags-are-drooped-by-push.html
    Saturday, July 8, 2017 7:09 AM