I am implementing VOIP application. I use this sample VOIP sample.
when a call changes status, I want to send an event from app service to main project in order to update UI, but I can not find any way to do it, I just can send a message from the main project to app service and receive a response.
So anyone can show me the way to send message from app service to main project ?
Related
We are currently using getStream in our react web application for notification feed. It is working fine.
We are now planning to use it in our react native mobile app as well. We would like to show a notification (in the top tray or drawer) whenever there is a notification received by a user, similar to how we get in whatsapp or telegram
Does anyone know how this can be achieved. Couldn't find anything about this in their docs. I can see that they provide this functionality with Stream Chat
PS: We are able to get the notifications in the app but we would like to show the notification in the top tray as well so that the user knows he/she has received notifications without opening the app.
Regards,
Varun
I believe your question is about offering Push Notifications for your application. Stream Feeds does not currently implement Push Notifications out of the box so you will have to implement them in your application yourself. One common approach is to use notification webhooks where you have the webhook trigger a push notification for the user from your application's back end infrastructure.
I hope that is helpful.
Best,
Grant
I am facing issue with azure chat-bot framework SDK4 integration with live agent(human) chat through REST API using Node.js.
I have an REST API, which needs to execute in the certain interval
for getting information about human agent chat and status, and i need
to send to user as an chat message.
One more REST API, which will send chat message again again to live agent from user.
I am trying to implement this in azure chat-bot SDK V4 waterfall method getting messages status shows 'can't send, retry', even though it received from live agent side.
Code already in stack overflow:
azure chatbot SDK4 - live(human) agent chat REST API integration not working issue
Here you go --> echo bot this sample will explain listen for the incoming requests to bot.
I am working on a website, where I want to make a feature of notifications, when a user visits my website, they are asked for notifications permission and when they allow it, they will get notifications from my website, and whatever product I want them to get notified by.
Like for example when I visit some websites, they ask me for notifications permissions and when I allow the, I get notified through notifications then. That's all I want for now.
How can I achieve this functionality, I have follow this tutorial, but still confused how the users who allowed the notifications get detected and how all of them are notified then ?
Web Push library for node.js is just a sender.
You should obtain a subscription JSON object from the browser using Notification API and Service Worker API and then send it to your server, where put it in the database of your choise.
When you will need broadcast notifications, you can retrieve subscription and use a web-push library (for php is also available :)
Note that is a right flow looks following as:
1) Retrieve subscription from the browser
2) Send and store it on your web-server
3) Create notification prototype (just object)
4) Broadcast notification prototype ID you have created to the users
5) Service Worker receive one and fetch notification prototype from your server by ID
6) Show notification using browser API in service worker
For more see here links
https://developers.google.com/web/fundamentals/codelabs/push-notifications/
https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications/
First, I should clarify that I'm only using free modules and service plans on the Azure side, using a Bizspark subscription.
I'm currently trying to run the app in the following tutorial:
https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-push
Everything works on the client side, items are correctly sent and stored in the database. However, I can't make the NodeJS server send push notifications to devices.
I basically copy and pasted the code on the tutorial for the nodeJS back-end on the tutorial, redeployed/restarted the server, but not a single push notification is sent.
I tried to see where in the code something was wrong, so I went and used some logger.info here and there. I then found out that context.push is undefined.
However, I did connect the mobile app to the notification hub in the "push" category in the menu of my mobile-app in Azure (it does appear connected).
Push page on my mobile app
Google cloud messaging is also correctly configured, I get the push notification for the successful registration when I start the app.
What am I missing? Is it because I'm using free plans (notification hub, database, service plan)?
First of all, you could test sending notifications via the Azure portal, to do this, please see steps below.
Go to the Azure portal and navigate to your notification hub.
Click on Test Send under the SUPPORT + TROUBLESHOOTING menu.
Select the platform you used, then fill payload message and click Send button.
Almost immediately (but in reality, it could be a few minutes because of PNS delays), you will see the push notification alert on your application.
For node.js backend on Azure mobile apps, you could use the following lines of code to send a push notification to all registered clients.
var payload = {
data: {
message: 'Hello!'
}
};
notificationHubService.gcm.send(null, payload, function(error){
if(!error){
//notification sent
}
});
For more info, please check out this tutorial.
I did try the test send a few times and it worked perfectly, hence why I couldn't understand how it couldn't work. I couldn't use the exact same code #aaron-chen-msft posted as I use the basic back-end nodeJS server on Azure (the quickstart one, so I would need to install the "azure" npm package), but I added the following string to my mobile app settings (application settings tab) on azure:
key : MS_NotificationHubName value : MyNotificationHubName (here, Poke-Forgh)
Context.push was then not undefined, but the notifications weren't sent, so I got inspired by #aaron-chen-msft's code and I edited the nodeJS code to specifically send notifications to GCM:
context.push.gcm.send(null, payload, function (error) { ... }
And it finally worked. Thanks!
I'm trying to piece together the general workflow of giving a user push notifications via the service worker.
I have followed this Google Developers service worker push notifications tutorial and am currently thinking about how I can implement this sort of thing in a small user based web app for experimentation.
In my mind, the general workflow of an web app supporting push notifications is as follows:
Client visits app
Service worker yields a push notification endpoint
Client sends the endpoint to the server
Server associates the endpoint with the current user that the endpoint was generated for
Every time something that your app would say is notification worthy happens, the server grabs the push notification endpoint(s) associated with the user, and hits it to send a push notification to any user devices (possibly with a data payload in Chrome 50+, etc)
Basically I just want to confirm that my general implementation thoughts with this technology are accurate, else get feedback if I am missing something.
You are pretty much bang on, there are some specifics that aren't quite right (but this is largely phrasing and may be done to personally taste).
Client visits app
Register a Service Worker that you want to use for push messaging
Use the service worker registration to subscribe the user to push messaging, at which point the user agent will configure an endpoint + additional values for encrypting payloads (If the the user agent supports it).
Client sends the endpoint to the server
Server store the the endpoint and data for later use (The server can associate the endpoint with the current user if the server if the web app has user accounts).
When ever the server wishes to send a notification to a user(s), it grabs the appropriate endpoints and calls them that will wake up the service worker which can then display a notification.
Payload support in coming in Chrome 50+ and at the time of writing payload is support in Firefox, but there are 3 different versions of encryption used for the payloads in 3 different versions of Firefox, so I'd wait for the payload support story to be ironed out a little before using it / relying on it.