0

I am using android local notification in my app, all work fine, but my question is:

Is there any way to send notification to specific users or group, Or to show/hide the notification to/from specific users?

NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
  .SetAutoCancel(true)                    // Dismiss the notification from the notification area when the user clicks on it
  .SetContentIntent(resultPendingIntent)  // Start up this activity when the user clicks the intent.
  .SetContentTitle("Button Clicked")      // Set the title
  .SetNumber(count)                       // Display the count in the Content Info
  .SetSound(RingtoneManager.GetDefaultUri(RingtoneType.Alarm))
  .SetDefaults(0)
  .SetSmallIcon(Resource.Drawable.notify)
  .SetVibrate(new long[] { 1000, 1000 })
  .SetContentText(String.Format("The button has been clicked {0} times.", count)); // the message to display.

// Finally, publish the notification:
NotificationManager notificationManager = (NotificationManager)GetSystemService(Context.NotificationService);
            notificationManager.Notify(ButtonClickNotificationId, builder.Build());
SushiHangover
  • 73,120
  • 10
  • 106
  • 165
citysoft
  • 11
  • 2

1 Answers1

0

Is there any way to send notification to specific users or group, Or to show/hide the notification to/from specific users?

You will need to use UserManager to query Users, but to use that , your app need MANAGE_USERS permission, which has a protectionlevel of signature|system,which means that the application has to be signed with the platform key. You can refer to this case.

Elvis Xia - MSFT
  • 10,801
  • 1
  • 13
  • 24