Hi I would like to know if it is possible getting the push notification the server sent while the device os turned off.
How do I configure the app and the Azure Notification Hubs to know the device did not received the notification at the moment it was sent and show them when it gets on (or online) again?
Is it possible to do?
Thank you
Azure Notification hub just tells you a notification has been delivered. There´s no way to get a "received" confirmation if that is what you are looking for. This has actually nothing to do with Azure, it´s just how Apple Push Notification Service (connected with Azure) works.
Apple Push Notification Service (APN) will retain/cache the last (and only the last) notification sent while the device is off. Once the device is online, APN will try to send the notification again. But there is a time limit after which cached notifications will be lost, and that means your notification may never arrive its destiny.
If you really need to get arrival confirmations (ie: like whatsapp confirmations) you should implement it yourself. That would be another question but here are some hints:
You include an uid in the notification payload
You save that uid in your server database, in a table that tracks the "pending notifications".
Device opens the notification and sends an arrival confirmation to the server, passing the uid as parameter => you delete the "pending notification" record on your database table.
How would you resend the pending/lost notifications?
Option 1: Implement some kind of a background job that checks (in time periods. ie: once every 5 minutes) what notifications didn´t arrive and resend them until they are correctly confirmed.
Option 2: when your mobile app starts, send a message to the server telling "hey, I´m online again". Then process and send all the pending notifications specific to that user/device, deleting them from the pending notifications table.
Related
I have been using graph API provided by Microsoft to subscribe to change notification for teams message.
It's all working fine for normal chat messages but when i try to send any message containing URL's it sends two/three notifications and sometime it works fine (sends only one).
I have gone through the docs and followd the protocals like sending 202 response conde to acknowledge the notification has been received as soon as i receive the notification and run other functionalities in another thread.
I couldn't find more info on for this inconsistent behaviour.
So far I tried to minimize the process after receiving notification on webhook receiver route by performing other actions like extracting channel,message id and retriving message in different thread and sent HTTPResponse of 202 as soon as i receive the notification.
I am creating a customer support bot using Ms botframework v4 with nodeJS and directline API 3.0. A customer would talk to the bot and on request, the conversation would be handed over to an agent. If the customer requested to talk to a bot, the customer will wait until the agent becomes available. I want to check if the customer is still active before the agent sends a message to him/her.
wireframe of the bot and the webiste As you can see in the image Jack is in the queue I want to find out a way to check if Jack is still waiting, or he close the window and no longer waiting.
Check out this SO solution I provided. The request is similar to yours in that the OP wants to know how the bot can be notified if a user exits.
The short answer is to use an event listener. Before the window (that houses the web chat instance) is closed, an event is fired. This event is picked up by web chat which sends an activity (message, event, or other) to notify that bot.
From this point, you simply need to forward the notification to the agent that the user has exited the conversation.
Hope of help!
I have setup a Webhook to my development environment. In addition to receiving the event notifications which I would expect, I receive additional notifications (with unique event ID) which do not make sense to me. When I try to look up those events on the Stripe dashboard I cannot find trace of them... Shouldn't all events be logged on the Dashboard?
Has anyone experienced this? I've popped a mail to the support but no answer yet.
EDIT:
I could find one of the "missing" events on the dashboard now. It was buried far down the event list, as it was apparently fired several hours ago for the first time, but couldn't be handled at that time by my application.
All events appear on the dashboard, listed at the time they are fired for the first time. So in case the application receiving the notification can't return a response 2xx for some reason, Stripe will try sending the notification again at a later time. Once the application server handles the event notification properly, the event will in all likelihood be logged by the application, and the timing might look confusing.
Thoughts on how you guys would/do handle this... If you need to send a webhook when something happens. Say, when a customer registers.. How would you guarantee that a webhook has been sent for it? You couldn't just have the code send the webhook after the registration happens, as what if the server crashes right after registration but before/during the webhook request.. If you were using MongoDB, I guess you could listen to the oplog and see what a registration record is inserted, but then what if your oplog monitoring script crashes.. I thought about storing locally a file that records the last successfully processed timestamp but then you're really limiting yourself to processing the oplog one at a time, which on an active DB could really get behind.
I thought about using a queuing/task system but then what if the request to store the task in the queue crashes..
Maybe store a field on the registration DB record that says if the webhook has been sent yet, send it once the registration happens and have a script that checks every once in awhile for webhooks that failed to send within a certain amount of time?
Just trying to think of the best way to make sure a webhook is actually sent for a particular event.
I am developing windows phone application, For that I need to send push notification for a specific device or specific phone.
I have succeed to send push notification for all device by one click, But I am unable to achieve to send a push notification for a specific phone. I have tried a lot i net but I can not find it out.
Hey you need get token or device id of your phone and save into server and one more thing, when you will register on Microsoft console, It provide us server key that key you need for server side. then you can get notification by MPNS.. thanks
Try this way,hope this will help you to solve your problem