Troubleshoot Initialization Errors on Android
The troubleshooting steps for initialization errors vary depending on the version of the Salesforce Engagement SDK you use.
The InitializationStatus is provided via the InitializationListener passed into the call to the SFMCSdk’s configure method.
The InitializationStatus is provided via the InitializationListener passed into the call to the SDK’s init method. While this class contains extensive information that can help troubleshoot SDK initialization issues, there are only a limited number of things that you can address at runtime.
This section describes the methods from InitializationStatus that are useful to check at runtime and how you can recover from them. The InitializationStatus is provided via the InitializationListener passed into the call to the SFMC SDK’s configure method.
status()The
status()method returns the status of the initialization call.locationsError()If you've configured the SDK to enable either geofence or proximity messaging,
locationsError()indicates whether the SDK encountered an issue with the Google Play Service location library. Additionally, you can also useplayServicesMessage()andplayServicesStatus()to determine the exact action that you must take to resolve this issue. However, the most likely issue is that the device doesn't have a compatible version of Google Play Services installed and you must prompt the user to perform an update.messagingPermissionError()messagingPermissionError()indicates that region messaging was unable to be turned on after a restart due to theandroid.Manifest.permission.ACCESS_FINE_LOCATIONorandroid.Manifest.permission.ACCESS_BACKGROUND_LOCATIONno longer being granted. Enablinggeofenceorproximitymessaging requires you to request the runtime permission for location. Then, after you've called the corresponding messaging enablement method (enableGeofenceMessagingorenableProximityMessaging), the SDK will track this setting and check whether the permission is still granted during each initialization. If the user has revoked the location permission from your application, the SDK disables the previously enabled messaging type and requires you to re-request the permission from the user, and re-enable messaging in the SDK.