cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
527 stars 625 forks source link

health: 3.0.5 #336

Open rashmitank opened 3 years ago

rashmitank commented 3 years ago

getting Authorization not granted in your example project. I have properly set an OAuth2 Client ID.

takinok commented 3 years ago

I'm facing same problem on my apps..

yamachaso commented 3 years ago

I also have the same problem. HELP!!

JNicoVM commented 3 years ago

I've been having the same problem, the plugin doesnt ask the permission for GOOGLE_FIT_PERMISSIONS_REQUEST_CODE but directly print "Authorization not granted".

AntonFesun commented 3 years ago

The same issue.

ghost commented 3 years ago

Me too. I also have the same issue.

asmodeoux commented 3 years ago

same here, need to be fixed asap

ktech643 commented 3 years ago

I have same issue please resolve it

takinok commented 3 years ago

I've debugged the health plugin. This is my first try to debug the flutter package. So, it won't be enough investigation. But I want share what I know and I did following.

chanakiyan commented 3 years ago

I need to get the step count from google fit to my application when I tried the example it shows that Authorization not granted

[ /// You MUST request access to the data types before reading them bool accessWasGranted = await health.requestAuthorization(types); ] this bool value sets false

I tried to get the activity recognition permission by activity_recognition_flutter: ^4.0.0

In the app info it shows the permission was granted but still facing the same issue

I cannot find where the problem occurs if any contributors know something about it or any other procedure missed please instruct us and help us to use this feature

mniemyjski commented 3 years ago

Hi, What is "activity"? This variable is always null, therefore the following condition is always true: image oraz image

takinok commented 3 years ago

We can use v3.0.4 as workaround.

AntonSavelev commented 3 years ago

I also have the same issue.

bhargav6744 commented 3 years ago

We can use v3.0.4 as workaround.

can you explain it more how we can get around issue

sandeep9607 commented 3 years ago

getting Authorization not granted in your example project. I have properly set an OAuth2 Client ID.

Did you get any solution?

takinok commented 3 years ago

We can use v3.0.4 as workaround.

can you explain it more how we can get around issue

sorry for my rough comment. what I mean we can use the health v.3.0.4 temporarily until this issue is fixed.


<pubspec.yaml>
health: 3.0.4
patrickkusebauch commented 3 years ago

Another alternative is to use the #338 branch, before it is merged.

<pubspec.yaml>
  health:
    git:
      url: https://github.com/traveling-developer/flutter-plugins.git
      path: packages/health
      ref: health-3.0.3+1
himanshu447 commented 3 years ago

@patrickkusebauch it;'s not working. ?When tap on download button the google sign-in dialog open and then click on account it return with same error "Authorization not granted"

patrickkusebauch commented 3 years ago

@himanshu447 Just the fact that the google sign-in dialog will open means it is working. The follow-up error you are having seems unrelated to the original issue. You might have forgotten to actually set up the proper permissions. The setup I have described is working for me on an emulator as well as on an actual android device. Admittedly I have not tested it on an iOS device.

swiftdev69 commented 3 years ago

Hello @patrickkusebauch Google sign-in popup open for me as well, but after choosing account it return error "Authorization not granted", handleWindowVisibility: no activity .... I guess this is reason for auth fail. isn't it? WhatsApp Image 2021-05-21 at 6 06 29 PM

waikyaw9999 commented 3 years ago

getting Authorization not granted in your example project. I have properly set an OAuth2 Client ID.

I am having same issue. But where did you set the OAuth2 Client ID? I don't receive any Google Sign-In dialog. It goes straight to "Authorization not granted"

sandeep9607 commented 3 years ago

Hello @waikyaw9999 https://github.com/cph-cachet/flutter-plugins/issues/336#issuecomment-841665698 . But where did you set the OAuth2 Client ID? I also want to know

waikyaw9999 commented 3 years ago

Hello @waikyaw9999 #336 (comment) . But where did you set the OAuth2 Client ID? I also want to know

@sandeep9607 I followed your instruction. Now it showed me Google Sign-In Dialog but after I clicked on my google account. I am now stuck at the permission dialog box (I don't see anything but the google loading circle). I didn't set anywhere the OAuth2 Client ID.

waikyaw9999 commented 3 years ago

@himanshu447 Just the fact that the google sign-in dialog will open means it is working. The follow-up error you are having seems unrelated to the original issue. You might have forgotten to actually set up the proper permissions. The setup I have described is working for me on an emulator as well as on an actual android device. Admittedly I have not tested it on an iOS device.

Do you have any example about setting up the proper permission. I am having the same issue.

waikyaw9999 commented 3 years ago

@himanshu447 Just the fact that the google sign-in dialog will open means it is working. The follow-up error you are having seems unrelated to the original issue. You might have forgotten to actually set up the proper permissions. The setup I have described is working for me on an emulator as well as on an actual android device. Admittedly I have not tested it on an iOS device.

Do you have any example about setting up the proper permission. I am having the same issue.

Hi, it is working now. I set the wrong package name. #336 (comment) is working. When is it going to be in the release? I should mention that version 3.0.6 is still not working though. [Updated] This doesn't work on production as getting conflict with other packages.

riobijanero commented 3 years ago

I have the same Problem. None of the solutions are working for me

waikyaw9999 commented 3 years ago

I have the same Problem. None of the solutions are working for me

https://github.com/cph-cachet/flutter-plugins/issues/336#issuecomment-839795664 This works for me.

riobijanero commented 3 years ago

I have the same Problem. None of the solutions are working for me

https://github.com/cph-cachet/flutter-plugins/issues/336#issuecomment-839795664 This works for me.

hey @waikyaw9999 , thanks for the reply. however the link leads to an empty github page

waikyaw9999 commented 3 years ago

Oh. you can use health:3.0.4 > > > I have the same Problem. None of the solutions are working for me

https://github.com/cph-cachet/flutter-plugins/issues/336#issuecomment-839795664 This works for me.

hey @waikyaw9999 , thanks for the reply. however the link leads to an empty github page

sandeep9607 commented 3 years ago

@waikyaw9999 @takinok which flutter version you guys working with?

takinok commented 3 years ago

@waikyaw9999 @takinok which flutter version you guys working with?

Follwing is my version.


Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision adc687823a (7 weeks ago) • 2021-04-16 09:40:20 -0700 Engine • revision b09f014e96 Tools • Dart 2.12.3

ghost commented 3 years ago

Hello guys! I am also having issues. The dialog screen doesnt show and i get no permitions. I didn't set anywhere the OAuth2 Client ID. This was quite strange. I have a flutter firebase google sign in and i am assuming that since i am using the same fingerprint and credentials. things might work!

Version 3.0.4 doesnt provide sourceName property from the HealthDataPoint model, and i need it to filter steps added manually on iOS!

rohitranjan1991 commented 3 years ago

@bardram, Do we need to set up the generated Client OAth ID somewhere in the application ?? It isn't mentioned in the docs anywhere.

rGradov commented 3 years ago

I also have the same problem give me please full example for installation on android i mean I'm not correctly understand how need to setup this package image

Update: I didn't change anything but it worked image

ghzeni commented 3 years ago

We can use v3.0.4 as workaround.

Uh oh, it doesn't support null safety for newer versions of flutter image

Bhat015 commented 3 years ago

We can use v3.0.4 as workaround.

Uh oh, it doesn't support null safety for newer versions of flutter image

Run the app with --no-sound-null-safety argument for newer version of flutter

ghzeni commented 3 years ago

We can use v3.0.4 as workaround.

Uh oh, it doesn't support null safety for newer versions of flutter image

Run the app with --no-sound-null-safety argument for newer version of flutter

Worked as a charm. Had an issue involving 2.0.9 consts but 'flutter clean' did the trick. Thank you so much!

ghzeni commented 3 years ago

Quick update: authorization works using v3.0.4 but this is also a thing: https://github.com/cph-cachet/flutter-plugins/issues/354#issue-906882903

Though for some reason, I did manage to retrieve steps. Heart rate, on the other hand, returns empty.

FirdousNath commented 3 years ago

same issue 3.0.4 as well

rohitranjan1991 commented 3 years ago

Hi @Cheddargt, after debugging v3.0.4, I found the following working for me, try doing this with health v3.0.4: 1) add this permission to the android manifest file: <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" /> 2) Now in your dart code, before the code for fetching the google fit data, check for this permission with the help of "permission_handler" plugin by doing this "await Permission.activityRecognition.request().isGranted". Make sure that this permission is granted by the user on the screen and then proceed with the code for fetching the User Activity Data.

Hope this helps for now.

hasan-abul commented 3 years ago

Hello guys @rohitranjan1991 @Cheddargt after debugging v3.0.4, It's working for me with no errors the issue is I am not getting any data

  1. List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, endDate, types); list is always returning empty and step count is 0.

image

Please help !!

rohitranjan1991 commented 2 years ago

@hasan-abul , the latest version of the library solved it for me.

LarYoungruu commented 2 years ago

@hasan-abul , the latest version of the library solved it for me.

The latest version is : 3.1.1+1 Are you really active, I can't get a popup asking to access Google Fit

yukitaka13-1110 commented 2 years ago

I'm facing the same issue.

https://github.com/cph-cachet/flutter-plugins/issues/348#issuecomment-908512234

AccessDenied! was printed. What should I do?

yukitaka13-1110 commented 2 years ago

@hasan-abul , the latest version of the library solved it for me.

@rohitranjan1991 Are you sure? I still appeared. https://github.com/cph-cachet/flutter-plugins/issues/336#issuecomment-908591998

yukitaka13-1110 commented 2 years ago

I found solution. We need to make project public in GCP (Test or Production). https://console.cloud.google.com/apis/credentials/consent And need to add user in Test User.

riobijanero commented 2 years ago

I found solution. We need to make project public in GCP (Test or Production). https://console.cloud.google.com/apis/credentials/consent And need to add user in Test User.

for me it's only working in test mode. when I set the project to production mode, it stops working. do you have a solution for this?

rohitranjan1991 commented 2 years ago

@riobijanero ,, Did you go thru the full verification process after putting the app in production mode ?

mirkancal commented 2 years ago

I spent 2 months to finally verify my app with Google Oauth. It's mostly working fine now but yet, some users are reporting they stuck in tis white loading screen.

bulgarian-beast commented 2 years ago

I am working with Google Fit since 4 apps now. If your are stuck with endless loading screen try to flutter run --release on real android device.

in Google Cloud you also have to add your --release SHA generated, in order to make it work with your real device. And when you publish the app in order to allow your end users to access to google fit since they download it from the play store, you need to go on the web app publish ("google store console app publish" on google web) and recover the google SHA and add it to google cloud SHAs

shivam17099 commented 2 years ago

Does anyone know where we can store our OAuth client id .json file to our project and still i am having the access denied issue does anyone got any solution till now?

help