react-native-samsung-health-launcher
v0.1.1
Published
Android-only React Native helper to open Samsung Health and its permission settings screen.
Downloads
225
Maintainers
Readme
react-native-samsung-health-launcher
Android-only React Native helper for opening Samsung Health or its permission screen.
This package is useful when a Samsung Health integration needs to send the user out of the app to:
- open the Samsung Health app itself
- open Samsung Health permission settings for your app
On iOS and other non-Android platforms, the exported methods return false.
Platform support
- Android: supported
- iOS: no-op, returns
false
Installation
yarn add react-native-samsung-health-launcheror
npm install react-native-samsung-health-launcherReact Native autolinking handles Android integration automatically.
Usage
import {
openSamsungHealth,
openSamsungHealthPermissions,
} from 'react-native-samsung-health-launcher';
const openedApp = await openSamsungHealth();
const openedPermissions = await openSamsungHealthPermissions();API
openSamsungHealth(): Promise<boolean>
Attempts to open Samsung Health using the installed launcher activity.
Returns:
trueif an Android activity was launchedfalseif Samsung Health could not be opened or the platform is unsupported
openSamsungHealthPermissions(): Promise<boolean>
Attempts to open Samsung Health's permission screen for the current app. If that screen cannot be resolved, it falls back to opening Samsung Health itself.
Returns:
trueif an Android activity was launchedfalseif no matching activity could be opened or the platform is unsupported
Notes
- Samsung Health must already be installed on the device.
- This package only opens Samsung Health screens. It does not grant permissions or integrate with Samsung Health data APIs by itself.
- If Samsung changes internal activity names or intent handling in a future Samsung Health release, the package may need an update.
