B4A Library Google Plus SDK Wrapper + Native Google +1Button

Periklis Koutsogiannis

Active Member
Licensed User
Longtime User
Clean your project.

Also if you are using both SDKs you have to have 2 WrapperActivity objects:

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

    Dim FB As Facebook
    Dim GP As GooglePlus
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private BtnConnect As Button
    Private BtnDisconnect As Button

    Dim FBActivity As WrapperActivity
    Dim GPActivity As WrapperActivity
End Sub

Sub Activity_Resume

    FB.SetActivity(FBActivity.Initialize("facebook_status_changed"))
    GP.SetActivity(GPActivity.Initialize("googleplus_status_changed"))
End Sub

Sub facebook_status_changed
End Sub

Sub googleplus_status_changed
End Sub
 

Douglas Farias

Expert
Licensed User
Longtime User
finally *-*


my sha1 is incorrect ths is changed when i close the b4a *-*

thx man now is working fine *-*
 

Periklis Koutsogiannis

Active Member
Licensed User
Longtime User
Nice!

Please check my previous post about the 2 WrapperActivity objects. Your code as it was posted will not work correctly.
 

Douglas Farias

Expert
Licensed User
Longtime User
yes i have added xD thx man realy thx
 

Periklis Koutsogiannis

Active Member
Licensed User
Longtime User
Update: 2.0

  • Now part of the SocialApi unified wrapper library
  • Major code refactoring
  • Renamed: GooglePlus -> GooglePlusProvider
  • Renamed: WrapperActivity -> SocialApiActivity
  • Renamed: WrapperActivity.Initialize -> SocialApiActivity.GetWithEvent
  • Added: Google +1 button custom view

How to migrate from previous versions:
  1. Delete GooglePlus.jar SimpleApiWrapper.jar and GooglePlus.xml SimpleApiWrapper.xml from your B4A Libraries folder
  2. Download the latest gplussdk.zip, delete the old folder and extract the contents of the new one
  3. Select the SocialApi library from the list of the available libraries in the IDE
  4. Rename all mentioned classes in the change log above
Done!
 
Last edited:

GMan

Well-Known Member
Licensed User
Longtime User
Well done, so next step is the FB LikeButton ?
 

GMan

Well-Known Member
Licensed User
Longtime User
Ah, OK - and Posting something or sending Picture ?
 

GMan

Well-Known Member
Licensed User
Longtime User
best both ;-)
 

GMan

Well-Known Member
Licensed User
Longtime User
Thx...read it aber deleted it (as it seems) in my cpu
 

brelto85

Active Member
Licensed User
Longtime User
is possible upload a photo to user's dashboard with this library?
 
Last edited:

Periklis Koutsogiannis

Active Member
Licensed User
Longtime User
Update: 2.2

  • Restructured due to a conflict with AdMod library and GooglePlusProvider has its own package. Please read the Getting started for updated installation instructions!
 
Last edited:

Periklis Koutsogiannis

Active Member
Licensed User
Longtime User

JeanLC

Member
Licensed User
Longtime User
Hello,
How can I retrieve the google token?

Using this library/wrapper... After Google one button sign-in, and authenticated by the App and Google.
How can I retrieve the token?
The token the app can send to a backend server to check user authentication with google.
In the API it's GoogleAuthUtil.getToken
then you check from backedn server with https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=<how to get this token>
and you confirm the info from google with a response like this:
{
"iss": "https://accounts.google.com",
"sub": "110169484474386276334",
"azp": "1008719970978-hb24n2dstb40o45d4feuo2ukqmcc6381.apps.googleusercontent.com",
"email": "billd1600@gmail.com",
"at_hash": "X_B3Z3Fi4udZ2mf75RWo3w",
"email_verified": "true",
"aud": "1008719970978-hb24n2dstb40o45d4feuo2ukqmcc6381.apps.googleusercontent.com",
"iat": "1433978353",
"exp": "1433981953"
}
so the server knows that's the real user without additional sign-in.

https://developers.google.com/identity/sign-in/android/backend-auth

Thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…