mapp-digital / Mapp-Engage-ReactNative-Plugin

0 stars 1 forks source link

Error: RNMappPluginModule.setToken is not a function #7

Open goodpic opened 1 year ago

goodpic commented 1 year ago

Hello. I am currently working on the Mapp integration to our React Native app. I am following this documentation but seeing the error when calling setToken.

https://mapp-wiki.atlassian.net/wiki/spaces/MIC/pages/1154744328/React+Native+Bridge+API+calls+Mapp+Cloud

Could you confirm that this is correct and that the document is up-to-date?

const configureMapp = async (): Promise<void> => {
  const token = await messaging().getToken();
  Mapp.setToken(token);
  Mapp.setPushEnabled(true);
};
 WARN  Possible Unhandled Promise Rejection (id: 0):
TypeError: RNMappPluginModule.setToken is not a function. (In 'RNMappPluginModule.setToken(token)', 'RNMappPluginModule.setToken' is undefined)
setToken@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=uk.co.riverford.apps.order:303147:36
@http://localhost:8081/src/services/mapp/useMapp.bundle?platform=ios&modulesOnly=true&app=uk.co.riverford.apps.order&dev=true&minify=false&runModule=true&shallow=true:20:79
generatorResume@[native code]

Screenshot 2023-01-05 at 11 57 20