AdaptySDK 4.1.1
Loading...
Searching...
No Matches
AdaptySDK.AdaptyConfiguration.Builder Class Referencesealed

Assembles an AdaptyConfiguration. Every setter returns the builder, so calls chain, and each field can equally well be assigned directly. More...

Public Member Functions

 Builder (string apiKey)
 Starts a configuration for the given API key.
AdaptyConfiguration Build ()
 The configuration described by this builder.
override string ToString ()
 A description for logs and the debugger. The format is not part of the contract — read the members rather than parsing it.
Builder SetAPIKey (string apiKey)
 Replaces the API key the builder was created with.
Builder SetCustomerUserId (string customerUserId)
 Sets CustomerUserId.
Builder SetCustomerUserId (string customerUserId, Guid iosAppAccountToken, string androidObfuscatedAccountId)
 Sets CustomerUserId together with the store account identifiers to attribute purchases with. An identity carrying neither of them is not sent.
Builder SetObserverMode (bool observerMode)
 Sets ObserverMode.
Builder SetAppleIDFACollectionDisabled (bool appleIdfaCollectionDisabled)
 Sets AppleIdfaCollectionDisabled. iOS only.
Builder SetGoogleAdvertisingIdCollectionDisabled (bool googleAdvertisingIdCollectionDisabled)
 Sets GoogleAdvertisingIdCollectionDisabled. Android only.
Builder SetGoogleEnablePendingPrepaidPlans (bool googleEnablePendingPrepaidPlans)
 Sets GoogleEnablePendingPrepaidPlans. Android only.
Builder SetGoogleLocalAccessLevelAllowed (bool googleLocalAccessLevelAllowed)
 Sets GoogleLocalAccessLevelAllowed. Android only.
Builder SetIPAddressCollectionDisabled (bool ipAddressCollectionDisabled)
 Sets IpAddressCollectionDisabled.
Builder SetAdaptyAttributionEnabled (bool adaptyAttributionEnabled)
 Sets AdaptyAttributionEnabled.
Builder SetAppleClearDataOnBackup (bool appleClearDataOnBackup)
 Sets AppleClearDataOnBackup. iOS only.
Builder SetServerCluster (AdaptyServerCluster serverCluster)
 Sets ServerCluster.
Builder SetBackendProxy (string host, int port)
 Sets BackendProxyHost and BackendProxyPort.
Builder SetActivateUI (bool activate)
 Sets ActivateUI.
Builder SetAdaptyUIMediaCache (int? memoryStorageTotalCostLimit, int? memoryStorageCountLimit, int? diskStorageSizeLimit)
 Sets AdaptyUIMediaCache. Null leaves a native default.

Public Attributes

string ApiKey
 The public SDK key from the Adapty Dashboard. Required.
string CustomerUserId
 The identifier of the user in your system, when you already know it at activation. Null to stay anonymous and call Adapty.Identify(System.String, System.Action<AdaptySDK.AdaptyError>) later.
AdaptyCustomerIdentity CustomerIdentity
 The store account identifiers to attribute purchases with. Null, or an instance carrying neither value, is not sent.
bool? ObserverMode
 Observer mode: your own code makes the purchases and Adapty only observes them. Null leaves the native default, which is off.
bool AppleIdfaCollectionDisabled
 iOS only. Stops the SDK collecting the IDFA. Forced on, whatever this says, when the ADAPTY_KIDS_MODE scripting define is set, since the trait compiles IDFA out of the binary.
bool GoogleAdvertisingIdCollectionDisabled
 Android only. Stops the SDK collecting the Google Advertising ID.
bool GoogleEnablePendingPrepaidPlans
 Android only. Reports pending transactions for prepaid plans.
bool? GoogleLocalAccessLevelAllowed
 Android only. Local access levels: when Adapty's servers cannot be reached after a purchase, the SDK verifies it against the store instead and grants the access level on the device. Null leaves the native default, which is off.
bool IpAddressCollectionDisabled
 Stops the SDK collecting the device's IP address.
bool? AdaptyAttributionEnabled
 Enables the Adapty Attributionservice. Null leaves the native default, which is off.
bool? AppleClearDataOnBackup
 iOS only. Clears the SDK's stored data when the app is restored from an iCloud backup, so a restored device does not carry the previous one's profile. Null leaves the native default, which is off.
AdaptyServerClusterServerCluster
 Which Adapty server region to talk to. Null uses the default cluster.
string BackendProxyHost
 The host of a proxy to route Adapty's backend calls through. Null for none.
int BackendProxyPort
 The port of the proxy named by BackendProxyHost. Ignored without it.
AdaptyLogLevel LogLevel
 How much the native SDK logs. Also settable at any time with Adapty.SetLogLevel(AdaptySDK.AdaptyLogLevel, System.Action<AdaptySDK.AdaptyError>).
bool ActivateUI
 Activates the flow rendering module along with the SDK. Required before AdaptyUI.CreateFlowView(AdaptySDK.AdaptyFlow, AdaptySDK.AdaptyUICreateFlowViewParameters, System.Action<AdaptySDK.AdaptyUIFlowView, AdaptySDK.AdaptyError>) can build a view.
AdaptyUIMediaCacheConfiguration AdaptyUIMediaCache
 Limits for the cache the flow renderer keeps for images and video. Null leaves the native defaults.

Detailed Description

Assembles an AdaptyConfiguration. Every setter returns the builder, so calls chain, and each field can equally well be assigned directly.

Only the API key is required, but "not set" does not mean "not sent". The nullable members — ObserverMode, GoogleLocalAccessLevelAllowed, AdaptyAttributionEnabled, AppleClearDataOnBackup, ServerCluster, CustomerUserId, CustomerIdentity, BackendProxyHost and AdaptyUIMediaCache — are left out of the request when null, and the native SDK applies its own default. The rest are not nullable and always go, carrying whatever they hold: a configuration that touches none of them still sends false for both IDFA flags and the IP one, activate_ui: false, log_level: "error" and backend_proxy_port: 0.

Constructor & Destructor Documentation

◆ Builder()

AdaptySDK.AdaptyConfiguration.Builder.Builder ( string apiKey)

Starts a configuration for the given API key.

Parameters
apiKeyThe public SDK key from the Adapty Dashboard.

Member Function Documentation

◆ Build()

AdaptyConfiguration AdaptySDK.AdaptyConfiguration.Builder.Build ( )

The configuration described by this builder.

◆ SetActivateUI()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetActivateUI ( bool activate)

Sets ActivateUI.

Parameters
activateTrue to activate the flow rendering module along with the SDK.

◆ SetAdaptyAttributionEnabled()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetAdaptyAttributionEnabled ( bool adaptyAttributionEnabled)

Sets AdaptyAttributionEnabled.

Parameters
adaptyAttributionEnabledTrue to enable the Adapty Attribution service.

◆ SetAdaptyUIMediaCache()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetAdaptyUIMediaCache ( int? memoryStorageTotalCostLimit,
int? memoryStorageCountLimit,
int? diskStorageSizeLimit )

Sets AdaptyUIMediaCache. Null leaves a native default.

Parameters
memoryStorageTotalCostLimitIn-memory cache limit, in bytes.
memoryStorageCountLimitHow many items the in-memory cache holds.
diskStorageSizeLimitOn-disk cache limit, in bytes.

◆ SetAPIKey()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetAPIKey ( string apiKey)

Replaces the API key the builder was created with.

Parameters
apiKeyThe public SDK key from the Adapty Dashboard.

◆ SetAppleClearDataOnBackup()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetAppleClearDataOnBackup ( bool appleClearDataOnBackup)

Sets AppleClearDataOnBackup. iOS only.

Parameters
appleClearDataOnBackupTrue to clear stored data when the app is restored from an iCloud backup.

◆ SetAppleIDFACollectionDisabled()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetAppleIDFACollectionDisabled ( bool appleIdfaCollectionDisabled)

Sets AppleIdfaCollectionDisabled. iOS only.

Parameters
appleIdfaCollectionDisabledTrue to stop the SDK collecting the IDFA.

◆ SetBackendProxy()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetBackendProxy ( string host,
int port )

Sets BackendProxyHost and BackendProxyPort.

Parameters
hostThe proxy host to route Adapty's backend calls through.
portThe port on that host.

◆ SetCustomerUserId() [1/2]

Builder AdaptySDK.AdaptyConfiguration.Builder.SetCustomerUserId ( string customerUserId)

Sets CustomerUserId.

Parameters
customerUserIdThe identifier of the user in your system.

◆ SetCustomerUserId() [2/2]

Builder AdaptySDK.AdaptyConfiguration.Builder.SetCustomerUserId ( string customerUserId,
Guid iosAppAccountToken,
string androidObfuscatedAccountId )

Sets CustomerUserId together with the store account identifiers to attribute purchases with. An identity carrying neither of them is not sent.

Parameters
customerUserIdThe identifier of the user in your system.
iosAppAccountTokeniOS only. The UUID tying a purchase to its App Store transaction; System.Guid.Empty for none.
androidObfuscatedAccountIdAndroid only. The obfuscated account identifier Google Play records; null for none.

◆ SetGoogleAdvertisingIdCollectionDisabled()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetGoogleAdvertisingIdCollectionDisabled ( bool googleAdvertisingIdCollectionDisabled)

Sets GoogleAdvertisingIdCollectionDisabled. Android only.

Parameters
googleAdvertisingIdCollectionDisabledTrue to stop the SDK collecting the Google Advertising ID.

◆ SetGoogleEnablePendingPrepaidPlans()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetGoogleEnablePendingPrepaidPlans ( bool googleEnablePendingPrepaidPlans)

Sets GoogleEnablePendingPrepaidPlans. Android only.

Parameters
googleEnablePendingPrepaidPlansTrue to report pending transactions for prepaid plans.

◆ SetGoogleLocalAccessLevelAllowed()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetGoogleLocalAccessLevelAllowed ( bool googleLocalAccessLevelAllowed)

Sets GoogleLocalAccessLevelAllowed. Android only.

Parameters
googleLocalAccessLevelAllowedTrue to grant access levels on the device when Adapty cannot be reached.

◆ SetIPAddressCollectionDisabled()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetIPAddressCollectionDisabled ( bool ipAddressCollectionDisabled)

Sets IpAddressCollectionDisabled.

Parameters
ipAddressCollectionDisabledTrue to stop the SDK collecting the device's IP address.

◆ SetObserverMode()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetObserverMode ( bool observerMode)

Sets ObserverMode.

Parameters
observerModeTrue when your own code makes the purchases and Adapty only observes them.

◆ SetServerCluster()

Builder AdaptySDK.AdaptyConfiguration.Builder.SetServerCluster ( AdaptyServerCluster serverCluster)

Sets ServerCluster.

Parameters
serverClusterThe Adapty server region to talk to.

◆ ToString()

override string AdaptySDK.AdaptyConfiguration.Builder.ToString ( )

A description for logs and the debugger. The format is not part of the contract — read the members rather than parsing it.

Member Data Documentation

◆ ActivateUI

bool AdaptySDK.AdaptyConfiguration.Builder.ActivateUI

Activates the flow rendering module along with the SDK. Required before AdaptyUI.CreateFlowView(AdaptySDK.AdaptyFlow, AdaptySDK.AdaptyUICreateFlowViewParameters, System.Action<AdaptySDK.AdaptyUIFlowView, AdaptySDK.AdaptyError>) can build a view.

◆ AdaptyAttributionEnabled

bool? AdaptySDK.AdaptyConfiguration.Builder.AdaptyAttributionEnabled

Enables the Adapty Attributionservice. Null leaves the native default, which is off.

Installation details hang off this flag: while it is off, the 4.1 natives collect none, so IAdaptyEventListener.OnInstallationDetailsSuccess(AdaptyInstallationDetails) never fires and Adapty.GetCurrentInstallationStatus(System.Action<AdaptySDK.AdaptyInstallationStatus, AdaptySDK.AdaptyError>) never reports AdaptyInstallationStatusType.Determined. The 4.0 natives collected them unconditionally.

◆ AdaptyUIMediaCache

AdaptyUIMediaCacheConfiguration AdaptySDK.AdaptyConfiguration.Builder.AdaptyUIMediaCache

Limits for the cache the flow renderer keeps for images and video. Null leaves the native defaults.

◆ ApiKey

string AdaptySDK.AdaptyConfiguration.Builder.ApiKey

The public SDK key from the Adapty Dashboard. Required.

◆ AppleClearDataOnBackup

bool? AdaptySDK.AdaptyConfiguration.Builder.AppleClearDataOnBackup

iOS only. Clears the SDK's stored data when the app is restored from an iCloud backup, so a restored device does not carry the previous one's profile. Null leaves the native default, which is off.

◆ AppleIdfaCollectionDisabled

bool AdaptySDK.AdaptyConfiguration.Builder.AppleIdfaCollectionDisabled

iOS only. Stops the SDK collecting the IDFA. Forced on, whatever this says, when the ADAPTY_KIDS_MODE scripting define is set, since the trait compiles IDFA out of the binary.

◆ BackendProxyHost

string AdaptySDK.AdaptyConfiguration.Builder.BackendProxyHost

The host of a proxy to route Adapty's backend calls through. Null for none.

◆ BackendProxyPort

int AdaptySDK.AdaptyConfiguration.Builder.BackendProxyPort

The port of the proxy named by BackendProxyHost. Ignored without it.

◆ CustomerIdentity

AdaptyCustomerIdentity AdaptySDK.AdaptyConfiguration.Builder.CustomerIdentity

The store account identifiers to attribute purchases with. Null, or an instance carrying neither value, is not sent.

◆ CustomerUserId

string AdaptySDK.AdaptyConfiguration.Builder.CustomerUserId

The identifier of the user in your system, when you already know it at activation. Null to stay anonymous and call Adapty.Identify(System.String, System.Action<AdaptySDK.AdaptyError>) later.

◆ GoogleAdvertisingIdCollectionDisabled

bool AdaptySDK.AdaptyConfiguration.Builder.GoogleAdvertisingIdCollectionDisabled

Android only. Stops the SDK collecting the Google Advertising ID.

◆ GoogleEnablePendingPrepaidPlans

bool AdaptySDK.AdaptyConfiguration.Builder.GoogleEnablePendingPrepaidPlans

Android only. Reports pending transactions for prepaid plans.

◆ GoogleLocalAccessLevelAllowed

bool? AdaptySDK.AdaptyConfiguration.Builder.GoogleLocalAccessLevelAllowed

Android only. Local access levels: when Adapty's servers cannot be reached after a purchase, the SDK verifies it against the store instead and grants the access level on the device. Null leaves the native default, which is off.

◆ IpAddressCollectionDisabled

bool AdaptySDK.AdaptyConfiguration.Builder.IpAddressCollectionDisabled

Stops the SDK collecting the device's IP address.

◆ LogLevel

AdaptyLogLevel AdaptySDK.AdaptyConfiguration.Builder.LogLevel

How much the native SDK logs. Also settable at any time with Adapty.SetLogLevel(AdaptySDK.AdaptyLogLevel, System.Action<AdaptySDK.AdaptyError>).

◆ ObserverMode

bool? AdaptySDK.AdaptyConfiguration.Builder.ObserverMode

Observer mode: your own code makes the purchases and Adapty only observes them. Null leaves the native default, which is off.

◆ ServerCluster

AdaptyServerCluster? AdaptySDK.AdaptyConfiguration.Builder.ServerCluster

Which Adapty server region to talk to. Null uses the default cluster.


The documentation for this class was generated from the following file: