public interface ZendriveNotificationProvider
Zendrive.setup(android.content.Context, com.zendrive.sdk.ZendriveConfiguration, java.lang.Class<? extends com.zendrive.sdk.ZendriveBroadcastReceiver>, java.lang.Class<? extends com.zendrive.sdk.ZendriveNotificationProvider>, com.zendrive.sdk.ZendriveOperationCallback)
method.
The implementing subclass must provide a default constructor.
This class should only construct and return notifications required by the Zendrive SDK. It should not do any computationally intensive work as doing so may result in an ANR.
The SDK uses this class to fetch ZendriveNotificationContainer
objects that contain
notifications that are displayed when the SDK goes into foreground mode.
Modifier and Type | Method and Description |
---|---|
ZendriveNotificationContainer |
getInDriveNotificationContainer(Context context)
Fetches a notification that is displayed when the SDK detects that the user is driving.
|
ZendriveNotificationContainer |
getMaybeInDriveNotificationContainer(Context context)
Fetches a notification that is displayed when the SDK detects a possible drive.
|
ZendriveNotificationContainer |
getWaitingForDriveNotificationContainer(Context context)
Experimental forward-looking feature to improve trip detection on low-end devices with
aggressive app-killing practices.
|
@Nullable ZendriveNotificationContainer getWaitingForDriveNotificationContainer(@NonNull Context context)
Fetches a notification that is displayed when the SDK is waiting for a drive, called only on devices manufactured by Huawei.
Providing this notification will improve drive detection on Huawei devices. If null is returned from this method, drives may not be detected on Huawei devices. If it is provided, it will be displayed when the SDK is setup and waiting for the user to start driving.
The notification will not be displayed on other devices, such as Samsung and Pixel devices.
This notification may be displayed multiple times. The application should use setOnlyAlertOnce(boolean) while building the notification to ensure the user is alerted only once.
In future versions of the SDK, this notification may be displayed on more devices depending on the OEMs to improve drive detection.
context
- The context used to construct the notification.ZendriveNotificationContainer
object that contains the notification to be
displayed.@RequiresApi(value=26) @NonNull ZendriveNotificationContainer getMaybeInDriveNotificationContainer(@NonNull Context context)
This method is only called on devices running Android O.
This notification may be displayed multiple times. The application should use setOnlyAlertOnce(boolean) while building the notification to ensure the user is alerted only once.
context
- The context used to construct the notification.ZendriveNotificationContainer
object that contains the notification to be
displayed.@NonNull ZendriveNotificationContainer getInDriveNotificationContainer(@NonNull Context context)
This notification may be displayed multiple times. The application should use setOnlyAlertOnce(boolean) while building the notification to ensure the user is alerted only once.
context
- The context used to construct the notification.ZendriveNotificationContainer
object that contains the notification to be
displayed.