Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Register push notification tags to Azure doesn't seem to work properly

$
0
0

Hello. In my xamarin.forms app I am registering for remote notifications in both android and ios. The problem is that I believe I am registering the tags in a wrong way, because if I log into Microsoft Azure to test send a notification to that tag then the tag is not identified by Azure.

The registeration for Android in my code:
public async Task RegisterAsync()
{

        const string templateBody = "{\"data\":{\"message\":\"$(message)\"}}";

        string token = TokenHelper.MyToken;


        JArray tags = new JArray();
        tags = new JArray { "myTag1" };
        tags.Add("myTag2");


        JObject templates = new JObject();
        templates["genericMessage"] = new JObject
                {
                     {"body", templateBody},
                     { "tags", tags}
                };

        await App.Client.GetPush().RegisterAsync(token, templates);

    }

In Azure when I try to send a notification to the user registering with the tag myTag1:

However when I remove the tag string in Azure then the message is received fine in app and Azure notifies in the result list that the message has been sent.


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>