-
Notifications
You must be signed in to change notification settings - Fork 12
How do I handle Google services related errors on Android during initialization
Željko Brcković edited this page May 17, 2023
·
2 revisions
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(
{ ... },
function (error) {
console.log('Init error: ' + error.description);
if (error.code) {
displayErrorDialog(error.code);
}
}
);
function displayErrorDialog(errorCode) {
MobileMessaging.showDialogForError(errorCode, function () {
console.log('The issue was resolved by user');
// re-init SDK
}, function (error) {
console.log('User failed to resolve the issue: " + error.description);
});
};
...expand to see Ionic code
MobileMessaging.init(
{ ... },
function (error) {
console.log('Init error: ' + error.description);
if (error.code) {
displayErrorDialog(error.code);
}
}
);
function displayErrorDialog(errorCode) {
MobileMessaging.showDialogForError(errorCode).then(function () {
console.log("The issue was resolved by user");
// re-init SDK
}, function(error) {
console.log("User failed to resolve the issue: " + error.description);
});
};
...If you have any questions or suggestions, feel free to send an email to [email protected] or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
GeofencingDEPRECATED- Privacy settings
- In-app chat
- Migration guides
- Migration guide to version 7.9.x
- Migration guide to version 7.x.x
- Migration guide to version 6.2.x
- Migration guide to version 6.1.x
- Migration guide to version 6.x.x
- Migration guide to version 1.x.x
- Migration guide to version 2.2.x
- Migration guide to version 3.x.x
- Migration guide to version 4.x.x
- Migration guide to version 4.1.x
- Troubleshooting
- JSON Web Token (JWT) structure and generation example
- Trusted Domains Security