Closed ShaharyarMaroof closed 4 years ago
Have you followed the section fro Android and create an OAuth 2.0 Client ID?
Ah, I skipped that as it was in the manual section of the installation guide. Thanks, will look into this. Could you update the steps so that this is step is in the mandatory section of the guide?
Hey @Francesco-Voto I created the key as mentioned in the Android section and since I used auto linking to link the package I did not have to manually link the lib in android. but I still cannot get authorised from the Google Fit API. Any suggestions?
Hi @ShaharyarMaroof. Normally this kind of problems are some misconfiguration, since no info are inserted inside the codebase, but everything is handled via OAuth 2.0. Have you found some trouble to follow the guide at https://developers.google.com/fit/android/get-api-key?
No I got the client key from the following the steps there. Now how will I integrate it with my Android project.
Won't we have to provide the google client ID somewhere in the app to connect to the Fitness API? As this lib has done? react-native-google-fit
No this is not necessary. You just need to register your app in Google API console. You need also to call Fitness.requestPwermissions()
first time you want to fetch the data.
Hope this will help. :)
Thank you very much! :) (Y)
For getting Oauth token, I followed (https://developers.google.com/fit/android/get-api-key), but when I ask for Fitness.requestPwermissions()
it shows me to choose an account, and after selecting the account that screen disappears. And Fitness.isAuthorized return false value
For getting Oauth token, I followed (https://developers.google.com/fit/android/get-api-key), but when I ask for
Fitness.requestPwermissions()
it shows me to choose an account, and after selecting the account that screen disappears. And Fitness.isAuthorized return false value
@iitsuraj I'm experiencing the same issue, did you solve it?
Usually this means a misconfiguration on OAuth 2.0 Client ID part. Please note for Debug ore Release you will use different SHA-1 as well as you need to create different Client ID if you change package name in your flavours
@Francesco-Voto You are right. I created the Client ID with the wrong debug.keystore, not the one provided with the React Native android project. Thank you for your help
@ShaharyarMaroof are you able to get data without installing Google fit app on android?
@GuleriaAshish , I don't remember as I moved to another library.
@ShaharyarMaroof Which library, Please suggest.
@GuleriaAshish I used react-native-google-fit and rn-apple-healthkit
@rlems i already get the clientID from console.developers.google, where should i put it in. It did not mention in the Doc / Readme
Nowhere. We are using OAuth 2.0 which relies on SHA and package name you put on console
@scerelli I am trying to authorise the app to connect to google fit, but the Fitness.requestPermissions method always returns false. Is there some specific requirements for android? I saw a merge request #6 which was intended to allow connection even without Google Fit installed.
I am using react-native 0.60.6, lib version 0.2.4 and Android Q (API level 29) emulator. Any idea what could be wrong?