How do I handle Google services related errors on Android during initialization - infobip/mobile-messaging-react-native-plugin GitHub Wiki

SDK provides a method which you can call to display a system dialog which will help users resolve such issues. You will need to handle an error code provided by the library when initialization fails.

mobileMessaging.init({
    ...
    },
    () => {
        console.log('Init success');
    },
    error => {
        console.log('Init error', JSON.stringify(error));
        if (error.code) {
            displayErrorDialog(error.code);
        }
    }
);

function displayErrorDialog(errorCode) {
    mobileMessaging.showDialogForError(
        errorCode,
        () => {
          console.log("The issue was resolved by user");
          // re-init SDK
        },
        error => {
          console.log('User failed to resolve the issue', JSON.stringify(error));
        }
    );
}
...