Closed aitdigitaltechnology closed 1 year ago
Hello @aitdigitaltechnology, could you please send us the code of how are you calling MobileMessaging.init and how configuration is provided or you may be you could try to reproduce it using Example application
Hi @riskpp we follow the guideline to create a new mobile application profile to get the application code, get the FCM key from Firebase appropriately as in the attached screenshot. We managed to receive push notifications on our mobile application successfully, however this error happens during runtime. Here is how we init the MobileMessaging:
const initMobileMessaging = () => {
if (Platform.OS === 'ios' || !configuration.geofencingEnabled) {
mobileMessaging.init(
configuration,
() => {
console.log('MobileMessaging started');
console.log(globalThis.userId)
mobileMessaging.personalize({ userIdentity: { externalUserId: globalThis.userId?.toString() } }, () => {
console.log('User saved');
}, (error) => {
console.log('User save error', error);
});
},
error => console.log('Mobile messaging error', error),
);
mobileMessaging.registerForAndroidRemoteNotifications()
}
Hi @aitdigitaltechnology where are you setup configuration
looks like the error is connected with the way of how you setting it.
Hi @riskpp the configuration is in the same code with init:
const configuration = {
applicationCode: "xxxxxxxxxxxxxxxxxxxxx",
ios: {
notificationTypes: ['alert', 'badge', 'sound'],
logging: true,
},
defaultMessageStorage: true,
inAppChatEnabled: true,
geofencingEnabled: false,
};
Anything wrong here?
May be try to remove const
, the error says that configuration object is immutable.
Hi @riskpp you are right, no more crashes! thanks a lot!!!
Great to hear, closing issue then
We integrated SDK Mobile Messaging SDK version 7.0.3 and getting this error: "Error: You attempted to set the key
reactNativePluginVersion
with the value"7.0.3"
on an object that is meant to be immutable and has been frozen." According to this releases document: https://github.com/infobip/mobile-messaging-react-native-plugin/releases, looks like some crash issues on Android 12 has been resolved in SDK version 8.0.0, we remove the SDK version 7.0.3, cleaned the code and re-integrated with SDK version 8.0.0 but getting the same issue: "Error: You attempted to set the keyreactNativePluginVersion
with the value"8.0.0"
on an object that is meant to be immutable and has been frozen."Anyone can help us on this?