How to push notification to specific users in Xama

2019-09-14 20:48发布

问题:

I have Implemented push notification in xamarin.forms android using this but it sends the notification to all the device.I want to send notification to the specific users only.How can I achieve it ?

回答1:

We use tags for this. Each user has a user Id and so when the device registers with azure, you add their user Id as a tag to the registration.

protected override void OnRegistered(Context context, string registrationId) {

    ...

    var tags = new List<string>() { "userId4" }; // Your UserId here

    ...

}