Fairmatic Notification Provider
An instance of this is passed to the Fairmatic SDK in the com.fairmatic.sdk.Fairmatic.setup method. The implementing subclass must provide a default constructor.
This class should only construct and return notifications required by the Fairmatic SDK. It should not do any computationally intensive work as doing so may result in an ANR.
The SDK uses this class to fetch FairmaticNotificationContainer objects that contain notifications that are displayed when the SDK goes into foreground mode.
Functions
Fetches a notification that is displayed when the SDK detects that the user is driving. This notification may be displayed multiple times. The application should use setOnlyAlertOnce(boolean) (https://developer.android.com/reference/android/app/Notification.Builder#setOnlyAlertOnce(boolean)) while building the notification to ensure the user is alerted only once.
Fetches a notification that is displayed when the SDK detects a possible drive. This method is only called on devices running Android O.
Experimental forward-looking feature to improve trip detection on low-end devices with aggressive app-killing practices. 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.