Why do SDK data calls say permission not granted?
Data functions like getActivity / getDaily only work after the SDK is fully initialised.
Data functions like getActivity / getDaily only work after the SDK is fully initialised.
1
Call initTerra(). This should run on every app launch.
2
Call initConnection() with an auth token generated from your backend, which triggers the permissions flow.
initConnection only needs to run once per install, unless you expand permissions or the app is reinstalled.
Not connected to Health Connect / permission not granted errors usually mean a data call ran before init completed. Confirm the connection with getUserId(): a non-null user id means the connection is established. See the Android SDK reference.
PreviousWhy am I seeing Android React Native background crashes?
NextWhy does the SDK report success when user denies permissions?
Last updated
Was this helpful?