Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't ask for Offline token access? #29

Open
oakleaf opened this issue Feb 14, 2019 · 5 comments
Open

Can't ask for Offline token access? #29

oakleaf opened this issue Feb 14, 2019 · 5 comments

Comments

@oakleaf
Copy link

oakleaf commented Feb 14, 2019

Hello, it seems I cant use;

    Google.initialize({
        clientID: App.Constants.GOOGLE_API_TOKEN,
        scopes: App.Constants.GOOGLE_FIT_SCOPES,
        access_type: 'offline'
    });  

to retrieve Offline access (E.g a "backend token") so we may get data from our backend. Is it possible to add this feature to this module?

@deckameron
Copy link

deckameron commented Feb 19, 2019

Hi @oakleaf,

I have implemented the Access Token. Could please check if this is what you need?

The response should have something like this :

"accessToken": "ya29.BucfHbDFMIGBucfHbDFMIGBucfHbDFMIGBucfHbDFMIGBucfHbDFMIG"

@oakleaf
Copy link
Author

oakleaf commented Feb 19, 2019

Hi @oakleaf,

I have implemented the Access Token. Could please check if this is what you need?

The response should have something like this :

"accessToken": "ya29.BucfHbDFMIGBucfHbDFMIGBucfHbDFMIGBucfHbDFMIGBucfHbDFMIG"

Hey, sounds awesome (If this would be the case) but Im getting this error when I try your module:

[ERROR] : TiExceptionHandler: (main) [2900,3238] Google.signIn();
[ERROR] : TiExceptionHandler: ^
[ERROR] : TiExceptionHandler: Error: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
[ERROR] : TiExceptionHandler: at GoogleFitCallback (eval at Module._compile (app://app.js:728:13), :132:20)
[ERROR] : TiExceptionHandler: at View.buttonClickListener (eval at Module._compile (app://app.js:728:13), :89:13)
[ERROR] : TiExceptionHandler: at View.value (ti:/events.js:49:21)
[ERROR] : TiExceptionHandler: at View.value (ti:/events.js:101:19)
[ERROR] : TiExceptionHandler:
[ERROR] : TiExceptionHandler: ti.googlesignin.GooglesigninModule.signIn(GooglesigninModule.java:156)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:971)
[ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1196)
[ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:401)
[ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:101)
[ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:164)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6938)
[ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
[ERROR] : V8Exception: Exception occurred at undefined:132: Uncaught Error: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference

@deckameron
Copy link

@oakleaf Could you try this version, please?

@oakleaf
Copy link
Author

oakleaf commented Feb 21, 2019 via email

@oakleaf
Copy link
Author

oakleaf commented Jan 21, 2020

This seems to work for the iOS-version. Why is this not in sync with that one?

currentUser (Dictionary, get)
id (String)
scopes (Array)
serverAuthCode (String) <---- This is what we need
hostedDomain (String)
profile (Dictionary)
name (String)
givenName (String)
familyName (String)
email (String)
hasImage (Boolean)
authentication (Dictionary)
clientID (String)
accessToken (String)
accessTokenExpirationDate (Date)
refreshToken (String)
idToken (String)
idTokenExpirationDate (Date)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants