Azure / azure-notificationhubs-android

Android SDK and Samples for Azure Notification Hubs
Apache License 2.0
33 stars 63 forks source link

InstallationTemplate tags are not added in the Notification Hub templates #226

Open hanatharesh2712 opened 3 years ago

hanatharesh2712 commented 3 years ago

Bug - When I add the installation template using the below code with the tags. the tags are not actually added in the Azure notification hub templates.

code to create a template with tags:

InstallationTemplate testTemplate = new InstallationTemplate();
testTemplate.setBody("{\"data\":{\"message\":\"Notification Hub test notification: $myTextProp\"}}");
testTemplate.addTag("User_"+ userId);
testTemplate.addTag("testTemplate");
NotificationHub.setTemplate("testTemplate", testTemplate);

When I check the templates using my API to fetch the registered templates in ANH. It shows below properties:


 {
        "ETag": "19",
        "ExpirationTime": "9999-12-31T23:59:59.9999999Z",
        "RegistrationId": "1069460114778965412-4990591539251958152-8",
        "GcmRegistrationId": "f25lTX9bJYg:APA91bHSsOeqmRcEwItm9Iq8npqxVBCNCKvNG0ypOIxh5eWtOocA8gglNsZX6aSxQ9F5MU-NyuD1Gr6quL5WV4FpPYhx8coVaXOLeZ79tfi15nl5vCuNC9y5YN78MfCt9gapp-rtvhks",
        "BodyTemplate": {
            "Value": "{\"data\":{\"message\":\"Notification Hub test notification: $myTextProp\"}}"
        },
        "TemplateName": "testTemplate"
    },

It should add the tags in the template as well: like as

"Tags": "testTemplate,User_fd6c21f4-dcf6-4b1b-9f08-7b787b6caaac",

Info: Android 10 targetSdkVersion 30 SDK - 'com.microsoft.azure:notification-hubs-android-sdk-fcm:1.1.6'

aziztitu commented 8 months ago

@hanatharesh2712 Can you try to use the GetInstallation API to check if you can see the tags in the response?

Get Installation API: https://learn.microsoft.com/en-us/rest/api/notificationhubs/read-installation

If you are still experiencing the issue, please provide your namespace and hub name, and we can try to debug the issue on our end.