Pushwoosh
Main entry point for the Pushwoosh SDK.
Pushwoosh is a customer engagement platform that helps you turn user data into high-converting omnichannel campaigns. Build personalized customer journeys using advanced segmentation, behavior tracking, and automated messaging across push notifications, email, SMS, and WhatsApp.
Key Features:
- Push Notifications - Send rich push notifications with images, actions, and deep links
- User Segmentation - Tag users and create targeted campaigns based on behavior and preferences
- Cross-Device Tracking - Track users across multiple devices using User ID
- Local Notifications - Schedule notifications to be shown at specific times
- In-App Messages - Display rich in-app content to engaged users
- Analytics - Track push delivery, opens, and user engagement
- Multichannel Campaigns - Send messages via push, email, SMS, and WhatsApp
Quick Start:
// 1. Get Pushwoosh instance (available after SDK initialization)
Pushwoosh pushwoosh = Pushwoosh.getInstance();
// 2. Register for push notifications
pushwoosh.registerForPushNotifications((result) -> {
if (result.isSuccess()) {
Log.d("App", "Push registered: " + result.getData().getToken());
} else {
Log.e("App", "Registration failed: " + result.getException());
}
});
// 3. Set user tags for targeting
TagsBundle tags = new TagsBundle.Builder()
.putString("Name", "John Doe")
.putInt("Age", 25)
.putString("Subscription", "premium")
.build();
pushwoosh.setTags(tags);
// 4. Set user ID for cross-device tracking
pushwoosh.setUserId("user_12345");
Content copied to clipboard
Important Notes:
- Always call getInstance to access the SDK instance
- On Android 13+, request notification permission before registration using requestNotificationPermission
- Set user tags to enable targeted campaigns and personalization
- Use setUserId to track users across multiple devices
- Handle push notifications using getLaunchNotification for deep linking
See also
Properties
Link copied to clipboard
Maximum number of notifications returned by getPushHistory
Link copied to clipboard
Intent extra key for push notification payload.
Functions
Link copied to clipboard
Adds an alternative Pushwoosh application code for device registration.
Link copied to clipboard
Clears the launch notification data.
Link copied to clipboard
Clears the push notification history.
Link copied to clipboard
Enables Huawei Push Kit for push notifications on Huawei devices.
Link copied to clipboard
Returns the current Pushwoosh application code.
Link copied to clipboard
Returns the shared instance of Pushwoosh SDK.
Link copied to clipboard
Returns the current language code used for push notification localization.
Link copied to clipboard
Returns the push notification that launched the application.
Link copied to clipboard
Returns the push notification history.
Link copied to clipboard
Returns the current push notification token.
Link copied to clipboard
Returns the current GCM/FCM sender ID.
Link copied to clipboard
Gets tags associated with current device Example:
// Retrieve and use user profile tags to personalize UI
private void loadUserProfile() {
Pushwoosh.getInstance().getTags((result) -> {
if (result.isSuccess()) {
TagsBundle tags = result.getData();
// Read user profile data
String userName = tags.getString("Name", "Guest");
int userAge = tags.getInt("Age", 0);
String subscriptionTier = tags.getString("Subscription_Tier", "free");
boolean isPremium = "premium".equals(subscriptionTier);
// Update UI based on tags
updateWelcomeMessage("Welcome back, " + userName + "!");
if (isPremium) {
showPremiumFeatures();
} else {
showUpgradePrompt();
}
// Check user preferences
List<String> interests = tags.getStringList("Interests");
if (interests != null && !interests.isEmpty()) {
showPersonalizedContent(interests);
}
Log.d("App", "User profile loaded: " + userName + ", tier: " + subscriptionTier);
} else {
Log.e("App", "Failed to retrieve tags: " + result.getException().getMessage());
// Show default UI
showDefaultContent();
}
});
}
Content copied to clipboard
Link copied to clipboard
Checks if communication with Pushwoosh server is currently allowed.
Link copied to clipboard
open fun mergeUserId(oldUserId: String, newUserId: String, doMerge: Boolean, callback: Callback<Void, MergeUserException>)
Merges or removes event statistics for a user identifier.
Link copied to clipboard
open fun registerExistingToken(token: String, callback: Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>)
Registers the device using an existing FCM/GCM token.
Link copied to clipboard
Registers the device for push notifications without a callback.
open fun registerForPushNotifications(callback: Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>)
Registers the device for push notifications with a callback.
Link copied to clipboard
open fun registerForPushNotificationsWithoutPermission(callback: Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>)
Registers the device for push notifications without requesting notification permission.
Link copied to clipboard
open fun registerForPushNotificationsWithTags(callback: Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>, tags: TagsBundle)
Registers the device for push notifications and sets tags in a single request.
Link copied to clipboard
open fun registerForPushNotificationsWithTagsWithoutPermission(callback: Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>, tagsBundle: TagsBundle)
Registers the device for push notifications with tags without requesting notification permission.
Link copied to clipboard
Registers an SMS number for the current user.
Link copied to clipboard
Registers a WhatsApp number for the current user.
Link copied to clipboard
Requests notification permission from the user.
Link copied to clipboard
Removes all alternative application codes previously added via addAlternativeAppCode.
Link copied to clipboard
Schedules local notification.
Link copied to clipboard
Sends an application open event to Pushwoosh.
Link copied to clipboard
Sends in-app purchase statistics to Pushwoosh.
Link copied to clipboard
Sets the list of allowed external hosts for secure push content.
Link copied to clipboard
Sets the API access token for Pushwoosh REST API calls.
Link copied to clipboard
Registers a single email address for the current user without a callback.
Registers a list of email addresses for the current user without a callback.
Registers a single email address for the current user with a callback.
Registers a list of email addresses for the current user with a callback.
Link copied to clipboard
open fun setEmailTags(emailTags: TagsBundle, email: String, callback: Callback<Void, PushwooshException>)
Associates device with given email tags.
Link copied to clipboard
Sets a custom application language for push notification localization.
Link copied to clipboard
Sets the FCM/GCM sender ID for push notifications.
Link copied to clipboard
Controls whether push notifications should be displayed when the app is in foreground.
Link copied to clipboard
Associates device with given tags.
Link copied to clipboard
Starts communication with the Pushwoosh server.
Link copied to clipboard
Stops communication with the Pushwoosh server.
Link copied to clipboard
Unregisters the device from push notifications without a callback.
open fun unregisterForPushNotifications(callback: Callback<String, UnregisterForPushNotificationException>)
Unregisters the device from push notifications with a callback.