import { ... } from 'react-firehooks/messaging';
Returns the messaging token. The token never updates.
const [token, loading, error] = useMessagingToken(messaging, options);
Params:
messaging
: Firestore Messaging instanceoptions
: Options to configure how the token will be fetched
Returns:
value
: Messaging token;undefined
if token is currently being fetched, or an error occurredloading
:true
while fetching the token;false
if the token was fetched successfully or an error occurrederror
:undefined
if no error occurred