-
Notifications
You must be signed in to change notification settings - Fork 623
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
Support multi account operation for Android. #296
base: master
Are you sure you want to change the base?
Conversation
Upgrade play services.
Support to invoke as background task.
9bb1da7
to
18d1e9a
Compare
18d1e9a
to
d4dbe9a
Compare
@@ -457,7 +457,7 @@ class HealthPlugin() : MethodCallHandler, ActivityResultListener, Result, Activi | |||
for (typeKey in types) { | |||
if (typeKey !is String) continue | |||
typesBuilder.addDataType(keyToHealthDataType(typeKey), FitnessOptions.ACCESS_READ) | |||
typesBuilder.addDataType(keyToHealthDataType(typeKey), FitnessOptions.ACCESS_WRITE) | |||
//typesBuilder.addDataType(keyToHealthDataType(typeKey), FitnessOptions.ACCESS_WRITE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo? Are you commenting out the write permission on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our project, only the fitness.*.read scope has applied for permission to access sensitive data and to remove the limit on the number of OAuth users.
Therefore, if we enable ACCESS_WRITE, it will be blocked by Google, so we comment it out to use with our app.
In general, I don't think there is a problem with enabling it, but it would be better if we could set whether to use the write function or not when we new HealthFactory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid commenting out the line will have implication on all other users who need the write feature.
But I agree with you that there should be a possibility to opt out the write feature.
By the way, thanks for your quick response :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid commenting out the line will have implication on all other users who need the write feature.
Yes, I understand that, too.
I should have made the changes locally instead of pushing them to the repository, and I did it.
But I agree with you that there should be a possibility to opt out the write feature.
I hope you make it.
Thanks,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your latest commit.
And I've filed an enhancement issue #464
b8943ff
to
0d0c18b
Compare
0d0c18b
to
b16857f
Compare
Android can deal with multiple google accounts, but the helth plugin only targets the last signed in account. So I extend the plugin to support multiple google accounts, and update example to check following changes.
""
will be returned on iOS) ornull
(authorization failed). I assume to the app will save the account name in sharedPreference, etc.