Forum Xamarin.Forms

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

dai15002dai15002 Member ✭✭✭

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" };

        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.

Sign In or Register to comment.