-
Notifications
You must be signed in to change notification settings - Fork 16
Privacy settings
MobileMessaging SDK has several options to provide different levels of users' privacy for your application. The settings, enabled by default, are available through MobileMessaging.Builder
class and may be modified as follows:
MobileMessaging.Builder(application)
.withoutCarrierInfo()
.withoutSystemInfo()
.withoutStoringUserData()
.withoutStoringApplicationCode(MyApplicationCodeProvider())
.withDisplayNotification(NotificationSettings.Builder(application)
.withoutModalInAppNotifications()
.build())
expand to see Java code
new MobileMessaging.Builder(getApplication())
.withoutCarrierInfo()
.withoutSystemInfo()
.withoutStoringUserData()
.withoutStoringApplicationCode(new MyApplicationCodeProvider())
.withDisplayNotification(new NotificationSettings.Builder(application)
.withoutModalInAppNotifications()
.build())
/**
* Implementation of ApplicationCodeProvider interface in a class separate from the Activity
*/
class MyApplicationCodeProvider : ApplicationCodeProvider {
override fun resolve(): String {
// TODO fetch app code synchronously - no need for async API, code is already executed in a background thread
return "some_app_code"
}
}
expand to see Java code
/**
* Implementation of ApplicationCodeProvider interface in a class separate from the Activity
*/
public class MyApplicationCodeProvider implements ApplicationCodeProvider {
@Override
public String resolve() {
// TODO fetch app code synchronously - no need for async API, code is already executed in a background thread
return "some_app_code";
}
}
-
withoutCarrierInfo()
: Method to opt-out of sending the carrier information to the server by MobileMessaging SDK. Default value isfalse
. -
withoutSystemInfo()
: Method to opt-out of sending the system information such as OS version, device model, application version to the server by MobileMessaging SDK. Default value isfalse
. -
withoutStoringUserData()
: Method to opt-out of storing the User Data locally. Persisting user data locally gives you quick access to the data and eliminates a need to implement the persistent storage yourself. Default value isfalse
. -
withoutStoringApplicationCode(ApplicationCodeProvider)
: Method to opt-out of storing application code locally (on disk) by MobileMessaging SDK. Use it when you want to take more care about privacy and don't want to store Application code in infobip_application_code string resource nor in our persistent storage, but would like to use it only from memory. In this case, you should provide it on demand. For example, you should implement sync API call to your server where you store required Application code and provide it toApplicationCodeProvider.resolve()
method as a return type. Sync (not async) API call should be used because we already handle your code in a background thread.There might be situation when you want to switch between different Application Codes during development/testing. If you disable storing of Application Code, the SDK won't detect the Application Code changes, thus won't cleanup the old Application Code related data. You should manually invoke
MobileMessaging.getInstance(Context).cleanup();
prior to start otherwise the SDK would not detect the Application Code change. -
withPrivateSharedPrefs()
: Deprecated at 6.0.0 version, all data saved to private preferences by default.This method was introduced at 2.2.0 library version, switching from using this library version with private shared prefs back to MM SDK version < 2.2.0 is not backwards compatible since older SDK versions use just public prefs by default (and by using this method only private prefs are maintained)
-
NotificationSettings.Builder(this).withoutModalInAppNotifications().build()
: Method to disable displaying of Mirror push notifications and In-App messages. Since 9.0.0-rc version of SDK, Javascript is enabled for the webView for In-App messages' proper work, so you may disable In-Apps by calling this method.
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
Geofencing API- DEPRECATED- Android Manifest components
- Privacy settings
- In-app chat
- Infobip RTC calls and UI
- Backup rules