-
- All Implemented Interfaces:
-
com.clevertap.android.sdk.pushnotification.CTPushProviderListener
@RestrictTo(value = Scope.LIBRARY_GROUP) public class PushProviders implements CTPushProviderListener
-
-
Field Summary
Fields Modifier and Type Field Description private final ObjectpushRenderingLock
-
Method Summary
Modifier and Type Method Description ObjectgetPushRenderingLock()static PushProvidersload(Context context, CleverTapInstanceConfig config, BaseDatabaseManager baseDatabaseManager, ValidationResultStack validationResultStack, AnalyticsManager analyticsManager, ControllerManager controllerManager, CTWorkManager ctWorkManager)Factory method to load push providers. void_createNotification(Context context, Bundle extras, int notificationId)Launches an asynchronous task to download the notification icon from CleverTap,and create the Android notification. voidcacheToken(String token, PushType pushType)Saves token for a push type into shared pref voiddoTokenRefresh(String token, PushType pushType)voidforcePushDeviceToken(boolean register)push the device token outside of the normal course ArrayList<PushType>getAvailablePushTypes()StringgetCachedToken(PushType pushType)CleverTapAPI.DevicePushTokenRefreshListenergetDevicePushTokenRefreshListener()voidsetDevicePushTokenRefreshListener(CleverTapAPI.DevicePushTokenRefreshListener tokenRefreshListener)voidhandleToken(String token, PushType pushType, boolean register)Direct Method to send tokens to Clevertap's serverCall this method when Clients are handling the Messaging services on their own booleanisNotificationSupported()voidonNewToken(String freshToken, PushType pushType)voidonTokenRefresh()voidprocessCustomPushNotification(Bundle extras)Stores silent push notification in DB for smooth working of Pull NotificationsBackground Job Service and also stores wzrk_pid to the DB to avoid duplication of PushNotifications from Pull Notifications. voidunregisterToken(String token, PushType pushType)Unregister the token for a push type from Clevertap's server.Devices with unregistered token wont be reachable. voidupdatePingFrequencyIfNeeded(Context context, int frequency)updates the ping frequency if there is a change & reschedules existing ping tasks. voidrunPushAmpWork(Context context)voidaddPushService(PushType pushType)Adds new push provider similar to FCM INotificationRenderergetPushNotificationRenderer()voidsetPushNotificationRenderer(@NonNull() INotificationRenderer iNotificationRenderer)-
-
Method Detail
-
getPushRenderingLock
@RestrictTo(value = Scope.LIBRARY)@NonNull() Object getPushRenderingLock()
-
load
@NonNull() static PushProviders load(Context context, CleverTapInstanceConfig config, BaseDatabaseManager baseDatabaseManager, ValidationResultStack validationResultStack, AnalyticsManager analyticsManager, ControllerManager controllerManager, CTWorkManager ctWorkManager)
Factory method to load push providers.
-
_createNotification
void _createNotification(Context context, Bundle extras, int notificationId)
Launches an asynchronous task to download the notification icon from CleverTap,and create the Android notification.
If your app is using CleverTap SDK's built in FCM message handling,this method does not need to be called explicitly.Use this method when implementing your own FCM handling mechanism. Refer to theSDK documentation for usage scenarios and examples.- Parameters:
context- A reference to an Android contextextras- The Bundle object received by the broadcast receivernotificationId- A custom id to build a notification
-
cacheToken
void cacheToken(String token, PushType pushType)
Saves token for a push type into shared pref
- Parameters:
token- - Messaging tokenpushType- - Pushtype, RefPushType
-
doTokenRefresh
@RestrictTo(value = Scope.LIBRARY_GROUP) void doTokenRefresh(String token, PushType pushType)
-
forcePushDeviceToken
@RestrictTo(value = Scope.LIBRARY) void forcePushDeviceToken(boolean register)
push the device token outside of the normal course
-
getAvailablePushTypes
@NonNull() ArrayList<PushType> getAvailablePushTypes()
-
getCachedToken
String getCachedToken(PushType pushType)
- Parameters:
pushType- - Pushtype PushType
-
getDevicePushTokenRefreshListener
CleverTapAPI.DevicePushTokenRefreshListener getDevicePushTokenRefreshListener()
-
setDevicePushTokenRefreshListener
void setDevicePushTokenRefreshListener(CleverTapAPI.DevicePushTokenRefreshListener tokenRefreshListener)
-
handleToken
void handleToken(String token, PushType pushType, boolean register)
Direct Method to send tokens to Clevertap's serverCall this method when Clients are handling the Messaging services on their own
- Parameters:
token- - Messaging tokenpushType- - Pushtype, Ref:PushTyperegister- - true if we want to register the token to CT serverfalse if we want to unregister the token from CT server
-
isNotificationSupported
boolean isNotificationSupported()
-
onNewToken
void onNewToken(String freshToken, PushType pushType)
-
onTokenRefresh
void onTokenRefresh()
-
processCustomPushNotification
void processCustomPushNotification(Bundle extras)
Stores silent push notification in DB for smooth working of Pull NotificationsBackground Job Service and also stores wzrk_pid to the DB to avoid duplication of PushNotifications from Pull Notifications.
- Parameters:
extras- - Bundle
-
unregisterToken
void unregisterToken(String token, PushType pushType)
Unregister the token for a push type from Clevertap's server.Devices with unregistered token wont be reachable.
- Parameters:
token- - Messaging tokenpushType- - pushtype Ref:PushType
-
updatePingFrequencyIfNeeded
void updatePingFrequencyIfNeeded(Context context, int frequency)
updates the ping frequency if there is a change & reschedules existing ping tasks.
-
runPushAmpWork
void runPushAmpWork(Context context)
-
addPushService
void addPushService(PushType pushType)
Adds new push provider similar to FCM
-
getPushNotificationRenderer
@RestrictTo(value = Scope.LIBRARY)@NonNull() INotificationRenderer getPushNotificationRenderer()
-
setPushNotificationRenderer
@RestrictTo(value = Scope.LIBRARY) void setPushNotificationRenderer(@NonNull() INotificationRenderer iNotificationRenderer)
-
-
-
-