isPushEnabled

The current state of the pushEnabled flag in the MobilePush SDK.

Syntax

MCReactModule.isPushEnabled() ⇒ Promise.<boolean>

Returns

  • Promise.<boolean> - A promise to the boolean representation of whether push is enabled.

Example

import { MCReactModule } from "react-native-marketingcloudsdk";

const checkPushStatus = async () => {
  try {
    const isEnabled = await MCReactModule.isPushEnabled();
    console.log("Push enabled:", isEnabled);
  } catch (error) {
    console.error("Error checking push status:", error);
  }
};

See Also