VOConfig

@interface VOConfig : NSObject

VOConfig is the global config for the VouchrSDK.

Note

serverUrlString and sdkIdString must be set or the application will throw an exception when the VOEngine is built.

These properties can be implemented in code or by plist.

By Code: Use config initializer and set the properties manually before passing it to the VOEngine.

By Plist: Add VOConfig.plist and use the defaultConfig initializer or add .plist and use the configWithContentsOfFile:<path_to_plist> initializer

  • the url used for all network calls to the vouchr server. Corresponds to vouchr_server_url in the plist.

    Note

    Defaults to https://surpriise.me

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull serverUrlString;

    Swift

    var serverUrlString: String { get set }
  • the string passed to the vouchr server on all network requests. Corresponds to vouchr_sdk_string in the plist.

    Note

    Defaults to SURPRIISE_APP

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull sdkIdString;

    Swift

    var sdkIdString: String { get set }
  • the name used when showing the ‘gift’ anywhere. Corresponds to vouchr_gift_name in the plist. eg. Firstname L. claimed their <‘gift’>.

    Note

    Defaults to ‘gift’

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull giftName;

    Swift

    var giftName: String { get set }
  • the access key used to submit Youtube API requests. Corresponds to youtube_api_key in the plist.

    Note

    required in order to access Youtube API

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *youtubeAccessKey;

    Swift

    var youtubeAccessKey: String { get set }
  • the api key used to submit Google Custom Search JSON API requests. Corresponds to google_image_api_key in the plist.

    Note

    required in order to access Google Custom Search JSON API

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *googleImageApiKey;

    Swift

    var googleImageApiKey: String { get set }
  • the search engine id used to submit Google Custom Search JSON API requests. Corresponds to google_image_custom_search_engine_id in the plist.

    Note

    required in order to access Google Custom Search JSON API

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull)
        NSString *googleImageSearchEngineId;

    Swift

    var googleImageSearchEngineId: String { get set }
  • the access key used to submit Giphy API requests. Corresponds to giphy_api_key in the plist.

    Note

    required in order to access Giphy API

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *giphyApiKey;

    Swift

    var giphyApiKey: String { get set }
  • the default theme used everywhere if a VOTheme is not provided on a per class basis.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) VOTheme *defaultVouchrTheme;

    Swift

    @NSCopying var defaultVouchrTheme: VOTheme? { get set }
  • The default images used by the app

    Declaration

    Objective-C

    @property (readonly, nonatomic) VOImages *_Nonnull imageCatalog;

    Swift

    var imageCatalog: VOImages { get }
  • The list of urls that are to be recognized by the system to prevent redundant uploading of media. In other words, media paths containing the specified URLs will not be re-uploaded.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSArray<NSString *> *safeUrls;

    Swift

    var safeUrls: [String] { get set }
  • Creates an instance using the values set in the VOConfig.plist file.

    Declaration

    Objective-C

    + (nonnull instancetype)defaultConfig;

    Swift

    class func `default`() -> Self

    Return Value

    A VOConfig with values from VOConfig.plist file.

  • Creates an instance using the values found in the specified .plist file.

    Declaration

    Objective-C

    + (nonnull instancetype)configWithContentsOfFile:(nonnull NSString *)path;

    Swift

    convenience init(contentsOfFile path: String)

    Parameters

    path

    The path of the specified file.

    Return Value

    A VOConfig with values from the specified file.

  • Creates an instance with empty values.

    Declaration

    Objective-C

    + (nonnull instancetype)config;

    Return Value

    A VOConfig with empty values.