Skip to main content

Preferences

Introduction

The Preferences service enables users to view their preferences, offering a straightforward way to understand the settings related to tracking and promotional communications. These preferences are organized into distinct categories:

  • Data Preferences: Manage and track the user consent for tracking, ensuring compliance with privacy regulations while enabling personalized experiences.
  • Marketing Preferences: Manage and track user consent for receiving promotional communications, ensuring targeted outreach while respecting user choices and privacy regulations.

Key Features:

  • Get all preferences.
  • Update user's 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 data and marketing Preferences.


val preferences = preferencesService.get()

Update Preferences

Use the update method to update the data 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)