Classes

The following classes are available globally.

  • Declaration

    Objective-C

    @interface BRAccountLinkingConfiguration : NSObject
    
    /**
     *  Set this property to control how far back in the user's history to search for orders
     *
     *  Default: 15
     */
    @property (nonatomic) NSInteger dayCutoff;
    
    /**
     *  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
     */
    @property (nonatomic, strong, nullable) NSDate *dateCutoff;
    
    /**
     *  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
     */
    @property (nonatomic) BOOL returnLatestOrdersOnly;
    
    /**
    *  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"
    */
    @property (nonatomic, copy, nonnull) NSString *countryCode;
    
    @end

    Swift

    class BRAccountLinkingConfiguration : NSObject
  • Declaration

    Objective-C

    @interface BRAccountLinkingConnection : NSObject
    
    @property (nonatomic, readonly) BRAccountLinkingRetailer retailer;
    @property (nonatomic, copy, readonly, nullable) NSString *username;
    @property (nonatomic, copy, readonly, nullable) NSString *password;
    @property (nonatomic, readonly) NSTimeInterval lastExecutionTime;
    @property (nonatomic, readonly) NSUInteger lastExecutionCode;
    
    // A configuration object that defines the behavior when searching for new orders
    @property (nonatomic, strong, nonnull) BRAccountLinkingConfiguration *configuration;
    
    
    - (instancetype)init NS_UNAVAILABLE;
    - (instancetype)initWithRetailer:(BRAccountLinkingRetailer)retailer username:(NSString * _Nullable)username password:(NSString * _Nullable)password;
    
    @end

    Swift

    class BRAccountLinkingConnection : NSObject
  • Declaration

    Objective-C

    @interface BRAccountLinkingConnectionIdentifier : NSObject
    
    @property (nonatomic, copy, readonly, nonnull) NSString *rawValue;
    
    - (instancetype)init NS_UNAVAILABLE;
    
    @end

    Swift

    class BRAccountLinkingConnectionIdentifier : NSObject
  • Instantiate a BRAccountLinkingCredentials object after collecting the credentials for a given retailer from the user

    See more

    Declaration

    Objective-C

    @interface BRAccountLinkingCredentials : NSObject

    Swift

    class BRAccountLinkingCredentials : 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
    See more

    Declaration

    Objective-C

    @interface BRAccountLinkingManager : NSObject

    Swift

    class BRAccountLinkingManager : NSObject
  • This class is the interface to manage e-receipt parsing

    See more

    Declaration

    Objective-C

    @interface BREReceiptManager : NSObject

    Swift

    class BREReceiptManager : NSObject
  • This class represents a user email account

    See more

    Declaration

    Objective-C

    @interface BREmailAccount : NSObject

    Swift

    class BREmailAccount : NSObject
  • This class represents an IMAP account that should be instantiated with the user’s credentials prior to beginning IMAP setup in BREReceiptManager

    See more

    Declaration

    Objective-C

    @interface BRIMAPAccount : BREmailAccount

    Swift

    class BRIMAPAccount : BREmailAccount