Sharing a post though Google+

Hi

We are working on sharing some app info (progression on the game) to Google+.

I have some questions i did not see or i just missed answers to it in the forum.

 - Is it possible to leverage the sharing to google+ button from Coronas apps as described in the links below?

https://developers.google.com/+/mobile/android/share/

https://developers.google.com/+/features/interactive-posts

 - As i did not manage to find a way to use the first approach i move back to use the web-api. However i saw that it’s not allowed to write on a user stream (which would be a similar thing as posting on the wall on facebook)

Here is a comparison between the Google+ Api V1 and GoolePlusDomain Api

https://developers.google.com/+/domains/getting-started

Seems that writing to the stream is allowed for the GooglePlusDomainApi, however i did not manage to share it properly or to configure it properly to be able to write on it. Also i am not sure exactly about what is the meaning of domain restriction.

  • My last finding is the possibility for an app to share “moments”

https://developers.google.com/+/api/moment-types/

But the posts may be visible or not depending on the user configuration.

What is the approach of Corona users to implements Google + sharing from your games?

Is there another approach available that i did not mention? Especially the access to the share button. It’s kind of difficult to explain why we can’t do it

Thanks for your time

Hi, I’ve the same question pending but I did not find something more.

I’m using with success the library (**) to connect to google+  via OAUTH2 and now I’m trying to do the same way to post moments.

** https://github.com/cassiozen/corona-googleConnect

I’ve found some sample like this one in javascript  but my attempts to transform this into a working code at the time failed.  

function moment(){ var postUrl = THE\_PAGE\_URL; var payload={ 'type': 'https://schemas.google.com/AddActivity', 'target': {'url':postUrl} }; var moment = { 'type':'http://schemas.google.com/AddActivity', 'target':{ 'url':postUrl } }; var args = { 'path': '/plus/v1/people/me/moments/vault', 'method': 'POST', 'body': JSON.stringify(payload), 'callback': function(response) { console.log(response); } }; gapi.client.request(args); }

Have you made some kind of progress ?

Regards

Gianluca

Hi, I’ve the same question pending but I did not find something more.

I’m using with success the library (**) to connect to google+  via OAUTH2 and now I’m trying to do the same way to post moments.

** https://github.com/cassiozen/corona-googleConnect

I’ve found some sample like this one in javascript  but my attempts to transform this into a working code at the time failed.  

function moment(){ var postUrl = THE\_PAGE\_URL; var payload={ 'type': 'https://schemas.google.com/AddActivity', 'target': {'url':postUrl} }; var moment = { 'type':'http://schemas.google.com/AddActivity', 'target':{ 'url':postUrl } }; var args = { 'path': '/plus/v1/people/me/moments/vault', 'method': 'POST', 'body': JSON.stringify(payload), 'callback': function(response) { console.log(response); } }; gapi.client.request(args); }

Have you made some kind of progress ?

Regards

Gianluca

Hello,

Have you guys found any solution?

I have both Facebook and Linkedin “post on user wall/stream” working but not Google+.

I am trying to use (“https://www.googleapis.com/plusDomains/v1/people/me/activities”, “POST”, … ) with that googleConnect library but its giving me a 403/Forbidden

Here are the scopes im using: 

https://www.googleapis.com/auth/userinfo.email

https://www.googleapis.com/auth/userinfo.profile

https://www.googleapis.com/auth/plus.me

https://www.googleapis.com/auth/plus.stream.write

Thanks.

For sharing on Google+, have you tried this approach?

local gPlusLink = "https://plus.google.com/share?url=" .. url.escape ("{" .. urlToShare .. "}") system.openURL(gPlusLink)

You could also try to share via the Google+ app if the user has it installed. On iOS, Corona now (as of last Friday) supports the share sheet, which might include the Google+ app if the settings are configured properly. On Android, Corona’s Facebook sharing is broken but Google+ sharing might work, not sure. See this thread:

http://forums.coronalabs.com/topic/52755-can-corona-enable-limited-facebook-sharing-on-android-via-nativeshowpopup/

Hi, thanks for the answer.

Yes, I am now trying that approach, since I read that Google+ API for writing is a no no.

So basically, I am opening a showWebPopup with that link on click (only enabled if the user is already logged in with Google Plus) and it is actually working (just have to make some php page with a image and a redirect “script” now I guess).

The ‘problem’ now, is how to control that webpopup, meaning: I have a close button on top that closes the popup if the user wants to cancel the share, but when the user goes through and shares the URL the popup doesn’t close automatically. Is there a way to detect when the share is complete so I can close the popup and open a native window for instance saying “Google+ Share Completed!”.

Thanks.

Hello,

Have you guys found any solution?

I have both Facebook and Linkedin “post on user wall/stream” working but not Google+.

I am trying to use (“https://www.googleapis.com/plusDomains/v1/people/me/activities”, “POST”, … ) with that googleConnect library but its giving me a 403/Forbidden

Here are the scopes im using: 

https://www.googleapis.com/auth/userinfo.email

https://www.googleapis.com/auth/userinfo.profile

https://www.googleapis.com/auth/plus.me

https://www.googleapis.com/auth/plus.stream.write

Thanks.

For sharing on Google+, have you tried this approach?

local gPlusLink = "https://plus.google.com/share?url=" .. url.escape ("{" .. urlToShare .. "}") system.openURL(gPlusLink)

You could also try to share via the Google+ app if the user has it installed. On iOS, Corona now (as of last Friday) supports the share sheet, which might include the Google+ app if the settings are configured properly. On Android, Corona’s Facebook sharing is broken but Google+ sharing might work, not sure. See this thread:

http://forums.coronalabs.com/topic/52755-can-corona-enable-limited-facebook-sharing-on-android-via-nativeshowpopup/

Hi, thanks for the answer.

Yes, I am now trying that approach, since I read that Google+ API for writing is a no no.

So basically, I am opening a showWebPopup with that link on click (only enabled if the user is already logged in with Google Plus) and it is actually working (just have to make some php page with a image and a redirect “script” now I guess).

The ‘problem’ now, is how to control that webpopup, meaning: I have a close button on top that closes the popup if the user wants to cancel the share, but when the user goes through and shares the URL the popup doesn’t close automatically. Is there a way to detect when the share is complete so I can close the popup and open a native window for instance saying “Google+ Share Completed!”.

Thanks.