Comments (12)
@PierreCavalet it's common issue when you miss something from here
- In order for the library to work correctly, you'll need following SDK setups:
Android Support Repository
Android Support Library
Google Play services
Google Repository
Google Play APK Expansion Library
- In order for your app to communicate properly with the Google Fitness API, you need to provide the SHA1 sum of the certificate used for signing your application to Google. This will enable the GoogleFit plugin to communicate with the Fit application in each smartphone where the application is installed. https://developers.google.com/fit/android/get-api-key
from react-native-google-fit.
@StasDoskalenko I already provided the SHA1 sum to generate the clientID of the certificate which I directly put in the MainApplication.java
like so:
...
new GoogleFitPackage("clientID....apps.googleusercontent.com"),
...
I've used the following command to generate it (mac OS):
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
I then created new credentials for an Oauth client ID and submitted the SHA1 fingerprint and package name which gave me the clientID that I used in the MainApplication.java
. Is there something wrong with my procedure ? Note that I can retrieve my google fit data on my phone (in debug) which seems to indicate that it's somehow working, but maybe I missed something else.
Any idea ?
from react-native-google-fit.
@PierreCavalet yes. You shouldn't pass clientID to GoogleFitPackage constructor.
Just use it like in installation guide. new GoogleFitPackage(BuildConfig.APPLICATION_ID)
from react-native-google-fit.
In any case you can see the reason within:
GoogleFit.onAuthorizeFailure((error) => { console.log('failure', error); });
from react-native-google-fit.
I switched for new GoogleFitPackage(BuildConfig.APPLICATION_ID)
I get the error:
"ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{f40b858: android.os.BinderProxy@6ca86bc}, message=null}"
Which seems to be an error when the user did not authorized the application, but what is weird is that I'm in the authorization process.
I'm still getting this error before I pick the google account, so obviously I'm not signed in yet
from react-native-google-fit.
Actually, it means that you missed something from Google Docs. Please try to follow these instructions https://developers.google.com/fit/android/get-api-key really carefully.
from react-native-google-fit.
I'm no android expert, I don't really understand what I did wrong.
(Note that I didn't do the release key part since I'm in debug, is there something wrong with that ?)
I got my SHA-1 fingerprint from the ~/.android/debug.keystore and generated my clientID with the fingerprint and package name.
from react-native-google-fit.
Hi again,
I just wanted to provide more information in case this can help. Maybe I am wrong, but it seems that the api-key process works, because with an other keystore, it was not working (which is normal).
I went through the process again for the new keystore and I can now retrieve my data with this one. So it seems to work. The authorization also works normally on the "success scenario". The only thing which is not working seems to be the onAuthorizeFailure
which is still trigger even when it works.
from react-native-google-fit.
I have the exact same issue, GoogleFit.onAuthorize() is triggered at the exact same time as GoogleFit.authorize() is called, before user even selects his google profile. Results in an error message: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{2438a5: android.os.BinderProxy@d4c947a}, message=null}
.
from react-native-google-fit.
@ernestasromeika statusCode=SIGN_IN_REQUIRED
means that you've missed something from https://developers.google.com/fit/android/get-api-key
from react-native-google-fit.
@ernestasromeika did you solve your problem ?
btw I suppose you meant that the onAuthorizeFailure
callback is called at the same time as GoogleFit.authorize() is called ?
from react-native-google-fit.
I have no idea of how, but for some reason the following seems to work for me:
Inside node_modules > react-native-google-fit > android > build.gradle
, scroll all the way to the bottom and replace the version numbers of play-services-auth
and play-services-fitness
to +
, similar to how it is for react-native. Here's what it'll look like in the end:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.facebook.react:react-native:+'
compile 'com.google.android.gms:play-services-auth:+'
compile 'com.google.android.gms:play-services-fitness:+'
}
from react-native-google-fit.
Related Issues (20)
- Google fit consents screen change HOT 1
- AUTH_DENIED Authorization cancelled HOT 2
- isAvailable() doesn't work on Android 11+ without change to AndroidManifest.xml HOT 1
- getDailySteps returns empty array HOT 3
- passing callback to `observeSteps` causes crash HOT 6
- Running the react-native google fit with background fetch crashes the app HOT 1
- Data for users who never used Google Fit HOT 3
- Authorize Issue in bundle release HOT 6
- GoogleFit.getXXXSamples(options) returns with no data HOT 1
- Using new GoogleSignInClient
- I want to retrieve information about connected users.
- How to get Read Sleep Data by sessions of type sleep as Document HOT 4
- GoogleFit.disconnect() not working
- App crash on bundleRelease - java.lang.IllegalStateException
- How to allow access to our react native mobile app without mandatory Google OAuth sign in blocking users progressing (is it possible to easily skip)? HOT 3
- Not working in release or debug in .aab extention HOT 12
- Firebase Error: Attempt to invoke virtual method 'java.lang.String java.lang.String.to LowerCase()'on a null object reference HOT 1
- Missing source information for some datatypes
- Google Fit Sync working in prod apk but not in Playstore build (With firebase) HOT 1
- Could not find method compile() for arguments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-google-fit.