Generated from SDK 4.8.4 source. PulsateFactory.getInstance() returns IPulsateManager, which exposes everything below.
Kotlin
val pulsateManager: IPulsateManager = PulsateFactory.getInstance()
Method Returns Notes getInstance()IPulsateManagerUses credentials from AndroidManifest.xml meta-data (PulsateAppId, PulsateAppKey) getInstance(authData: PulsateAuthData)IPulsateManager?Returns null if either credential is empty or contains spaces
PulsateAuthData(mAppId, mAppKey) — both must be exactly 64 characters (throws otherwise).
Method Description setAuthorizationData(authData)Set/replace credentials at runtime startPulsateSessionForAlias(alias, listener?)Start the first session for a user. Requires a visible Activity — never call from Application.onCreate() logoutCurrentAlias(listener?)Detach device from user ("soft delete") — disables all Pulsate features until the next startPulsateSessionForAlias userHasLoggedIn()Enable in-apps, show last bounced in-app, authorize user, replay last blocked inbox action userHasLoggedOut()Disable in-apps, deauthorize user (pushes keep working) setPulsateErrorListener(listener)Global SDK error callback (Error Handling )
Method Description updateFirstName(String) / updateLastName(String)Synced on background updateEmail(String)Synced on background updatePhoneNumber(String)E.164 format updateGender(PulsateGender)MALE / FEMALEupdateAge(String)Age as string, e.g. "30" setPrivacy(PulsatePrivacy)SUBSCRIBE / UNSUBSCRIBE, real-time syncgetPrivacy(listener) / suspend getPrivacy()Current privacy value createAttribute(name, value)Overloads: String, Int, Float, Boolean, java.util.Date createEvent(String) / createEvents(List<String>)Custom events incrementCounter(name, value) / decrementCounter(name, value)Integer counters, start at 0 forceAttributeSync()Debounced immediate sync of pending user data
Method Description showFeed(listener?)Open the Inbox; IPulsateFeedListener.onFeedClose() fires when the user leaves getFeedUnreadCount(listener)Unread count (30-second debounce) setUserAuthorized(Boolean)Allow/block Inbox access (default: authorized) isUserAuthorized(listener)Current authorization state setUserUnauthorizedListener(listener?)Fires when a blocked user attempts an inbox action showLastUnauthorizedMessage()Replay the last blocked inbox action
Method Description setInAppNotificationEnabled(Boolean)Per-alias enable/disable (default: enabled) isInAppNotificationEnabled(listener: IPulsateValueListener<Boolean>?)Current state setSmallInAppNotificationDuration(seconds)Default 12 s getSmallInAppNotificationDuration(listener)Current duration showLastInAppNotification()Show last blocked in-app (works even while disabled) reshowLastInApp()Repeat the last shown in-app
Method Description onMessageReceived(remoteMessage): BooleanForward FCM payloads; true = Pulsate handled it onNewToken(token)Forward FCM token refreshes setPushNotificationEnabled(Boolean)Per-user Pulsate push opt-in/out (default: enabled) isPushNotificationEnabled(listener) / suspend isPushNotificationEnabled()Current state setBadgeUpdateListener(listener?)Badge count callbacks (inbox exit, session start, push received)
Method Description setLocationUpdatesEnabled(Boolean)Geofencing opt-in/out (default: enabled) isLocationUpdatesEnabled(listener) / suspend isLocationUpdatesEnabled()Current state getLastKnownLocation(listener)Last known android.location.Location setGeofenceListener(listener?)Raw GeofencingEvent enter/dwell/exit callbacks
Set in Application.onCreate():
Flag Default Description NOTIFICATION_CHANNEL_SHOW_BADGEStrueLauncher badge on the notification channel (channel is created once — reinstall to change) NOTIFICATION_USE_LARGE_ICONfalseShow large icon on push notifications
Interface Callbacks Thread IPulsateRequestListeneronSuccess(), onError(Throwable?)Main IPulsateValueListener<T>onSuccess(T), onError(Throwable)Main IPulsateFeedListeneronFeedClose()Main IPulsateBadgeUpdateListeneronBadgeUpdate(Int): Int — return the count to applyNot guaranteed IPulsateUserUnauthorizedListeneronUnauthorizedAction()Main IPulsateErrorListeneronError(PulsateError)Not guaranteed IPulsateGeofenceListeneronTrigger(GeofencingEvent?)Not guaranteed IPulsateLinkListeneronLinkTrigger(String): Boolean — true = you handled the linkMain (UI context)
The "Main" listeners are dispatched via their ...MainThread() default helpers (Dispatchers.Main), so the onSuccess/onError you override run on the main thread and may touch UI directly. For the "Not guaranteed" group, dispatch to the main thread yourself before touching UI. See Error Handling .
PulsateAuthData(mAppId: String, mAppKey: String) — 64-char credentials
PulsateGender — MALE, FEMALE
PulsatePrivacy — SUBSCRIBE, UNSUBSCRIBE
PulsateError(type: String, message: String, exception: Exception?)