How can i generate temporary token in agora for video calling web SDK? - agora.io

I want to generate temporary token in agora for video calling web SDK using API.
I searched about this on google, but didn't find anything related to that.

There are two ways to generate token for Agora Video Calling
Through Agora Console
Navigate to your project on Agora Console
Click Config
Go to Features
Select Generate Temp Token and enter channel name
Finish
Through native code in Java, Node etc which can be further used in your Rest Api
For Example in Java
RtcTokenBuilder appToken = new RtcTokenBuilder();
int timestamp = (int) (System.currentTimeMillis() / 1000 + Constants.get().RTC_TOKEN_EXPIRE_TIMESTAMP);
token = appToken.buildTokenWithUserAccount(Constants.get().AGORA_APP_ID, Constants.get().AGORA_APP_CERTIFICATE, Constants.get().AGORA_CHANNEL_NAME, "", RtcTokenBuilder.Role.Role_Publisher, timestamp);
refer to this link for this https://docs.agora.io/en/interactive-live-streaming/develop/integrate-token-generation?platform=web

Related

How to add scopes using expo's example on Google Authentication + firebase

I'm creating an app using react native + expo + firebase + google apis.
I'm trying to use certain Google products (lets say, calendar)
I'm trying to grab user's access token from Google
Expo has this document
https://docs.expo.dev/guides/authentication/#google
Unfortunately, their document is not complete, there's no other guides or API documentations. (They don't even document some functions that they are using)
There's no instructions on how to add scopes when following this method.
Has anyone succeeded in attaching a scope and grabbing a valid access token?
Any help would be appreciated, Thanks

Getting Google Calendar Events with React Native (Expo) using API KEY

I am trying to list my own calendar events on my app using my Google API API_KEY but it isn't working. Is this possible without authenticating a user since I only want to display my calendar?
Something Like:
var response = await fetch(`${googleApiConfig.calendarBaseUrl}/calendar/calendars/${calendarId}?
key=${googleApiConfig.key}`)
var json = await response.json()
Where calendarId (the calendar I am fetching) belongs to me. I don't want to grab other peoples calendar...
I figured out that the resource I was attempting to fetch was requiring OAuth 2.0. In order to fetch an event list of a specific calendar you need to use the following api endpoint:
https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events?key=${API_KEY}
Accessing /events on a calendar doesn't require authentication using OAuth 2.0

How to save data in a salesforce account using react-native?

We are building an Application and we need to store some data to the user's Salesforce account. I looked into some solutions where people are using Apex but I am unable to understand how to use them with React Native.
Please give me some good documentations to refer of How can I save my data from my React Native App to my Salesforce Account.
I tried to look into Apex and visualforce but not understanding how to use it with React Native.
For react Native you will have to call REST API exposed by salesforce. You will need to create a connected app and get the security key and client id. Use them to authenticate and get a access_token. Once you have that token, use it to make a POST call to /services/data/v45.0/sobjects/Account using the account id. Send a JSON payload to add your data.
Example of a GET call is :
/services/data/v45.0/sobjects/Account/0013600000udFs8AAE
Hope this helps!

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

How to share my youtube-playlist with the end user, using You Tube data api version 3 objective c

i am developing an app on which i want, end user can access my youtube-playlist(and videos among them). i have the full access of the youtube channel, just want the users to access them. I am using objective c client library for youtube v3.
what i have done:
auth 2 authentication for end user
api call to youtube server using my client id and secret.
Currently i am getting Like, upload, watch history etc. of my channel from another user(end user) but only the id, not any link of video of related playlist.
When i login using my credential of youtube on my app i get all the video links, but when i login using another youtube id then i don't get the video links. can not figure it out why this is happening.
Basically i just want some suggestion or direction on the following:
is it possible to share my youtube-playlist to others(end user)?
if possible then can the user can access the videos of the channel? if so how?
Thank you.
I was misunderstanding the concept. Any playlist/video that is publically visible on youtube, then just the ID for corresponding playlist/video is needed.
One has to make the query request to youtube server based on the ID of the resource he want to fetch.
Basically my Client ID and Secret are using on my app to get the details use of the app, meaning how much api is calling(you can get it on the console of your project).