GoogleSignin_demo issue

Hi,
I downloaded the GoogleSignin demo from github: GitHub - scottrules44/googleSignIn-demo

I then created a OAuth 2.0 client ID credential with the Package name:
com.solar2d.app.googleSignIn_demo
and SHA-1 (debug.keystore in solar 2d setup directory):
00:85:F2:62:A2:91:F0:D1:CE:9E:E9:FB:CD:1D:50:E7:82:6D:BE:9D

I got my client ID and pasted that in main.lua in the beginning. I am just trying to simulate it in an Android environment for now. I am not using firebase.
My build.settings looks like this:

settings =
{
android = {
usesPermissions = {
“android.permission.INTERNET”,
“android.permission.GET_ACCOUNTS”,
},
},
–[[
iphone =
{
plist =
{
– UIApplicationExitsOnSuspend = true, – default is false
CFBundleIconFile = “Icon.png”,
CFBundleIconFiles =
{
“Icon.png”,
“Icon@2x.png”,
“Icon-60.png”,
“Icon-60@2x.png”,
“Icon-60@3x.png”,
“Icon-72.png”,
“Icon-72@2x.png”,
“Icon-76.png”,
“Icon-76@2x.png”,
“Icon-Small.png”,
“Icon-Small@2x.png”,
“Icon-Small@3x.png”,
“Icon-Small-40.png”,
“Icon-Small-40@2x.png”,
“Icon-Small-50.png”,
“Icon-Small-50@2x.png”,
},
CFBundleURLTypes = {
{CFBundleURLSchemes = {
“com.googleusercontent.apps.replace”,
}}
},
},
},]]
android= {
useGoogleServicesJson = false,
},
plugins = {
[“plugin.googleSignIn”] = {
publisherId = “tech.scotth”,
marketplaceId = “MY MARKETPLACE ID”,
supportedPlatforms = { android=true}
},
},
}

I have made sure the Google Sign In plugin is activated after I login to my account at Solar2d Marketplace

Now when I open the project the project loads fine but I get a warning (2 times):

WARNING: The ‘plugin.googleSignIn’ library is not available on this platform.

And now if I click on the Sign In text this warning pops up again on the console and nothing happens i.e. no Sign In progress happens.

When I build the project I am able to get further on the android device. It provides me the login/account selection page. But after that it gives a popup saying the following:

Sign In Cancelled
{"Status":"cancelled","data":"Bundle[{googleSignInStatus=Status{statuscCode=DEVELOPER_ERROR,resolution=null}}]","isError":false,"name":googleSignIn"}

Any help on how to get past this would be appreciated.

Do you set:
marketplaceId = “MY MARKETPLACE ID”,

And replaced your own google-service.json ?

I did, since the error is DEVELOPER_ERROR it seems it may be due to my Oauth authorization to be in Developer mode?

Hi aryajur,

did you ever solve your problems. I get the same error “DEVELOPER_ERROR” although I have replaced all the placeholders with the appropriate IDs, SHAs and tokens.

What is somewhat confusing is, that documentation says we need a google-service.json, but we can also use it without. But then it is never quite clear what different setup you need to make.
I assume it has to do with the flag: useGoogleServicesJson = true and true is only needed if you go via Firebase.
I have tried both and always get the same error.

Hi Stephan,
No I was not able to solve it. I decided to do Oauth login using the browser instead for now and thought will get back to it when I really need it.

Hi aryajur,

that might be a good work around for me as well. Do you have an example or can point me in the right direction what to do? Are there any docs?

Thank you.

Hi Stephan,
I haven’t implemented on the app yet. I have done it on desktop apps and web apps. I have used this OAuth2 Lua module that I maintain: GitHub - aryajur/oauth2: OAuth 2.0 Authentication module for Lua
I have a backend server. So my plan is to open the login using system.openURL or native.webview and send the authorization code to my backend. Then my app can retrieve it and generate the token.