BRAccountLinkingManager

Objective-C

@interface BRAccountLinkingManager : NSObject

Swift

class BRAccountLinkingManager : NSObject

Use this interface to manage users’ linked retailer accounts for parsing e-receipts. Here is the basic flow:

  1. Implement UI to capture the user’s credentials to one or more retailers from the supported list (see BRAccountLinkingRetailer enum)
  2. Store these using -[BRAccountLinkingManager linkAccountWithCredentials:]
  3. Call -[BRAccountLinkingManager grabNewOrdersWithCompletion:]
  4. The callback to this method will return all order details available since the most recent successful invocation

Class Methods



  • Declaration

    Objective-C

    + (nonnull instancetype)shared;

    Swift

    class func shared() -> Self

Properties

  • Deprecated

    Use BRAccountLinkingConfiguration.dayCutoff instead.

    Set this property to control how far back in the user’s history to search for orders

    Default: 15

    Declaration

    Objective-C

    @property (nonatomic) NSInteger dayCutoff;

    Swift

    var dayCutoff: Int { get set }
  • Deprecated

    Use BRAccountLinkingConfiguration.dateCutoff instead.

    This property is an alternative to dayCutoff which allows you to set a specific date/time that serves as the boundary of how far back to search. If set, it will override dayCutoff

    Default: nil

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSDate *dateCutoff;

    Swift

    var dateCutoff: Date? { get set }
  • Deprecated

    Use BRAccountLinkingConfiguration.returnLatestOrdersOnly instead.

    When set to YES, the first scrape will attempt to retrieve orders back to the dayCutoff or dateCutoff but all subsequent scrapes will only go as far back as the last scrape date regardless of whether the first scrape completed When set to NO, subsequent scrapes will continue to fetch historical orders until dayCutoff or dateCutoff is reached, and after that, scrapes will only go back to the last scrape date

    Default: YES

    Declaration

    Objective-C

    @property (nonatomic) BOOL returnLatestOrdersOnly;

    Swift

    var returnLatestOrdersOnly: Bool { get set }
  • Deprecated

    Use BRAccountLinkingConfiguration.countryCode instead.

    Set this to a different country to access the correct version of the retailer’s site, if it exists for that country (currently only supports Amazon UK)

    Default: @“US”

    Declaration

    Objective-C

    @property (nonatomic, strong) DEPRECATED_MSG_ATTRIBUTE( "Use BRAccountLinkingConfiguration.countryCode instead.") NSString *countryCode;

    Swift

    var countryCode: String { get set }
  • Returns current version

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull version;

    Swift

    var version: String { get }
  • A completion handler to receive updates from a background operation when enabled via enableBackgroundFetchWithIdentifier BRAccountLinkingRetailer retailer - the retailer for this order BRScanResults *results - the current order BRAccountLinkingError error - any error that was encountered while attempting to grab orders NSString *sessionId - a unique session GUID that can be reported for debugging purposes

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) void (^) (BRAccountLinkingRetailer, BRAccountLinkingError, NSString *_Nonnull, BRScanResults *_Nullable) backgroundFetchCompletion;

    Swift

    var backgroundFetchCompletion: ((BRAccountLinkingRetailer, BRAccountLinkingError, String, BRScanResults?) -> Void)? { get set }

Methods