Hi everyone
As I promished yesterday, here it is an example of GoogleLogin with OAuth in AppInventor or Thunkable:
First of all, you must know that it uses a webserver, but it’s not compulsory because I don’t mind to share mine
It uses Google+ API, so the app doesn’t need any additional permissions
#Setup
####Google Developer Console optional
Register a new project in Google Developers Console
Enable Google+ API (in Home >Library >Social Api>Google+ API )
Add an OAuth verification screen (in Home >Credentials >OAuth Consent Screen )
Request a new Web Credential, and fill the allower URL to your GoogleAuth folder’s path (in Home >Credentials >Credentials >Create Credentials>OAuth Client ID & Select Web application)
####WebServer optional
I recommend to use hostinger.es . It’s a free web hosting service.
Upload the files that I’ve attached in the files section
Open index.php file and add your credentials
Verify that everything is fine
####AppInventor
Upload the .aia file
Change all URLs to your server’s URLs optional
Use the data as you want
Build the .APK
#USE THE VERSION 2
###Login with Google V2
REFERENCE: GitHub
Video Instructions (just for server setup) : YouTube
15 Likes
Awesome Can you make extension? Maybe just one click login with Android account manager
That could be more difficult, because extensions are programmed in Java, and I don’t know too much that language
Mika
October 26, 2016, 2:52pm
5
Thank you!
It works really good!
If you need any other user data, I can add it
1 Like
I downloaded Firebase sample and uploaded my test server
http://goterror.lima-city.de/storage/
Can we get google user photo and upload photo to Firebase ? And get firebase url for download image and store login?
And firebase login http://goterror.lima-city.de/auth/
Can you add easy Facebook and Twitter login ?
1- You don’t need to upload user’s photo to firebase. You can simply store the image url and get it when you need it and display it
2- You have to setup the OAuth Keys to complete the authentication login.
3- I supose so, I’ve never tried it.
PD: I’m starting to develope Android Apps in Android Studio, and it’s easier than I supose, and also you can integrante lots of services of Firebase like messaging, notifications or login with a lot of services
1 Like
I think about store image url but if google change url format or block me i need recall all photo url nvm Good luck thanks for tip
Edit:New update come with cloudniary i think its fix cloud storage problems
Bruger
November 2, 2016, 11:40am
10
Hi Ali_Aydin
I am not sure if it is something you are looking for. Anyway, try watching this https://www.youtube.com/watch?v=mkBq9Yt7a8s and this https://www.youtube.com/watch?v=YQdGYqb3StM . You can change from TinyWebDB to Firebase and ignore the clock part. The users can upload image from their devices to Firebase and can download it as well.
1 Like
This is awesome. Thanks for sharing. Pure Vida makes you pay for their version. Thanks!
Bruger
November 13, 2016, 7:42pm
12
@barreeeiroo Should I select Android apps for Key restriction (see the image below)?
On the image below, how do I restrict my key?
No, you have to choose Web Application, not Android App
Bruger
November 13, 2016, 7:48pm
14
The first one (HTTP referrers (web sites)), right?
But, what did you choose? Because you don’t have to restrict nothing if you choose WebApplication in OAuth Credential
Did you choose API Key? Or anything else?
Bruger
November 13, 2016, 7:53pm
16
I have followed what you wrote, but a bit confused.
This is what I get after I am done with the last step.
There, you have to use the Web client 2, not the API Keys
Bruger
November 13, 2016, 8:08pm
18
OK, thanks. I should check it, right?. What about Web client (auto created by Google Service)? Should I check it as well?
This is because you created a project in Firebase, but you don’t have to check it
1 Like
Bruger
November 13, 2016, 9:08pm
20
Thank you very much. I will try setting it up again tomorrow, and may be get back to you with more questions.