We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
import AppleHealthKit from 'react-native-health'; const PERMS = AppleHealthKit.Constants.Permissions; export const permissions = { permissions: { read: [ PERMS.StepCount, PERMS.Steps, PERMS.Workout, // PERMS.SleepAnalysis, // PERMS.ActiveEnergyBurned, // PERMS.BasalEnergyBurned, // PERMS.EnergyConsumed, // PERMS.ActivitySummary, ], write : [] } }
import AppleHealthKit from 'react-native-health'; import moment from 'moment'; import {permissions} from './permissions'; export const checkAppleHealth = async () => { return new Promise((resolve, reject) => { AppleHealthKit.isAvailable((err, results1) => { console.log('isAvailable results', results1); if (err) { console.log('error isAvailable Healthkit: ', err); resolve({success: false, ...results1}); } AppleHealthKit.getAuthStatus(permissions, (err, results2) => { console.log('getAuthStatus results', results2); if (err) { console.log('error getAuthStatus Healthkit: ', err); resolve({success: false}); } resolve({success: true, ...results2}); }); }); }); }; export const authAppleHealth = () => { return new Promise((resolve, reject) => { AppleHealthKit.initHealthKit(permissions, (err, results) => { console.log('authAppleHealth results', results); console.log('err', err); if (err) { console.log('error initializing Healthkit: ', err); resolve({success: false, response: {error: err?.message}}); } resolve({success: true}); }); }); };
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Returns {"permissions": {"read": [1, 1], "write": []}}.
The text was updated successfully, but these errors were encountered: