push notification to single user RRS feed

  • Question

  • User-1106823036 posted

    I'm using the azure service bus to send notification to android device.

    I set the key of the android project obtained from the GCM and i did some coding on my MVC controller and notification are sent. Everything so far is good

    what I really want is to send the notification for a single user, that is not broadcasting to all users of this application.

    I have the key of each user (device key) but I don't know where to use this key to identify that this notification is for this user.

    can please someone help me?

    I have tried googling the issue it always redirects me to pushing notifications to authenticated users that is all users that have the application and that are signed in, well that's not what I want

    Thank you in advance

    This is my code on visual studio for broadcasting the notifications

     NotificationHubClient hub2 = NotificationHubClient.CreateClientFromConnectionString("Endpoint=sb://androidenotificationhub-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=mykey", "restaurant");
                     var timer =db.orderSessions.Where(m=>m.id==sessionId).Select(m=>m.MTTD).First();
                     hub2.SendGcmNativeNotificationAsync("{ \"data\" : {\"msg\":\"" + hello + "\",\"badge\":\"" + timer + "\"}}");

    Thursday, May 14, 2015 8:28 AM