From d169c26a604cf69450246b26435af6f6be2fea70 Mon Sep 17 00:00:00 2001 From: Ugur Akin Date: Sat, 2 Nov 2024 18:14:19 +0000 Subject: [PATCH] docs: updated docs for request permission --- docs/docs/api/methods/03-requestPermission.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/docs/api/methods/03-requestPermission.md b/docs/docs/api/methods/03-requestPermission.md index 7cf99eb..44a6fc3 100644 --- a/docs/docs/api/methods/03-requestPermission.md +++ b/docs/docs/api/methods/03-requestPermission.md @@ -9,7 +9,7 @@ Request permission for specified record types and access types. # Method ```ts -requestPermission(permissions: Permission[], providerPackageName: string): Promise +requestPermission(permissions: Permission[]): Promise ``` # Example @@ -32,3 +32,28 @@ const requestPermissions = () => { }); }; ``` + +If your app needs to write exercise routes, can include it as a special permission: + +```ts +import { requestPermission } from 'react-native-health-connect'; + +const requestPermissions = () => { + requestPermission([ + { + accessType: 'read', + recordType: 'ExerciseSession', + }, + { + accessType: 'write', + recordType: 'ExerciseSession', + }, + { + accessType: 'write', + recordType: 'ExerciseRoute' + } + ]).then((permissions) => { + console.log('Granted permissions ', { permissions }); + }); +}; +``` \ No newline at end of file