exponea / exponea-react-native-sdk

MIT License
6 stars 13 forks source link

App state inactive removes apple_push_notification_id #122

Closed radekzz closed 2 days ago

radekzz commented 1 month ago

Hi, i have an issue with disappearing apple_push_notification_id value, when user swipe down the system toolbar on iOS. It sets the app state to inactive and immediatelly remove apple_push_notification_id value from BR customer. We do not have any logic based on app state that could be removing or refreshing these data.

This is how we send token which works fine, i see the token in customer, but when i set app to inactive state, it disappears without any message.

Exponea.requestPushAuthorization()
        .then((result) => {
          if (DeviceInfo.getSystemName() === 'iOS' && token) {
            Logger.log(`Bloomreach: Setting user push token: ${result}`);
            Exponea.identifyCustomer({ email: userEmail }, { apple_push_notification_id: token }).catch((error) =>
              Logger.error('Bloomreach: Error setting user push token:', error)
            );
          } else {
            Logger.log('Bloomreach: Unable to set token - token is empty OR platform is not iOS');
          }
        })
        .catch((error) =>
          Logger.error(Bloomreach: Result requesting push authorization`, JSON.stringify(error))
        );

"react-native": "0.72.4", "react-native-exponea-sdk": "1.8.0"

roland-misica commented 3 weeks ago

Hi, thanks for reporting the issue. Unfortunately, we are unable to reproduce it. Can you provide us with steps to reproduce it? Can you reproduce it using an example app inside repository?

Regards