API Reference — IPulsateManager

Generated from SDK 4.8.4 source. PulsateFactory.getInstance() returns IPulsateManager, which exposes everything below.

val pulsateManager: IPulsateManager = PulsateFactory.getInstance()

PulsateFactory

MethodReturnsNotes
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).

Sessions

MethodDescription
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)

User data

MethodDescription
updateFirstName(String) / updateLastName(String)Synced on background
updateEmail(String)Synced on background
updatePhoneNumber(String)E.164 format
updateGender(PulsateGender)MALE / FEMALE
updateAge(String)Age as string, e.g. "30"
setPrivacy(PulsatePrivacy)SUBSCRIBE / UNSUBSCRIBE, real-time sync
getPrivacy(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

Feed / Inbox

MethodDescription
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

In-app notifications

MethodDescription
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

Push / FCM

MethodDescription
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)

Location

MethodDescription
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

Configuration flags (PulsateConfig)

Set in Application.onCreate():

FlagDefaultDescription
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

Listener interfaces

InterfaceCallbacksThread
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): Booleantrue = 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.

Types

  • PulsateAuthData(mAppId: String, mAppKey: String) — 64-char credentials
  • PulsateGenderMALE, FEMALE
  • PulsatePrivacySUBSCRIBE, UNSUBSCRIBE
  • PulsateError(type: String, message: String, exception: Exception?)