Signaling incoming messages

1

The customer has 7 stores and an array. Someone in the matrix with decision power, will keep your mobile in hand with an application. When an employee at one of the stores needs to approve a discount greater than what she can give, she then sends a request through REST and on the other side the manager receives the request and based on the information the service lead to it, will approve or not. How would I make this message reach the person who has the application? Actually, message that I say is to notify the client that uses the App that has negotiation, it should then open the App, and at that point consume the REST and authorize or not. It's not a chat.

    
asked by anonymous 21.08.2017 / 18:30

1 answer

1

You can use Azure Notification Hub for this. This will allow you to generate notification for any platform.

In my github you can see a example of sending notifications .

In your app, you sign the channel to receive the notifications:

var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

var hub = new NotificationHub("NOME_DO_SEU_APP", "Endpoint=sb://NOME_DO_SEU_APP.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=CHAVE_COMPARTILHADA_DO_SEU_APP");
        await hub.RegisterNativeAsync(channel.Uri);

And in your REST service, you trigger notifications:

var hub = NotificationHubClient
            .CreateClientFromConnectionString("Endpoint=sb://NOME_DO_SEU_APP.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=CHAVE_DO_SEU_APP",
            "NOME_DO_SEU_APP");

var toast = @"<toast><visual><binding template=""ToastText01""><text id=""1"">Bem vindos ao VSSummit 2015</text></binding></visual></toast>";
var toastWithImage = @"<toast><visual><binding template=""ToastImageAndText01""><image id=""1"" src=""https://cdn1.iconfinder.com/data/icons/metro-ui-icon-set/512/Visual_Studio_2012.png"" /><text id=""1"">Bem vindos ao VSSummit15!</text></binding></visual></toast>";
hub.SendWindowsNativeNotificationAsync(toast).Wait();
    
22.08.2017 / 09:27