How to check Google+ Hangout ending event using the API - ajax

I have been working on a web app that, among other things, allows users to communicate with each other using Google+ Hangout.
The web app initiates the hangout and passes the Hangout URL to other potential participants. During the Hangout sessions the Hangout app sends information back to the server (using Ajax) on several events such as “onParticipantsAdded", "onParticipantsRemoved" etc.
I am trying to find out a way to notify the web app when the Hangout is over. The other events I mentioned (such as onParticipantsRemoved) will not work once the last participant leaves.
Currently I am sending a “heartbeat” from the hangout to the web app every few minutes, but I am wondering if there is a better way to know when the Hangout ends?

Since the hangout operates inside a window, you might be able to catch the onclose event for that window, but best practice is to rely on a heartbeat, as you've described.

Related

How to show a loading circle on slack app home while my app is retrieving data?

The view.publish API can be used to provide an interactive interface to the user.
However, there is a delay of several seconds between the time my app receives the app_home_opened event and the time it calls the view.publish API, because my app should retrieve data. During this time, I would like to display a loading circle in App Home.
There is no mention of how to display it in the Slack API documentation. Apps like Google Calendar do this, so this should not be impossible.
Does anyone know of a way to do this?

How can I build a webapp which uses google calendar api without having to become verified?

What I want to build:
I want to build a website where users can connect their google calendars (this will use Google Calendar API's)
and view their calendar events, as well as edit them, and create new ones.
My problem:
In order to do so, google says my app needs to be verified, which can take weeks, and I also need to set up terms of services pages, privacy policy pages
I also need to supply authorised javascript origins which MUST start with https, which of course is a problem during development, since my origin is http://localhost
I also need to set up support emails and homepage link
Question
I just want to start building my application without having to set up a whole production-ready website eco system.
Is there anyway I can use these Google Calendar APIs for editing/creating calendar events locally, without having to set up everything mentioned above first?
Unverified apps can still be used by the developer who created the project on google developer console.
Unverified app screen
The app or script might display an "unverified app" screen before it displays the consent screen. This is based on the specific scopes that your app includes in the request.
You can still work on your app while you are going though the verification process. However that being said i would start that process asap it can take a long time to get verified.
Yes, you can. As far as I am able to tell, all the verification step does is remove the "unverified app" screen. As long as you click Advanced > Go To ... (unsafe), you should be able to create and edit calendar events for that user in your application.
In order to be able to create and edit calendar events, you need to use the most sensitive scope, which is https://www.googleapis.com/auth/calendar. I couldn't figure out how to edit and create calendar events in my web app until I changed my scope from calendar.events to calendar.
Creating Events: https://developers.google.com/calendar/create-events

Google Hangouts - controlling other participants video

I'm thinking about creating sort of helper application for friend to enjoy paper RPG through internet.
I was thinking about using Hangouts API, however I have.
Is there a way of temporarily exclude some of the participants from running conversation? They can see other data on app, but should hear nor see other participants.
Is there a way of creating a private conversation within group conversation? So private participants will disappear from group, and after finishing the would automatically be reconnected to group conversation?
I'm reviewing Hangouts API, but I'm not finding answers. Or maybe I should look into WebRTC instead of Hangouts?
Thanks
What you're describing is... another Hangout or WebRTC session ;). You could always develop your own Hangout Extension to share specific info with selected participants who are also using your extension.
You could also have your Hangout session be the main conversation with all parties, while you use Join.me, Zoom.us or WebRTC to screenshare privately with your friend.

Check wether an user has used hangout before

Is there a way to check wether an user has used hangout before via API? I need it to build a report and promoting hangout within the organisations.
No, there is no API that tracks this.
Depending on your exact needs, you might be able to run an organizational hangout app when they start it, triggered by the start button, which would report they're using the app... but this isn't foolproof (it would ignore hangouts started via calendar, for example).

Google + API Get Hangout Id from URL

I am trying to integrate Google Hangout API into my website.
The user wants to:
Create a hangout
Copy that URL
Save that URL in our site
Display information about hangout
I know that I can get the information I need using: https://www.googleapis.com/plus/v1/activities/{activityId}
What I am struggling with is getting the activity id.
The only solution I see is:
First somehow find the userid /plus/v1/people?query
Then list the activities for that person /plus/v1/people/00000/activities/ and match the url
Then call /plus/v1/activities/
There as to be an easier way surely!
I think the easier solution would be to go a different route entirely. Instead of trying to get the hangout information via the Google+ post/activity, create a Hangout App that sends the URL for the hangout to your server. Under this scenario, the steps would be one of the two following scenarios.
Simple way:
User starts a hangout video chat from your website
The website link to create it also includes the gid of an app to start when the video chat starts
The app sends a message to your website indicating the URL of the hangout that was started
Alternate way:
User starts a hangout however they want to
When they're ready to tell your website, they run the same app
The app sends a message to your website indicating the URL of the hangout
Depending on your needs, you can then have the app do other things associated with monitoring the hangout is still alive, the number of people, etc. Your website would then display the information it receives using whatever format you wish.
You can find out more about this method in the video How do I Include a Hangout on my Website?

Resources