usePush
Platforms:✓ Expo
Only users with push tokens can receive notifications. This hook can be used to manage the tokens of the currently signed in user.
import { usePush } from '@healthblocks-io/native/push'
function Page() {
const {
// boolean indicating if the push tokens are loaded
loading,
// array of push tokens
pushTokens,
// boolean indicating if the user is receiving notification on the current device
subscribed,
// method to request an expo push token and save it in the user profile
subscribe,
// method to remove a specific push token
unsubscribe,
} = usePush()
}