Speedify SDK for Android
15.0.0
|
The main processing and VPN service of the Speedify SDK is done in an Android foreground service running in a background process. Starting with Android Oreo, foreground services are required to have a notification visible at all times. Prior to Oreo it is still recommened to have this notification so that the OS knows that the service is important, and that it should not be killed in low memory situations.
As of Android 13, POST_NOTIFICATIONS
permission is required to show the foreground service notification.
The default SpeedifyHandler provided by the Speedify SDK implements a notification for the foreground service, complete with connect, disconnect, and exit controls.
The text of this notification is customizable via the default service notification resource strings outlined in SDK Strings.
The default icon used is drawable resource named speedify_notification_icon
. This can be overridden via setServiceNotificationIcon.
The default click action is to launch the main launcher intent of the application, as returned by PackageManager.getLaunchIntentForPackage. This can be overridden via setServiceNotificationLaunchIntent.
If you want to completely customize the notification, you can override UpdateForegroundNotification and HideForegroundNotification in SpeedifyHandler, and provide your own notification. You must also use a notification ID of SpeedifyHandler.SPEEDIFY_FOREGROUND_NOTIFICATION_ID to replace the temporary minimal foreground notification that is generated to avoid ANRs. The notification channel used is SpeedifyHandler.SPEEDIFY_FOREGROUND_CHANNEL_ID.
NOTE : UpdateForegroundNotification and HideForegroundNotification are called from the background process. You will not be able to access objects running in your UI process.