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

add data limit fetch implementation #815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

followthemoney1
Copy link

Why are we making this pull request?

Original problem described: #581

Updates

Such as original plugins already contain limit parameter in ios native files, we could basically try to add this parameter to getHealthDataFromTypes function.

How to use

 ///This is only answer does the user requested permission or not
  ///It's doesent mean that he allow to read\write
  ///[https://stackoverflow.com/a/33021234]
  Future<HealthDataPermission> requestAccessToHealthDataGranted() async {
    final bool accessWasGranted = await _health.requestAuthorization(_allTypes);

    localDataSource.saveHealthAccess(accessWasGranted ? HealthDataPermission.granted : HealthDataPermission.forbidden);

    return accessWasGranted ? HealthDataPermission.granted : HealthDataPermission.forbidden;
  }

Callout: #706

@hoffmatteo hoffmatteo self-assigned this Jan 22, 2024
Copy link
Contributor

@hoffmatteo hoffmatteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently unable to test on iOS so I am not sure if I will be able to include this in the upcoming release until I am able to test, but this is a great feature.

@@ -12,17 +12,10 @@ class HealthDataPoint {
String _deviceId;
String _sourceId;
String _sourceName;
String _uuid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to add this new field?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hoffmatteo added only for simplify cuz plugin is not returning an uuid in general this means that we need to use another plugins to get uuid of user. In general this is more a draft which you can change if needed

final args = <String, dynamic>{
'dataTypeKey': dataType.name,
'dataUnitKey': _dataTypeToUnit[dataType]!.name,
'startTime': startTime.millisecondsSinceEpoch,
'endTime': endTime.millisecondsSinceEpoch
'endTime': endTime.millisecondsSinceEpoch,
if (limit != null && limit > -1) 'limit': limit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is already implemented on the iOS side this is a great change!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hoffmatteo thanks mate 💖

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

Successfully merging this pull request may close these issues.

None yet

2 participants