Button

class Button : NSObject

The main interface to the Button SDK.

  • @returns The current SDK version (e.g. @“6.33.0”).

Starting the SDK

  • Configures Button with your applicationId.

    @note Get your application Id from from the Button Dashboard.

    @params applicationId Your applicationId (required).

    Declaration

    Swift

    class func configure(applicationId: String) async throws

    Parameters

    completionHandler

    A block to be executed upon completion (optional).

Fetching a Purchase Path

User Association

  • Associate your user with a Button session.

    @discussion You can associate all Button activity with one of your users by setting their User Identifier. This can be your user ID or a stable hash of one. You can use this later to look up orders in Webhooks.

    Button.user.setIdentifier(myLoggedInUser.identifier);
    

    Declaration

    Swift

    class var user: any User { get }

Feature Configuration

  • Button SDK feature configuration.

    Declaration

    Swift

    class var configuration: any ConfigurationInterface { get }

Offers

Debugging

  • Debug the Button SDK.

    @discussion Enable debug logging during integration for more visibility.

    Button.debug.loggingEnabled = YES;
    

    Declaration

    Swift

    class var debug: any DebugInterface { get }

Clearing Data

  • Discards the current session and all persisted data.

    @discussion Call this method in your log out handler if/when your user logs out of your app.

    Declaration

    Swift

    class func clearAllData()