RegisterForPushNotificationsResultData

Result data returned after successful push notification registration.

This class contains the push token and notification permission status received when registering the device for push notifications via registerForPushNotifications. The data is provided in the success callback and can be used to verify registration status and retrieve the push token for server-side operations.

Usage Example:


Pushwoosh.getInstance().registerForPushNotifications((result) -> {
    if (result.isSuccess()) {
        RegisterForPushNotificationsResultData data = result.getData();

        // Get the push token
        String pushToken = data.getToken();
        Log.d("App", "Push token: " + pushToken);

        // Check if notifications are enabled
        boolean notificationsEnabled = data.isEnabled();
        if (notificationsEnabled) {
            Log.d("App", "User has granted notification permission");
        } else {
            Log.w("App", "Notifications are disabled by user");
            showEnableNotificationsPrompt();
        }

        // Send token to your backend server
        sendTokenToServer(pushToken);
    }
});

See also

Constructors

Link copied to clipboard
constructor(token: String, enabled: Boolean)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun isEnabled(): Boolean
Returns whether push notifications are currently enabled for this app.