This method returns the token used by Marketing Cloud Engagement to send push messages to the device.
Syntax
MCReactModule.getSystemToken() ⇒ Promise.<string?>
Returns
Promise.<string?>- A promise to the system token string.
Example
import { MCReactModule } from "react-native-marketingcloudsdk";
const getToken = async () => {
try {
const token = await MCReactModule.getSystemToken();
if (token) {
console.log("System token:", token);
} else {
console.log("No system token available");
}
} catch (error) {
console.error("Error getting system token:", error);
}
};