mindful_minutes

Last updated:

0 purchases

mindful_minutes Image
mindful_minutes Images
Add to Cart

Description:

mindful minutes

Features #
Plugin for writing mindful minutes to Apple Health on iOS.
Features:

Check for write permission
Request write permission
Write mindful minutes

This works on iOS 12 (other pub.dev health plugins require a higher iOS version, so I created my own).
Getting started #

Add to pubspec.yaml
Use plugin in your code (see examples of all methods below)
Add permission for NSHealthShareUsageDescription and NSHealthUpdateUsageDescription to ios/Runner/info.plist:

<key>NSHealthShareUsageDescription</key>
<string>This app would like to access mindful minutes.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>This app would like to save mindful minutes.</string>
copied to clipboard
Usage #
const _plugin = MindfulMinutesPlugin();

final bool hasPermission = await _plugin.checkPermission();

final bool hasPermission = await _plugin.requestPermission();

await _plugin.writeMindfulMinutes(startTime, endTime);
copied to clipboard
Important #
iOS will ask the user only once per app for granting permissions. If the user disables it from iOS settings, it needs to be enabled from iOS settings.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.