Notify of Video Call - react-native

I am building a Video Chat application in React-Native, I have successfully implemented the Video Chat feature. Now I need a mechanisim to send notification to the user to join the Video Call.
I have read stackoverflow and also googled a lot, all the answers suggest to use Callkeep.
But Callkeep requires me to use Phone call account permission to use the module. I need the notification to be handled like in Instagram, with simple notification that User A is calling you with declined and answer button only.

You can use Firebase Cloud Messaging or a similar service to send and receive notifications for your calls. You can send the channel name as the payload to accept the notification and join the call.

Related

Display user name on remote videos on Group chatting, Raise hand feature on Group chatting

We have integrated agora rtc for group video chatting using vue js. Would like to display corresponding user name on remote videos . I am unable pass user name custome property through stream as like userid. How to solve this issue. is there any way to pass custom object to send through stream to remote users.
Raise hand feature also need to do. How to do .
Could you help me
I'd recommend using the Agora RTM SDK for your use case. It lets you send messages to other users.
Using RTM whenever you join an RTC channel you can send a channel message to RTM with your name. That way other users can receive and display your name.
For raise hand, you can send a message with a request (eg: {"raise": "true"}), the remote user can then accept/reject the request and send the corresponding message back. If accepted you, you read the message and unmute the local user using RTC method.
You can find a quickstart app for RTM here.

How to send test push notification with custom data from firebase console?

How do we send a test push notification to my android emulator with custom data? I have FCM Token and it should directly come up on my emulator only... I don't want to send a notification to all the app users.
Is there any way to do this from firebase cloud messageing so, I can test with my data.
Yes, Sure you can test it through printing the device token
FCM.getFCMToken().then(token => {
console.log(token)
});
Then take the token and go to the cloud messaging section and you just set the FCM token in test message like the picture below:
Update
the new Firebase interface does not provides a direct way to test cloud messaging with data at the moment. However you have two options: either you create a certain subject and subscribe to it like the following code
FCM.subscribeToTopic("/topics/testTopic");
and then in the target section you can target topic testTopic (This may require time to confirm a new subject)
Or you can do this programming using Firebase admin, you can follow this tutorial:
https://medium.com/android-school/test-fcm-notification-with-postman-f91ba08aacc3
Hopefully this answer your question

Google GMail callback when someone reply to thread

I'm using Google GMail Api. All works fine with synchronous requests. However I would like to get notified when someone reply to given thread_id to a callback somehow.
I found this article https://developers.google.com/gmail/api/guides/push?hl=pl about push notifications and it's great but still I don't know how to setup Observer I have described above.
I'm using PHP btw, but I just need concept how it works and how I can setup that kind of communication between API and app.
There is currently no available API that detects/observes (something that behaves like a callback) if there is a reply for a specific thread_id.
You'll have to do the checking yourself, doing some polling (with users.threads.get) to see if there is a reply. Similar to what the OP was doing in this post (emphasis mine):
We have a web application that makes use of the Gmail API to automate certain emails on our users' behalf. When the application sends an email, it stores the threadId returned by the Gmail API. It then uses this threadId to poll the Gmail users.threads.get API, looking for replies. When a reply is detected, it pauses future emails.
You can use the Push notifications provided by Gmail API. The document is available here:
https://developers.google.com/gmail/api/guides/push?hl=pl#python
It's pretty much straight forward. Create a topic, then create a push subscription for the topic. It requires a webhook pointing to your web app. Grant necessary permission to the Gmail service account as mentioned in the document.
Use the below Python code to get notified:
request = {
'labelIds': ['INBOX'],
'topicName': 'projects/myproject/topics/mytopic'
}
gmail.users().watch(userId='me', body=request).execute()
We get a response with HistoryId. Tracking all the messages since the HistoryId can be done like this:
history = (service.users().history().list(userId=user_id, startHistoryId=start_history_id)
I found the below video helpful:
https://www.youtube.com/watch?v=wjHp9_NAEJo

Is Firebase Cloud Messaging suitable for messaging apps?

We're writing an app like LINE, and need notification service for each single message in a chat group when app is in background.
We try to use Firebase Cloud Messaging for this feature, but I can't see a reasonable implementation.
Topic subscribing is too slow for "create a topic for each chat group" since it takes hours to create one. Device group messaging is designed for devices owned by a single user. Using sending to a single device feature for each receiver and each message does not seem to be practical since the server loading is too heavy.
Is there a good way to use FCM making such app, or do I need to find another service? Thanks.

Real-time Push notifications with Firebase

I recently signed up to use Firebase and I can't seem to figure out how to push notifications to specific users.
For my use, I guess you can think of it like Facebook. Whenever a user does something, say posts an interesting article for their friends to read, I want all of the user's friends to be notified of that event. So, using Firebase, how would one make it possible to notify only their friends and not everyone? My database stores the conenctions.
Perhaps there is a way to have each user be a node in the Firebase database and each time a notification is sent, The user will constantly check his node, and if something appears, pulls it and then delete it.
The examples on Firebase seems to be sort of basic. I wish there was a user-specific push notification example.
Now Firebase supports Push Notification. Google rebranded GCM to Firebase Cloud Messaging and it now offers this cross platform service. Firebase also offers notifications.
These are the differences between these two services:
Firebase Cloud Messaging provides a complete set of messaging capabilities through its client SDKs and HTTP and XMPP server protocols. For deployments with more complex messaging requirements, FCM is the right choice.
Firebase Notifications is a lightweight, serverless messaging solution built on Firebase Cloud Messaging. With a user-friendly graphical console and reduced coding requirements, Firebase Notifications lets users easily send messages to reengage and retain users, foster app growth, and support marketing campaigns.
If you want a more detailed comparison. Read this.
There's a good explanation of how you can send notifications to specific users here:
How to send an alert message to a special online user with firebase
Basically you need to have each user observe a unique path, and then write data updates to the appropriate path.