0

I have developed WNS in Xamarin mobile app to receive raw push notification successfully (wihout using Azure Notification Hub) , however i am looking for a feature wherein mobile apps can subscribe to specific topic and from backend admin can send notifications on that topic to broadcast the alerts.

i tried to searched for tag based notification in UWP but i always come across Azure Notification Hub sample

here is the link to Azure Notification Hub Tag based

Is there anyother way wherein admin can broadcast the notifications without the use of Azure Notification Hub ?

Hunt
  • 8,215
  • 28
  • 116
  • 256
  • Partner Center provide a way for you to broadcast the alerts based on you defined customers. See [here](https://learn.microsoft.com/en-us/windows/uwp/publish/send-push-notifications-to-your-apps-customers). Is this the feature that you request? – Barry Wang May 07 '19 at 06:44
  • No, i am looking for the custom broadcast notification that is fired from backend system for master sync so that subscribed devices can receive the notifications – Hunt May 07 '19 at 06:48

1 Answers1

0

You will have to go through the following doc: Windows Push Notification Services (WNS) overview. Define your own service, which will then send post to WNS for push notifications. As a example, see this quick start

And as for your specific scenario, if you only need "subscribed devices can receive the notifications", you can define the logic in your own backend app. Then only send post request to WNS for subscribed devices.

Barry Wang
  • 1,459
  • 1
  • 8
  • 12
  • I have tried this approach and it requires backend to loop all the channel uri of all the users in order to send one notification. so it involves a grater complexity of traversing 'N' number of users to send notification. i don't see any method in the document link that you have provided which describes how to subscribe to the topic – Hunt May 08 '19 at 12:40
  • @Hunt so your background already used [PushNotificationChannelManagerForUser](https://learn.microsoft.com/en-us/uwp/api/windows.networking.pushnotifications.pushnotificationchannelmanagerforuser)? You cannot distinct the user and get specific uri for user? – Barry Wang May 09 '19 at 04:01
  • Also I'm not so sure why it is required to loop all the channel uri for a single notification. The WNS server need a post request to a specific channel. As mentioned [here](https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh868245(v%3dwin.10)) – Barry Wang May 09 '19 at 05:19
  • If i have 100 different device using apps than all would be having different Channel urls and to send notification to all of them i have to iterate through each channel url and push the data. However, for instance if only 50 device wants to have specific type of push then they could just subscribe to specific topic and we can eliminate rest of the 50 device that does not want to receive the push. – Hunt May 09 '19 at 05:30
  • @Hunt Yep I understand that you want to group your users and channels. I'm not so sure whether you've understand my idea. Actually from your client app you need to send your uri and user as parameters to your backend, right? And actually when your backend receives the user and uri mapping list, you can create a new list which add a tag to each of your items. Then you will just need to query the list to get the items which contains the same tag, then loop them and send post request to each uri with the same tag. – Barry Wang May 10 '19 at 02:35
  • The above is my suggestion. What confused me is that you mentioned you have to loop all channel uris in order to send a notification. That's also why I want to know how you tried the backend in your own server code. – Barry Wang May 10 '19 at 02:36