With each new release of Android, SAS proactively researches and identifies behavior changes that might impact organizations who use SAS Customer Intelligence 360. In anticipation of the release of Android 12, here are some behavior changes that mobile apps that target Android 12 should be aware of.
Restrictions Imposed on Notification Trampolines
IMPORTANT If you are targeting an early release of Android 12 (specifically, Android 12 API Level S), you must use version 21.08 or later of the mobile SDK. Specific code changes are required to avoid disruption to URI or deep link-driven push notifications. If you use an earlier mobile SDK release, when a user taps the notification to launch the mobile app, there will be no response.
As a result of changes to Android 12, when a push notification is received, your mobile app developer must now provide the mobile SDK with a desired Android Activity Intent to be launched when the push notification is opened. The mobile app developer will use the notification URI to determine the correct Intent. Here is an example:
SASCollector.getInstance().setMobileMessagingDelegate2(
new SASMobileMessagingDelegate2() {
@Override
public void dismissed() {
//The user has dismissed an in-app message
}
@Override
public void action(String link, SASMobileMessageType type) {
// The type parameter is SASMobileMessageType.IN_APP_MESSAGE.
// The user clicked one of the actions in the in-app message.
// The String parameter is the notification URI that is specified
// in the definition of the creative in SAS Customer Intelligence
// 360.
}
@Override
public Intent getNotificationIntent(String link) {
// The FCM message that is given to the mobile SDK contains a push
// notification.
// The app must provide an Intent to handle if and when the user
// opens the notification.
// The Intent must launch an Activity.
// The String parameter is the notification URI that is specified
// in the definition of the creative in SAS Customer Intelligence
// 360.
Intent intent = new Intent(myContext, DeepLinkActivity.class);
// This is an example of how to send the link to your Activity.
intent.putExtra("my_deep_link", link);
return intent;
}
});
Access to Location Information
To enable location-based features that support geofencing and beacon capabilities, in addition to declaring these permissions in your mobile app's manifest file, your mobile app developer must request ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION run-time permissions. Previously, only FINE permission was needed. Here is an example:
String[] permissions = {
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION
};
activity.requestPermissions(permissions, MY_REQUEST_CODE);
Restrictions Imposed by Low App Usage
A new app standby bucket called Restricted is added in Android 12. Because it reflects the lowest level of app usage on a device, the restricted bucket has the highest restrictions of all the standby buckets. If your mobile app is placed in the restricted bucket, there are limitations on how many Firebase Cloud Messaging (FCM) messages the device can receive per day. The result is that there can be delays in the receipt of push notifications on that device.
Limitations Imposed by App Hibernation
Unused app hibernation is an extension of a feature delivered in Android 11. Beginning with Android 11, if a user does not interact with the mobile app for a period of time (Android documentation specifies "a few months"), the system removes permissions for that app, putting the app in a hibernation state. With mobile apps that target Android 12, not only are permissions revoked, but temporary files are cleared to free up storage space.
While in hibernation, the app cannot receive push notifications that are created in SAS Customer Intelligence 360 and sent through the Firebase Cloud Messaging service. When the user interacts with the mobile app again, push notification activity resumes.
To prevent disruption of push notification delivery to infrequent mobile app users, consider requesting that the user grant an exception from hibernation and permissions auto-reset.
For Android's summary of the updates in Android 12, see Behavior changes: Apps targeting Android 12.