Skip to main content

Preferences

Introduction

The Preferences Service enables developers to fetch all user-defined and marketing preferences as well as a way to update them.

Key Features:

  • Offers a way to fetch all user-defined and marketing preferences.
  • Supports a way to update the user-defined and marketing preferences.

Prerequisites

Before integrating the Preferences Service, ensure you have:

  • A valid Paysafe account with appropriate permissions.
  • Set up instructions for Paysafe SDK Android or iOS.

To get started, initialize the PreferencesService instance in your app as shown below:

import com.paysafe.wallet.android.core.wallet.Wallet

val preferencesService = Wallet.getInstance().getPreferencesService()

Functionalities

Get Preferences

Use get method to retrieve the user-defined and marketing Preferences.


val preferences = preferencesService.get()

Update Preferences

Use the update method to update the user-defined and marketing preferences by providing a Preferences object.

val updatedPreferences = Preferences(
marketing = MarketingPreferences(
receivePushNotifications = true,
receiveMarketingEmails = true,
receiveMarketingSms = true,
receiveSocialAds = false,
receiveTargetedAds = false,
receiveThirdPartyAds = false,
),
data = DataPreferences(
consentForTargetedAds = true,
consentForAnalytics = false,
consentForPerformanceTracking = true
)
)
val preferences = preferencesService.update(preferences: updatedPreferences)