diff --git a/src/ios/BranchNPM.h b/src/ios/BranchNPM.h index 39325ca4..90fe1bcc 100644 --- a/src/ios/BranchNPM.h +++ b/src/ios/BranchNPM.h @@ -1 +1 @@ -#define BRANCH_NPM true +//empty diff --git a/src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m b/src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m index 13c161fa..84404b55 100644 --- a/src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m +++ b/src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m @@ -8,7 +8,7 @@ #import "BNCFabricAnswers.h" #import "BNCPreferenceHelper.h" -#import "../Fabric/Answers.h" +#import "Answers.h" @implementation BNCFabricAnswers diff --git a/src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.m b/src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.m index 428f2329..24850e7d 100644 --- a/src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.m +++ b/src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.m @@ -10,7 +10,7 @@ #import "BNCEncodingUtils.h" #import "BNCConfig.h" #import "Branch.h" -#import "../Fabric/Fabric+FABKits.h" +#import "Fabric+FABKits.h" static const NSTimeInterval DEFAULT_TIMEOUT = 5.5; static const NSTimeInterval DEFAULT_RETRY_INTERVAL = 0; diff --git a/src/ios/dependencies/Branch-SDK/Branch.h b/src/ios/dependencies/Branch-SDK/Branch.h index f0f010e7..98f73a3a 100644 --- a/src/ios/dependencies/Branch-SDK/Branch.h +++ b/src/ios/dependencies/Branch-SDK/Branch.h @@ -407,18 +407,8 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) { - (void)disableCookieBasedMatching; /** - TL;DR: If you're using a version of the Facebook SDK that prevents application:didFinishLaunchingWithOptions: from - returning YES/true when a Universal Link is clicked, you should enable this option. - - Long explanation: in application:didFinishLaunchingWithOptions: you should choose one of the following: - - 1. Always `return YES;`, and do *not* invoke `[[Branch getInstance] accountForFacebookSDKPreventingAppLaunch];` - 2. Allow the Facebook SDK to determine whether `application:didFinishLaunchingWithOptions:` returns `YES` or `NO`, - and invoke `[[Branch getInstance] accountForFacebookSDKPreventingAppLaunch];` - - The reason for this second option is that the Facebook SDK will return `NO` if a Universal Link opens the app - but that UL is not a Facebook UL. Some developers prefer not to modify - `application:didFinishLaunchingWithOptions:` to always return `YES` and should use this method instead. + If you're using a version of the Facebook SDK that prevents application:didFinishLaunchingWithOptions: from returning + YES/true when a Universal Link is clicked, you should enable this option. */ - (void)accountForFacebookSDKPreventingAppLaunch; diff --git a/src/ios/dependencies/Branch-SDK/Branch.m b/src/ios/dependencies/Branch-SDK/Branch.m index b06b9b0b..18269149 100644 --- a/src/ios/dependencies/Branch-SDK/Branch.m +++ b/src/ios/dependencies/Branch-SDK/Branch.m @@ -35,8 +35,8 @@ #import "BranchRegisterViewRequest.h" //Fabric -#import "../Fabric/FABKitProtocol.h" -#import "../Fabric/Fabric+FABKits.h" +#import "FABKitProtocol.h" +#import "Fabric+FABKits.h" NSString * const BRANCH_FEATURE_TAG_SHARE = @"share"; NSString * const BRANCH_FEATURE_TAG_REFERRAL = @"referral"; diff --git a/src/ios/dependencies/Branch-SDK/BranchSDK.h b/src/ios/dependencies/Branch-SDK/BranchSDK.h deleted file mode 100644 index 530d6f97..00000000 --- a/src/ios/dependencies/Branch-SDK/BranchSDK.h +++ /dev/null @@ -1,15 +0,0 @@ -// Created by Ahmed Nawar on 2/24/16. -// Copyright © 2016 Ahmed Nawar. All rights reserved. -// Umbrella header file - -#import - -#import "Branch.h" -#import "BNCConfig.h" -#import "BranchView.h" -#import "BranchViewHandler.h" -#import "BranchLinkProperties.h" -#import "BranchUniversalObject.h" -#import "BranchActivityItemProvider.h" -#import "BranchDeepLinkingController.h" -#import "BranchCSSearchableItemAttributeSet.h" \ No newline at end of file diff --git a/src/ios/dependencies/Branch.framework/Branch b/src/ios/dependencies/Branch.framework/Branch new file mode 120000 index 00000000..01828c34 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Branch @@ -0,0 +1 @@ +Versions/Current/Branch \ No newline at end of file diff --git a/src/ios/dependencies/Branch.framework/Headers b/src/ios/dependencies/Branch.framework/Headers new file mode 120000 index 00000000..a177d2a6 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/src/ios/dependencies/Branch.framework/Info.plist b/src/ios/dependencies/Branch.framework/Info.plist new file mode 100644 index 00000000..7e7342df --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Info.plist @@ -0,0 +1,42 @@ + + + + + AppIdentifierPrefix + $(AppIdentifierPrefix) + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + io.branch.sdk.ios + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.12.2 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSApplicationCategoryType + + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/src/ios/dependencies/Branch.framework/Modules/module.modulemap b/src/ios/dependencies/Branch.framework/Modules/module.modulemap new file mode 100644 index 00000000..5ba86358 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module Branch { + umbrella header "Branch.h" + + export * + module * { export * } + + link framework "CoreTelephony" + link framework "MobileCoreServices" +} diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Branch b/src/ios/dependencies/Branch.framework/Versions/A/Branch new file mode 100644 index 00000000..94c96926 Binary files /dev/null and b/src/ios/dependencies/Branch.framework/Versions/A/Branch differ diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCCallbacks.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCCallbacks.h new file mode 100644 index 00000000..1c1490c5 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCCallbacks.h @@ -0,0 +1,21 @@ +// +// BNCCallbacks.h +// Branch-TestBed +// +// Created by Ahmed Nawar on 6/18/16. +// Copyright © 2016 Branch Metrics. All rights reserved. +// + +#ifndef BNCCallbacks_h +#define BNCCallbacks_h + +@class BranchUniversalObject, BranchLinkProperties; + +typedef void (^callbackWithParams) (NSDictionary *params, NSError *error); +typedef void (^callbackWithUrl) (NSString *url, NSError *error); +typedef void (^callbackWithStatus) (BOOL changed, NSError *error); +typedef void (^callbackWithList) (NSArray *list, NSError *error); +typedef void (^callbackWithUrlAndSpotlightIdentifier) (NSString *url, NSString *spotlightIdentifier, NSError *error); +typedef void (^callbackWithBranchUniversalObject) (BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error); + +#endif /* BNCCallbacks_h */ diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCConfig.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCConfig.h new file mode 100644 index 00000000..b2d4fc76 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCConfig.h @@ -0,0 +1,34 @@ +// +// BNCConfig.h +// Branch-SDK +// +// Created by Qinwei Gong on 10/6/14. +// Copyright (c) 2014 Branch Metrics. All rights reserved. +// + +#ifndef Branch_SDK_Config_h +#define Branch_SDK_Config_h + +#define SDK_VERSION @"0.12.5" + +#define BNC_PROD_ENV +//#define BNC_STAGE_ENV +//#define BNC_DEV_ENV + +#ifdef BNC_PROD_ENV +#define BNC_API_BASE_URL @"https://api.branch.io" +#endif + +#ifdef BNC_STAGE_ENV +#define BNC_API_BASE_URL @"http://api.dev.branch.io" +#endif + +#define BNC_LINK_URL @"https://bnc.lt" + +#ifdef BNC_DEV_ENV +#define BNC_API_BASE_URL @"http://localhost:3001" +#endif + +#define BNC_API_VERSION @"v1" + +#endif diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCLinkCache.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCLinkCache.h new file mode 100644 index 00000000..ed725b39 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCLinkCache.h @@ -0,0 +1,17 @@ +// +// BNCLinkCache.h +// Branch-SDK +// +// Created by Qinwei Gong on 1/23/15. +// Copyright (c) 2015 Branch Metrics. All rights reserved. +// + +#import +#import "BNCLinkData.h" + +@interface BNCLinkCache : NSObject + +- (void)setObject:(NSString *)anObject forKey:(BNCLinkData *)aKey; +- (NSString *)objectForKey:(BNCLinkData *)aKey; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCLinkData.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCLinkData.h new file mode 100644 index 00000000..bc975eab --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCLinkData.h @@ -0,0 +1,30 @@ +// +// BNCLinkData.h +// Branch-SDK +// +// Created by Qinwei Gong on 1/22/15. +// Copyright (c) 2015 Branch Metrics. All rights reserved. +// + +#import + +typedef NS_ENUM(NSUInteger, BranchLinkType) { + BranchLinkTypeUnlimitedUse = 0, + BranchLinkTypeOneTimeUse = 1 +}; + +@interface BNCLinkData : NSObject + +@property (strong, nonatomic) NSMutableDictionary *data; + +- (void)setupTags:(NSArray *)tags; +- (void)setupAlias:(NSString *)alias; +- (void)setupType:(BranchLinkType)type; +- (void)setupChannel:(NSString *)channel; +- (void)setupFeature:(NSString *)feature; +- (void)setupStage:(NSString *)stage; +- (void)setupParams:(NSDictionary *)params; +- (void)setupMatchDuration:(NSUInteger)duration; +- (void)setupIgnoreUAString:(NSString *)ignoreUAString; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCPreferenceHelper.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCPreferenceHelper.h new file mode 100644 index 00000000..6514d50c --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCPreferenceHelper.h @@ -0,0 +1,71 @@ +// +// BNCPreferenceHelper.h +// Branch-SDK +// +// Created by Alex Austin on 6/6/14. +// Copyright (c) 2014 Branch Metrics. All rights reserved. +// + +#import + +#define FILE_NAME [[NSString stringWithUTF8String:__FILE__] lastPathComponent] +#define LINE_NUM __LINE__ + +@interface BNCPreferenceHelper : NSObject + +@property (strong, nonatomic) NSString *branchKey; +@property (strong, nonatomic) NSString *lastRunBranchKey; +@property (strong, nonatomic) NSDate *lastStrongMatchDate; +@property (strong, nonatomic) NSString *appVersion; +@property (strong, nonatomic) NSString *deviceFingerprintID; +@property (strong, nonatomic) NSString *sessionID; +@property (strong, nonatomic) NSString *identityID; +@property (strong, nonatomic) NSString *linkClickIdentifier; +@property (strong, nonatomic) NSString *spotlightIdentifier; +@property (strong, nonatomic) NSString *universalLinkUrl; +@property (strong, nonatomic) NSString *userUrl; +@property (strong, nonatomic) NSString *userIdentity; +@property (strong, nonatomic) NSString *sessionParams; +@property (strong, nonatomic) NSString *installParams; +@property (assign, nonatomic) BOOL isDebug; +@property (assign, nonatomic) BOOL shouldWaitForInit; +@property (assign, nonatomic) BOOL suppressWarningLogs; +@property (assign, nonatomic) BOOL checkedFacebookAppLinks; +@property (assign, nonatomic) NSInteger retryCount; +@property (assign, nonatomic) NSTimeInterval retryInterval; +@property (assign, nonatomic) NSTimeInterval timeout; +@property (strong, nonatomic) NSString *externalIntentURI; + ++ (BNCPreferenceHelper *)preferenceHelper; + +- (NSString *)getAPIBaseURL; +- (NSString *)getAPIURL:(NSString *)endpoint; +- (NSString *)getEndpointFromURL:(NSString *)url; + +- (NSString *)getBranchKey:(BOOL)isLive; + +- (void)clearUserCreditsAndCounts; +- (void)clearUserCredits; + +- (id)getBranchUniversalLinkDomains; + +- (void)setCreditCount:(NSInteger)count; +- (void)setCreditCount:(NSInteger)count forBucket:(NSString *)bucket; +- (void)removeCreditCountForBucket:(NSString *)bucket; +- (NSDictionary *)getCreditDictionary; +- (NSInteger)getCreditCount; +- (NSInteger)getCreditCountForBucket:(NSString *)bucket; + +- (void)updateBranchViewCount:(NSString *)branchViewID; +- (NSInteger)getBranchViewCount:(NSString *)branchViewID; + +- (void)setRequestMetadataKey:(NSString *)key value:(NSObject *)value; +- (NSMutableDictionary *)requestMetadataDictionary; + +- (void)addInstrumentationDictionaryKey:(NSString *)key value:(NSString *)value; +- (NSMutableDictionary *)instrumentationDictionary; +- (void)clearInstrumentationDictionary; + +- (void)log:(NSString *)filename line:(int)line message:(NSString *)format, ...; +- (void)logWarning:(NSString *)message; +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerInterface.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerInterface.h new file mode 100644 index 00000000..dda810b8 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerInterface.h @@ -0,0 +1,31 @@ +// +// BNCServerInterface.h +// Branch-SDK +// +// Created by Alex Austin on 6/4/14. +// Copyright (c) 2014 Branch Metrics. All rights reserved. +// + +#import +#import "BNCServerResponse.h" +#import "BNCPreferenceHelper.h" + +typedef void (^BNCServerCallback)(BNCServerResponse *response, NSError *error); + +@interface BNCServerInterface : NSObject + +@property (strong, nonatomic) BNCPreferenceHelper *preferenceHelper; + +- (BNCServerResponse *)getRequest:(NSDictionary *)params url:(NSString *)url key:(NSString *)key; +- (BNCServerResponse *)getRequest:(NSDictionary *)params url:(NSString *)url key:(NSString *)key log:(BOOL)log; +- (void)getRequest:(NSDictionary *)params url:(NSString *)url key:(NSString *)key callback:(BNCServerCallback)callback; +- (void)getRequest:(NSDictionary *)params url:(NSString *)url key:(NSString *)key log:(BOOL)log callback:(BNCServerCallback)callback; + +- (BNCServerResponse *)postRequest:(NSDictionary *)post url:(NSString *)url key:(NSString *)key log:(BOOL)log; +- (void)postRequest:(NSDictionary *)post url:(NSString *)url key:(NSString *)key callback:(BNCServerCallback)callback; +- (void)postRequest:(NSDictionary *)post url:(NSString *)url key:(NSString *)key log:(BOOL)log callback:(BNCServerCallback)callback; + +- (void)genericHTTPRequest:(NSURLRequest *)request log:(BOOL)log callback:(BNCServerCallback)callback; +- (BNCServerResponse *)genericHTTPRequest:(NSURLRequest *)request log:(BOOL)log; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerRequest.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerRequest.h new file mode 100644 index 00000000..6a6ab51b --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerRequest.h @@ -0,0 +1,18 @@ +// +// BNCServerRequest.h +// Branch-SDK +// +// Created by Alex Austin on 6/5/14. +// Copyright (c) 2014 Branch Metrics. All rights reserved. +// + +#import +#import "BNCServerInterface.h" + +@interface BNCServerRequest : NSObject + +- (void)makeRequest:(BNCServerInterface *)serverInterface key:(NSString *)key callback:(BNCServerCallback)callback; +- (void)processResponse:(BNCServerResponse *)response error:(NSError *)error; +- (void)safeSetValue:(NSObject *)value forKey:(NSString *)key onDict:(NSMutableDictionary *)dict; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerRequestQueue.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerRequestQueue.h new file mode 100755 index 00000000..44eab536 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerRequestQueue.h @@ -0,0 +1,34 @@ +// +// BNCServerRequestQueue.h +// Branch-SDK +// +// Created by Qinwei Gong on 9/6/14. +// +// + +#import "BNCServerRequest.h" + +@class BranchOpenRequest; + +@interface BNCServerRequestQueue : NSObject + +@property (nonatomic, readonly) unsigned int size; + +- (void)enqueue:(BNCServerRequest *)request; +- (BNCServerRequest *)dequeue; +- (BNCServerRequest *)peek; +- (BNCServerRequest *)peekAt:(unsigned int)index; +- (void)insert:(BNCServerRequest *)request at:(unsigned int)index; +- (BNCServerRequest *)removeAt:(unsigned int)index; +- (void)remove:(BNCServerRequest *)request; +- (void)persistEventually; +- (void)persistImmediately; +- (void)clearQueue; + +- (BOOL)containsInstallOrOpen; +- (BOOL)containsClose; +- (BranchOpenRequest *)moveInstallOrOpenToFront:(NSInteger)networkCount; + ++ (id)getInstance; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerResponse.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerResponse.h new file mode 100644 index 00000000..d256ca5b --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BNCServerResponse.h @@ -0,0 +1,16 @@ +// +// BNCServerResponse.h +// Branch-SDK +// +// Created by Qinwei Gong on 10/10/14. +// Copyright (c) 2014 Branch Metrics. All rights reserved. +// + +#import + +@interface BNCServerResponse : NSObject + +@property (nonatomic, strong) NSNumber *statusCode; +@property (nonatomic, strong) id data; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/Branch.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/Branch.h new file mode 100644 index 00000000..98f73a3a --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/Branch.h @@ -0,0 +1,1210 @@ +// +// Branch_SDK.h +// Branch-SDK +// +// Created by Alex Austin on 6/5/14. +// Copyright (c) 2014 Branch Metrics. All rights reserved. +// +#import +#import +#import "BNCConfig.h" +#import "BranchView.h" +#import "BNCCallbacks.h" +#import "BNCLinkCache.h" +#import "BranchViewHandler.h" +#import "BNCServerInterface.h" +#import "BNCPreferenceHelper.h" +#import "BranchLinkProperties.h" +#import "BranchUniversalObject.h" +#import "BNCServerRequestQueue.h" +#import "BranchActivityItemProvider.h" +#import "BranchDeepLinkingController.h" + +/** + `Branch` is the primary interface of the Branch iOS SDK. Currently, all interactions you will make are funneled through this class. It is not meant to be instantiated or subclassed, usage should be limited to the global instance. + + Note, when `getInstance` is called, it assumes that you have already placed a Branch Key in your main `Info.plist` file for your project. For additional information on configuring the Branch SDK, check out the getting started guides in the Readme. + */ + +///---------------- +/// @name Constants +///---------------- + +#pragma mark - Branch Link Features + +/** + ## Branch Link Features + The following are constants used for specifying a feature parameter on a call that creates a Branch link. + + `BRANCH_FEATURE_SHARE` + Indicates this link was used for sharing content. Used by the `getContentUrl` methods. + + `BRANCH_FEATURE_TAG_REFERRAL` + Indicates this link was used to refer users to this app. Used by the `getReferralUrl` methods. + + `BRANCH_FEATURE_TAG_INVITE` + Indicates this link is used as an invitation. + + `BRANCH_FEATURE_TAG_DEAL` + Indicates this link is being used to trigger a deal, like a discounted rate. + + `BRANCH_FEATURE_TAG_GIFT` + Indicates this link is being used to sned a gift to another user. + */ +extern NSString * const BRANCH_FEATURE_TAG_SHARE; +extern NSString * const BRANCH_FEATURE_TAG_REFERRAL; +extern NSString * const BRANCH_FEATURE_TAG_INVITE; +extern NSString * const BRANCH_FEATURE_TAG_DEAL; +extern NSString * const BRANCH_FEATURE_TAG_GIFT; + +#pragma mark - Branch InitSession Dictionary Constants + +/** + ## Branch Link Features + + `BRANCH_INIT_KEY_CHANNEL` + The channel on which the link was shared, specified at link creation time. + + `BRANCH_INIT_KEY_FEATURE` + The feature, such as `invite` or `share`, specified at link creation time. + + `BRANCH_INIT_KEY_TAGS` + Any tags, specified at link creation time. + + `BRANCH_INIT_KEY_CAMPAIGN` + The campaign the link is associated with, specified at link creation time. + + `BRANCH_INIT_KEY_STAGE` + The stage, specified at link creation time. + + `BRANCH_INIT_KEY_CREATION_SOURCE` + Where the link was created ('API', 'Dashboard', 'SDK', 'iOS SDK', 'Android SDK', or 'Web SDK') + + `BRANCH_INIT_KEY_REFERRER` + The referrer for the link click, if a link was clicked. + + `BRANCH_INIT_KEY_PHONE_NUMBER` + The phone number of the user, if the user texted himself/herself the app. + + `BRANCH_INIT_KEY_IS_FIRST_SESSION` + Denotes whether this is the first session (install) or any other session (open). + + `BRANCH_INIT_KEY_CLICKED_BRANCH_LINK` + Denotes whether or not the user clicked a Branch link that triggered this session. + */ +extern NSString * const BRANCH_INIT_KEY_CHANNEL; +extern NSString * const BRANCH_INIT_KEY_FEATURE; +extern NSString * const BRANCH_INIT_KEY_TAGS; +extern NSString * const BRANCH_INIT_KEY_CAMPAIGN; +extern NSString * const BRANCH_INIT_KEY_STAGE; +extern NSString * const BRANCH_INIT_KEY_CREATION_SOURCE; +extern NSString * const BRANCH_INIT_KEY_REFERRER; +extern NSString * const BRANCH_INIT_KEY_PHONE_NUMBER; +extern NSString * const BRANCH_INIT_KEY_IS_FIRST_SESSION; +extern NSString * const BRANCH_INIT_KEY_CLICKED_BRANCH_LINK; + +#pragma mark - Branch Enums +typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) { + BranchMostRecentFirst, + BranchLeastRecentFirst +}; + +@interface Branch : NSObject + +#pragma mark - Global Instance Accessors + +///-------------------------------- +/// @name Global Instance Accessors +///-------------------------------- + +/** + Gets the global, live Branch instance. + */ ++ (Branch *)getInstance; + +/** + Gets the global, test Branch instance. + + @warning This method is not meant to be used in production! + */ ++ (Branch *)getTestInstance; + +/** + Gets the global Branch instance, configures using the specified key + + @param branchKey The Branch key to be used by the Branch instance. This can be any live or test key. + @warning This method is not the recommended way of using Branch. Try using your project's `Info.plist` if possible. + */ ++ (Branch *)getInstance:(NSString *)branchKey; + + +#pragma mark - BranchActivityItemProvider methods + +///----------------------------------------- +/// @name BranchActivityItemProvider methods +///----------------------------------------- + +/** + Create a BranchActivityItemProvider which subclasses the `UIActivityItemProvider` This can be used for simple sharing via a `UIActivityViewController`. + + Internally, this will create a short Branch Url that will be attached to the shared content. + + @param params A dictionary to use while building up the Branch link. + */ ++ (BranchActivityItemProvider *)getBranchActivityItemWithParams:(NSDictionary *)params; + +/** + Create a BranchActivityItemProvider which subclasses the `UIActivityItemProvider` This can be used for simple sharing via a `UIActivityViewController`. + + Internally, this will create a short Branch Url that will be attached to the shared content. + + @param params A dictionary to use while building up the Branch link. + @param feature The feature the generated link will be associated with. + */ ++ (BranchActivityItemProvider *)getBranchActivityItemWithParams:(NSDictionary *)params feature:(NSString *)feature; + +/** + Create a BranchActivityItemProvider which subclasses the `UIActivityItemProvider` This can be used for simple sharing via a `UIActivityViewController`. + + Internally, this will create a short Branch Url that will be attached to the shared content. + + @param params A dictionary to use while building up the Branch link. + @param feature The feature the generated link will be associated with. + @param stage The stage used for the generated link, typically used to indicate what part of a funnel the user is in. + */ ++ (BranchActivityItemProvider *)getBranchActivityItemWithParams:(NSDictionary *)params feature:(NSString *)feature stage:(NSString *)stage; + +/** + Create a BranchActivityItemProvider which subclasses the `UIActivityItemProvider` This can be used for simple sharing via a `UIActivityViewController`. + + Internally, this will create a short Branch Url that will be attached to the shared content. + + @param params A dictionary to use while building up the Branch link. + @param feature The feature the generated link will be associated with. + @param stage The stage used for the generated link, typically used to indicate what part of a funnel the user is in. + @param tags An array of tag strings to be associated with the link. + */ ++ (BranchActivityItemProvider *)getBranchActivityItemWithParams:(NSDictionary *)params feature:(NSString *)feature stage:(NSString *)stage tags:(NSArray *)tags; + +/** + Create a BranchActivityItemProvider which subclasses the `UIActivityItemProvider` This can be used for simple sharing via a `UIActivityViewController`. + + Internally, this will create a short Branch Url that will be attached to the shared content. + + @param params A dictionary to use while building up the Branch link. + @param feature The feature the generated link will be associated with. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @warning This can fail if the alias is already taken. + */ ++ (BranchActivityItemProvider *)getBranchActivityItemWithParams:(NSDictionary *)params feature:(NSString *)feature stage:(NSString *)stage tags:(NSArray *)tags alias:(NSString *)alias; + +/** + Create a BranchActivityItemProvider which subclasses the `UIActivityItemProvider` This can be used for simple sharing via a `UIActivityViewController`. + + Internally, this will create a short Branch Url that will be attached to the shared content. + + @param params A dictionary to use while building up the Branch link. + @param feature The feature the generated link will be associated with. + @param stage The stage used for the generated link, typically used to indicate what part of a funnel the user is in. + @param tags An array of tag strings to be associated with the link. + @param alias The alias for a link. + @params delegate A delegate allowing you to override any of the parameters provided here based on the user-selected channel + @warning This can fail if the alias is already taken. + */ ++ (BranchActivityItemProvider *)getBranchActivityItemWithParams:(NSDictionary *)params feature:(NSString *)feature stage:(NSString *)stage tags:(NSArray *)tags alias:(NSString *)alias delegate:(id )delegate; + + + +#pragma mark - Initialization methods + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Just initialize the Branch session with the app launch options. + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @warning This is not the recommended method of initializing Branch. While Branch is able to properly attribute deep linking info with the launch options, you lose the ability to do anything with a callback. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options; + +/** + Just initialize the Branch session with the app launch options, specifying whether to allow it to be treated as a referral. + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param isReferrable Boolean representing whether to allow the session to be marked as referred, overriding the default behavior. + @warning This is not the recommended method of initializing Branch. While Branch is able to properly attribute deep linking info with the launch options, you lose the ability to do anything with a callback. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options isReferrable:(BOOL)isReferrable; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param callback A callback that is called when the session is opened. This will be called multiple times during the apps life, including any time the app goes through a background / foreground cycle. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options andRegisterDeepLinkHandler:(callbackWithParams)callback; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param callback A callback that is called when the session is opened. This will be called multiple times during the apps life, including any time the app goes through a background / foreground cycle. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options andRegisterDeepLinkHandlerUsingBranchUniversalObject:(callbackWithBranchUniversalObject)callback; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param automaticallyDisplayController Boolean indicating whether we will automatically launch into deep linked controller matched in the init session dictionary. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options automaticallyDisplayDeepLinkController:(BOOL)automaticallyDisplayController; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param isReferrable Boolean representing whether to allow the session to be marked as referred, overriding the default behavior. + @param callback A callback that is called when the session is opened. This will be called multiple times during the apps life, including any time the app goes through a background / foreground cycle. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options isReferrable:(BOOL)isReferrable andRegisterDeepLinkHandler:(callbackWithParams)callback; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param isReferrable Boolean representing whether to allow the session to be marked as referred, overriding the default behavior. + @param automaticallyDisplayController Boolean indicating whether we will automatically launch into deep linked controller matched in the init session dictionary. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options isReferrable:(BOOL)isReferrable automaticallyDisplayDeepLinkController:(BOOL)automaticallyDisplayController; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param automaticallyDisplayController Boolean indicating whether we will automatically launch into deep linked controller matched in the init session dictionary. + @param callback A callback that is called when the session is opened. This will be called multiple times during the apps life, including any time the app goes through a background / foreground cycle. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options automaticallyDisplayDeepLinkController:(BOOL)automaticallyDisplayController deepLinkHandler:(callbackWithParams)callback; + +/** + Initialize the Branch session with the app launch options and handle the completion with a callback + + @param options The launch options provided by the AppDelegate's `didFinishLaunchingWithOptions:` method. + @param automaticallyDisplayController Boolean indicating whether we will automatically launch into deep linked controller matched in the init session dictionary. + @param isReferrable Boolean representing whether to allow the session to be marked as referred, overriding the default behavior. + @param callback A callback that is called when the session is opened. This will be called multiple times during the apps life, including any time the app goes through a background / foreground cycle. + */ +- (void)initSessionWithLaunchOptions:(NSDictionary *)options automaticallyDisplayDeepLinkController:(BOOL)automaticallyDisplayController isReferrable:(BOOL)isReferrable deepLinkHandler:(callbackWithParams)callback; + +/** + Allow Branch to handle a link opening the app, returning whether it was from a Branch link or not. + + @param url The url that caused the app to be opened. + */ +- (BOOL)handleDeepLink:(NSURL *)url; + +/** + Allow Branch to handle restoration from an NSUserActivity, returning whether or not it was from a Branch link. + + @param userActivity The NSUserActivity that caused the app to be opened. + */ +- (BOOL)continueUserActivity:(NSUserActivity *)userActivity; + +///-------------------------------- +/// @name Push Notification Support +///-------------------------------- + +#pragma mark - Push Notification support + +/** + Allow Branch to handle a push notification with a Branch link. + + To make use of this, when creating a push notification, specify the Branch Link as an NSString, for key @"branch". + + NSDictionary userInfo = @{@"branch": @"https://bnc.lt/...", ... }; + */ +- (void)handlePushNotification:(NSDictionary *)userInfo; + +#pragma mark - Deep Link Controller methods + +///--------------------------- +/// @name Deep Link Controller +///--------------------------- + +- (void)registerDeepLinkController:(UIViewController *)controller forKey:(NSString *)key; + +#pragma mark - Configuration methods + +///-------------------- +/// @name Configuration +///-------------------- + +/** + Have Branch treat this device / session as a debug session, causing more information to be logged, and info to be available in the debug tab of the dashboard. + + @warning This should not be used in production. + */ +- (void)setDebug; + +/** + Specify additional constant parameters to be included in the response + + @param debugParams dictionary of keystrings/valuestrings that will be added to response + */ +-(void)setDeepLinkDebugMode:(NSDictionary *)debugParams; + +/** + Add a scheme to a whitelist of URI schemes that will be tracked by Branch. Default to all schemes. + + @param the scheme to add to the whitelist, i.e. @"http", @"https" or @"myapp" + */ +-(void)addWhiteListedScheme:(NSString *)scheme; + +/** + Add an array of schemes to a whitelist of URI schemes that will be tracked by Branch. Default to all schemes. + + @param the array of schemes to add to the whitelist, i.e. @[@"http", @"https", @"myapp"] + */ +-(void)setWhiteListedSchemes:(NSArray *)schemes; + +/** + Register your Facebook SDK's FBSDKAppLinkUtility class to be used by Branch for deferred deep linking from their platform + + @param FBSDKAppLinkUtility - call [FBSDKAppLinkUtility class] after importing #import + */ +- (void)registerFacebookDeepLinkingClass:(id)FBSDKAppLinkUtility; + +/** + Specify the time to wait in seconds between retries in the case of a Branch server error + + @param retryInterval Number of seconds to wait between retries. + */ +- (void)setRetryInterval:(NSTimeInterval)retryInterval; + +/** + Specify the max number of times to retry in the case of a Branch server error + + @param maxRetries Number of retries to make. + */ +- (void)setMaxRetries:(NSInteger)maxRetries; + +/** + Specify the amount of time before a request should be considered "timed out" + + @param timeout Number of seconds to before a request is considered timed out. + */ +- (void)setNetworkTimeout:(NSTimeInterval)timeout; + +/** + Specify that Branch should use an invisible SFSafariViewController to attempt cookie-based matching. Enabled by default. + + @warning Please import SafariServices in order for this to work. + */ +- (void)disableCookieBasedMatching; + +/** + If you're using a version of the Facebook SDK that prevents application:didFinishLaunchingWithOptions: from returning + YES/true when a Universal Link is clicked, you should enable this option. + */ +- (void)accountForFacebookSDKPreventingAppLaunch; + +- (void)suppressWarningLogs; + +/** + Key-value pairs to be included in the metadata on every request. + + @param key String to be included in request metadata + @param value Object to be included in request metadata + */ +- (void)setRequestMetadataKey:(NSString *)key value:(NSObject *)value; + +#pragma mark - Session Item methods + +///-------------------- +/// @name Session Items +///-------------------- + +/** + Get the BranchUniversalObject from the first time this user was referred (can be empty). + */ +- (BranchUniversalObject *)getFirstReferringBranchUniversalObject; + +/** + Get the BranchLinkProperties from the first time this user was referred (can be empty). + */ +- (BranchLinkProperties *)getFirstReferringBranchLinkProperties; + +/** + Get the parameters used the first time this user was referred (can be empty). + */ +- (NSDictionary *)getFirstReferringParams; + +/** + Get the BranchUniversalObject from the most recent time this user was referred (can be empty). + */ +- (BranchUniversalObject *)getLatestReferringBranchUniversalObject; + +/** + Get the BranchLinkProperties from the most recent time this user was referred (can be empty). + */ +- (BranchLinkProperties *)getLatestReferringBranchLinkProperties; + +/** + Get the parameters used the most recent time this user was referred (can be empty). + */ +- (NSDictionary *)getLatestReferringParams; + +/** + Tells Branch to act as though initSession hadn't been called. Will require another open call (this is done automatically, internally). + */ +- (void)resetUserSession; + +/** + Indicates whether or not this user has a custom identity specified for them. Note that this is *independent of installs*. If you call setIdentity, this device + will have that identity associated with this user until `logout` is called. This includes persisting through uninstalls, as we track device id. + */ +- (BOOL)isUserIdentified; + +/** + Set the user's identity to an ID used by your system, so that it is identifiable by you elsewhere. + + @param userId The ID Branch should use to identify this user. + @warning If you use the same ID between users on different sessions / devices, their actions will be merged. + @warning This request is not removed from the queue upon failure -- it will be retried until it succeeds. + @warning You should call `logout` before calling `setIdentity:` a second time. + */ +- (void)setIdentity:(NSString *)userId; + +/** + Set the user's identity to an ID used by your system, so that it is identifiable by you elsewhere. Receive a completion callback, notifying you whether it succeeded or failed. + + @param userId The ID Branch should use to identify this user. + @param callback The callback to be called once the request has completed (success or failure). + @warning If you use the same ID between users on different sessions / devices, their actions will be merged. + @warning This request is not removed from the queue upon failure -- it will be retried until it succeeds. The callback will only ever be called once, though. + @warning You should call `logout` before calling `setIdentity:` a second time. + */ +- (void)setIdentity:(NSString *)userId withCallback:(callbackWithParams)callback; + +/** + Clear all of the current user's session items. + + @warning If the request to logout fails, the items will not be cleared. + */ +- (void)logout; + +- (void)logoutWithCallback:(callbackWithStatus)callback; + +#pragma mark - Credit methods + +///-------------- +/// @name Credits +///-------------- + +/** + Loads credit totals from the server. + + @param callback The callback that is called once the request has completed. + */ +- (void)loadRewardsWithCallback:(callbackWithStatus)callback; + +/** + Redeem credits from the default bucket. + + @param count The number of credits to redeem. + @warning You must `loadRewardsWithCallback:` before calling `redeemRewards`. + */ +- (void)redeemRewards:(NSInteger)count; + +/** + Redeem credits from the default bucket. + + @param count The number of credits to redeem. + @param callback The callback that is called once the request has completed. + @warning You must `loadRewardsWithCallback:` before calling `redeemRewards`. + */ +- (void)redeemRewards:(NSInteger)count callback:(callbackWithStatus)callback; + +/** + Redeem credits from the specified bucket. + + @param count The number of credits to redeem. + @param bucket The bucket to redeem credits from. + @warning You must `loadRewardsWithCallback:` before calling `redeemRewards`. + */ +- (void)redeemRewards:(NSInteger)count forBucket:(NSString *)bucket; + +/** + Redeem credits from the specified bucket. + + @param count The number of credits to redeem. + @param bucket The bucket to redeem credits from. + @param callback The callback that is called once the request has completed. + @warning You must `loadRewardsWithCallback:` before calling `redeemRewards`. + */ +- (void)redeemRewards:(NSInteger)count forBucket:(NSString *)bucket callback:(callbackWithStatus)callback; + +/** + Get the local credit balance for the default bucket. + + @warning You must `loadRewardsWithCallback:` before calling `getCredits`. This method does not make a request for the balance. + */ +- (NSInteger)getCredits; + +/** + Get the local credit balance for the specified bucket. + + @param bucket The bucket to get credits balance from. + @warning You must `loadRewardsWithCallback:` before calling `getCredits`. This method does not make a request for the balance. + */ +- (NSInteger)getCreditsForBucket:(NSString *)bucket; + +/** + Loads the last 100 credit transaction history items for the default bucket. + + @param callback The callback to call with the list of transactions. + */ +- (void)getCreditHistoryWithCallback:(callbackWithList)callback; + +/** + Loads the last 100 credit transaction history items for the specified bucket. + + @param bucket The bucket to get transaction history for. + @param callback The callback to call with the list of transactions. + */ +- (void)getCreditHistoryForBucket:(NSString *)bucket andCallback:(callbackWithList)callback; + +/** + Loads the last n credit transaction history items after the specified transaction ID for the default. + + @param creditTransactionId The ID of the transaction to start from. + @param length The number of transactions to pull. + @param order The direction to order transactions in the callback list. Least recent first means oldest items will be in the front of the response array, most recent means newest items will be front. + @param callback The callback to call with the list of transactions. + */ +- (void)getCreditHistoryAfter:(NSString *)creditTransactionId number:(NSInteger)length order:(BranchCreditHistoryOrder)order andCallback:(callbackWithList)callback; + +/** + Loads the last n credit transaction history items after the specified transaction ID for the specified bucket. + + @param bucket The bucket to get transaction history for. + @param creditTransactionId The ID of the transaction to start from. + @param length The number of transactions to pull. + @param order The direction to order transactions in the callback list. Least recent first means oldest items will be in the front of the response array, most recent means newest items will be front. + @param callback The callback to call with the list of transactions. + */ +- (void)getCreditHistoryForBucket:(NSString *)bucket after:(NSString *)creditTransactionId number:(NSInteger)length order:(BranchCreditHistoryOrder)order andCallback:(callbackWithList)callback; + +#pragma mark - Action methods + +///-------------- +/// @name Actions +///-------------- + +/** + Send a user action to the server. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc. + + @param action The action string. + */ +- (void)userCompletedAction:(NSString *)action; + +/** + Send a user action to the server with additional state items. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc. + + @param action The action string. + @param state The additional state items associated with the action. + */ +- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state; + +/** + Send a user action to the server with additional state items. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc. + + @param action The action string. + @param state The additional state items associated with the action. + @param branchViewCallback Callback for Branch view state + */ +- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state withDelegate:(id)branchViewCallback; + +#pragma mark - Short Url Sync methods + +///--------------------------------------- +/// @name Synchronous Short Url Generation +///--------------------------------------- + +/** + Get a short url without any items specified. The usage type will default to unlimited. + */ +- (NSString *)getShortURL; + +/** + Get a short url with specified params. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params; + +/** + Get a short url with specified params, channel, and feature. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature; + +/** + Get a short url with specified params, channel, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage; + +/** + Get a short url with specified params, channel, feature, stage, and alias. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @warning This method makes a synchronous url request. + @warning This can fail if the alias is already taken. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias; + +/** + Get a short url with specified params, channel, feature, stage, and type. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param type The type of link this is, one of Single Use or Unlimited Use. Single use means once *per user*, not once period. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andType:(BranchLinkType)type; + +/** + Get a short url with specified params, channel, feature, stage, and match duration. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param matchDuration How long to keep an unmatched link click in the Branch backend server's queue before discarding. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andMatchDuration:(NSUInteger)duration; + +/** + Get a short url with specified tags, params, channel, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage; + +/** + Get a short url with specified tags, params, channel, feature, stage, and alias. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @warning This method makes a synchronous url request. + @warning This can fail if the alias is already taken. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias; + +/** + Get a short url with specified tags, params, channel, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @param ignoreUAString The User Agent string to tell the server to ignore the next request from, to prevent it from treating a preview scrape as a link click. + @warning This method makes a synchronous url request. + @warning This method is primarily intended to be an internal Branch method, used to work around a bug with SLComposeViewController + @warning This can fail if the alias is already taken. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias ignoreUAString:(NSString *)ignoreUAString; + +/** + Get a short url with specified tags, params, channel, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @param ignoreUAString The User Agent string to tell the server to ignore the next request from, to prevent it from treating a preview scrape as a link click. + @param forceLinkCreation Whether we should create a link from the Branch Key even if initSession failed. Defaults to NO. + @warning This method makes a synchronous url request. + @warning This method is primarily intended to be an internal Branch method, used to work around a bug with SLComposeViewController + @warning This can fail if the alias is already taken. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias ignoreUAString:(NSString *)ignoreUAString forceLinkCreation:(BOOL)forceLinkCreation; + +/** + Get a short url with specified tags, params, channel, feature, stage, and type. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param type The type of link this is, one of Single Use or Unlimited Use. Single use means once *per user*, not once period. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andType:(BranchLinkType)type; + +/** + Get a short url with specified tags, params, channel, feature, stage, and match duration. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param matchDuration How long to keep an unmatched link click in the Branch backend server's queue before discarding. + @warning This method makes a synchronous url request. + */ +- (NSString *)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andMatchDuration:(NSUInteger)duration; + +/** + Get a short url with specified tags, params, channel, feature, stage, and match duration. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param alias The alias for a link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param matchDuration How long to keep an unmatched link click in the Branch backend server's queue before discarding. + @warning This method makes a synchronous url request. + @warning This can fail if the alias is already taken. + */ +- (NSString *)getShortUrlWithParams:(NSDictionary *)params andTags:(NSArray *)tags andAlias:(NSString *)alias andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andMatchDuration:(NSUInteger)duration; + +#pragma mark - Long Url generation + +///-------------------------- +/// @name Long Url generation +///-------------------------- + +/** + Construct a long url with specified params. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + */ +- (NSString *)getLongURLWithParams:(NSDictionary *)params; + +/** + Get a long url with specified params and feature. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + */ +- (NSString *)getLongURLWithParams:(NSDictionary *)params andFeature:(NSString *)feature; + +/** + Get a long url with specified params, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + */ +- (NSString *)getLongURLWithParams:(NSDictionary *)params andFeature:(NSString *)feature andStage:(NSString *)stage; + +/** + Get a long url with specified params, feature, stage, and tags. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param tags An array of tags to associate with this link, useful for tracking. + */ +- (NSString *)getLongURLWithParams:(NSDictionary *)params andFeature:(NSString *)feature andStage:(NSString *)stage andTags:(NSArray *)tags; + +/** + Get a long url with specified params, feature, stage, and alias. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @warning This can fail if the alias is already taken. + */ +- (NSString *)getLongURLWithParams:(NSDictionary *)params andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias; + +/** + Get a long url with specified params, channel, tags, feature, stage, and alias. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param tags An array of tags to associate with this link, useful for tracking. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @warning This can fail if the alias is already taken. + */ +- (NSString *)getLongURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andTags:(NSArray *)tags andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias; + +#pragma mark - Short Url Async methods + +///---------------------------------------- +/// @name Asynchronous Short Url Generation +///---------------------------------------- + +/** + Get a short url without any items specified. The usage type will default to unlimited. + + @param callback Callback called with the url. + */ +- (void)getShortURLWithCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, channel, and feature. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, channel, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, channel, feature, stage, and alias. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @param callback Callback called with the url. + @warning This can fail if the alias is already taken. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, channel, feature, stage, and link type. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param type The type of link this is, one of Single Use or Unlimited Use. Single use means once *per user*, not once period. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andType:(BranchLinkType)type andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, channel, feature, stage, and match duration. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param matchDuration How long to keep an unmatched link click in the Branch backend server's queue before discarding. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andMatchDuration:(NSUInteger)duration andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, tags, channel, feature, and stage. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param tags An array of tags to associate with this link, useful for tracking. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, tags, channel, feature, stage, and alias. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param tags An array of tags to associate with this link, useful for tracking. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param alias The alias for a link. + @param callback Callback called with the url. + @warning This can fail if the alias is already taken. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, tags, channel, feature, stage, and link type. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param tags An array of tags to associate with this link, useful for tracking. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param type The type of link this is, one of Single Use or Unlimited Use. Single use means once *per user*, not once period. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andType:(BranchLinkType)type andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, tags, channel, feature, stage, and match duration. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param tags An array of tags to associate with this link, useful for tracking. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param matchDuration How long to keep an unmatched link click in the Branch backend server's queue before discarding. + @param callback Callback called with the url. + */ +- (void)getShortURLWithParams:(NSDictionary *)params andTags:(NSArray *)tags andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andMatchDuration:(NSUInteger)duration andCallback:(callbackWithUrl)callback; + +/** + Get a short url with the specified params, tags, channel, feature, stage, and match duration. The usage type will default to unlimited. + + @param params Dictionary of parameters to include in the link. + @param channel The channel for the link. Examples could be Facebook, Twitter, SMS, etc, depending on where it will be shared. + @param tags An array of tags to associate with this link, useful for tracking. + @param feature The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc. + @param stage The stage used for the generated link, indicating what part of a funnel the user is in. + @param matchDuration How long to keep an unmatched link click in the Branch backend server's queue before discarding. + @param callback Callback called with the url. + @param alias The alias for a link. + @warning This can fail if the alias is already taken. + */ +- (void)getShortUrlWithParams:(NSDictionary *)params andTags:(NSArray *)tags andAlias:(NSString *)alias andMatchDuration:(NSUInteger)duration andChannel:(NSString *)channel andFeature:(NSString *)feature andStage:(NSString *)stage andCallback:(callbackWithUrl)callback; + +- (void)getSpotlightUrlWithParams:(NSDictionary *)params callback:(callbackWithParams)callback; + +#pragma mark - Content Discovery methods + +///-------------------------------- +/// @name Content Discovery methods +///-------------------------------- + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. It will not be public by default. Type defaults to kUTTypeImage. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. It will not be public by default. Type defaults to kUTTypeImage. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description callback:(callbackWithUrl)callback; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. Type defaults to kUTTypeImage. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description publiclyIndexable:(BOOL)publiclyIndexable callback:(callbackWithUrl)callback; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable callback:(callbackWithUrl)callback; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable callback:(callbackWithUrl)callback; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param keywords A set of keywords to be used in Apple's search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords callback:(callbackWithUrl)callback; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param linkParams Additional params to be added to the NSUserActivity. These will also be added to the Branch link. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param keywords A set of keywords to be used in Apple's search index. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl linkParams:(NSDictionary *)linkParams publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param linkParams Additional params to be added to the NSUserActivity. These will also be added to the Branch link. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param keywords A set of keywords to be used in Apple's search index. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl linkParams:(NSDictionary *)linkParams type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param keywords A set of keywords to be used in Apple's search index. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param keywords A set of keywords to be used in Apple's search index. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl linkParams:(NSDictionary *)linkParams publiclyIndexable:(BOOL)publiclyIndexable; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param linkParams Additional params to be added to the NSUserActivity. These will also be added to the Branch link. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param keywords A set of keywords to be used in Apple's search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ + +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl linkParams:(NSDictionary *)linkParams type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords callback:(callbackWithUrl)callback; +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param linkParams Additional params to be added to the NSUserActivity. These will also be added to the Branch link. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param keywords A set of keywords to be used in Apple's search index. + @param expirationDate ExpirationDate after which this will not appear in Apple's search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl linkParams:(NSDictionary *)linkParams type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords expirationDate:(NSDate *)expirationDate callback:(callbackWithUrl)callback; + +/** + Take the current screen and make it discoverable, adding it to Apple's Core Spotlight index. Will be public if specified. You can override the type as desired, using one of the types provided in MobileCoreServices. + + @param title Title for the spotlight preview item. + @param description Description for the spotlight preview item. + @param thumbnailUrl Url to an image to be used for the thumnbail in spotlight. + @param linkParams Additional params to be added to the NSUserActivity. These will also be added to the Branch link. + @param publiclyIndexable Whether or not this item should be added to Apple's public search index. + @param type The type to use for the NSUserActivity, taken from the list of constants provided in the MobileCoreServices framework. + @param keywords A set of keywords to be used in Apple's search index. + @param expirationDate ExpirationDate after which this will not appear in Apple's search index. + @param callback Callback called with the Branch url this will fallback to. + @warning These functions are only usable on iOS 9 or above. Earlier versions will simply receive the callback with an error. + */ +- (void)createDiscoverableContentWithTitle:(NSString *)title description:(NSString *)description thumbnailUrl:(NSURL *)thumbnailUrl linkParams:(NSDictionary *)linkParams type:(NSString *)type publiclyIndexable:(BOOL)publiclyIndexable keywords:(NSSet *)keywords expirationDate:(NSDate *)expirationDate spotlightCallback:(callbackWithUrlAndSpotlightIdentifier)spotlightCallback; + +/** + Method for creating a one of Branch instance and specifying its dependencies. + + @warning This is meant for use internally only (exposed for the sake of testing) and should not be used by apps. + */ +- (id)initWithInterface:(BNCServerInterface *)interface queue:(BNCServerRequestQueue *)queue cache:(BNCLinkCache *)cache preferenceHelper:(BNCPreferenceHelper *)preferenceHelper key:(NSString *)key; + +/** + Method used by BranchUniversalObject to register a view on content + + @warning This is meant for use internally only and should not be used by apps. + */ +- (void)registerViewWithParams:(NSDictionary *)params andCallback:(callbackWithParams)callback; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchActivityItemProvider.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchActivityItemProvider.h new file mode 100644 index 00000000..bcd4cf4d --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchActivityItemProvider.h @@ -0,0 +1,34 @@ +// +// BranchActivityItemProvider.h +// Branch-TestBed +// +// Created by Scott Hasbrouck on 1/28/15. +// Copyright (c) 2015 Branch Metrics. All rights reserved. +// + +#import + +/** + The `BranchActivityItemProviderDelegate` allows you to customize the link parameters based on the channel chosen by the user. + This is useful in the case that you want to add specific items only for Facebook or Twitter for instance. + + Every item is optional, and if not provided, will fallback to the item provided with the constructor. + */ +@protocol BranchActivityItemProviderDelegate + +@optional +- (NSDictionary *)activityItemParamsForChannel:(NSString *)channel; +- (NSArray *)activityItemTagsForChannel:(NSString *)channel; +- (NSString *)activityItemFeatureForChannel:(NSString *)channel; +- (NSString *)activityItemStageForChannel:(NSString *)channel; +- (NSString *)activityItemAliasForChannel:(NSString *)channel; +- (NSString *)activityItemOverrideChannelForChannel:(NSString *)channel; + +@end + +@interface BranchActivityItemProvider : UIActivityItemProvider + +- (id)initWithParams:(NSDictionary *)params andTags:(NSArray *)tags andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias __attribute__((deprecated(("Use the delegate method instead"))));; +- (id)initWithParams:(NSDictionary *)params tags:(NSArray *)tags feature:(NSString *)feature stage:(NSString *)stage alias:(NSString *)alias delegate:(id )delegate; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchDeepLinkingController.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchDeepLinkingController.h new file mode 100644 index 00000000..fe355452 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchDeepLinkingController.h @@ -0,0 +1,20 @@ +// +// BranchDeepLinkingController.h +// Branch-TestBed +// +// Created by Graham Mueller on 6/18/15. +// Copyright (c) 2015 Branch Metrics. All rights reserved. +// + +@protocol BranchDeepLinkingControllerCompletionDelegate + +- (void)deepLinkingControllerCompleted; + +@end + +@protocol BranchDeepLinkingController + +- (void)configureControlWithData:(NSDictionary *)data; +@property (weak, nonatomic) id deepLinkingCompletionDelegate; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchLinkProperties.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchLinkProperties.h new file mode 100644 index 00000000..1f3144b5 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchLinkProperties.h @@ -0,0 +1,26 @@ +// +// BranchLinkProperties.h +// Branch-TestBed +// +// Created by Derrick Staten on 10/16/15. +// Copyright © 2015 Branch Metrics. All rights reserved. +// + +#import + +@interface BranchLinkProperties : NSObject + +@property (nonatomic, strong) NSArray *tags; +@property (nonatomic, strong) NSString *feature; +@property (nonatomic, strong) NSString *alias; +@property (nonatomic, strong) NSString *channel; +@property (nonatomic, strong) NSString *stage; +@property (nonatomic) NSUInteger matchDuration; +@property (nonatomic, strong) NSDictionary *controlParams; + +- (void)addControlParam:(NSString *)controlParam withValue:(NSString *)value; ++ (BranchLinkProperties *)getBranchLinkPropertiesFromDictionary:(NSDictionary *)dictionary; + +- (NSString *)description; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchUniversalObject.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchUniversalObject.h new file mode 100644 index 00000000..f22540c6 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchUniversalObject.h @@ -0,0 +1,65 @@ +// +// BranchUniversalObject.h +// Branch-TestBed +// +// Created by Derrick Staten on 10/16/15. +// Copyright © 2015 Branch Metrics. All rights reserved. +// + +#import +#import "Branch.h" + +@class BranchLinkProperties; + +typedef void (^callback) (); +typedef void (^shareCompletion) (NSString *activityType, BOOL completed); + +typedef NS_ENUM(NSInteger, ContentIndexMode) { + ContentIndexModePublic, + ContentIndexModePrivate +}; + +@interface BranchUniversalObject : NSObject + +@property (nonatomic, strong) NSString *canonicalIdentifier; +@property (nonatomic, strong) NSString *canonicalUrl; +@property (nonatomic, strong) NSString *title; +@property (nonatomic, strong) NSString *contentDescription; +@property (nonatomic, strong) NSString *imageUrl; +// Note: properties found in metadata will overwrite properties on the BranchUniversalObject itself +@property (nonatomic, strong) NSDictionary *metadata; +@property (nonatomic, strong) NSString *type; +@property (nonatomic) ContentIndexMode contentIndexMode; +@property (nonatomic, strong) NSArray *keywords; +@property (nonatomic, strong) NSDate *expirationDate; +@property (nonatomic, strong) NSString *spotlightIdentifier; + +- (instancetype)initWithCanonicalIdentifier:(NSString *)canonicalIdentifier; +- (instancetype)initWithTitle:(NSString *)title; + +- (void)addMetadataKey:(NSString *)key value:(NSString *)value; + +- (void)registerView; +- (void)registerViewWithCallback:(callbackWithParams)callback; + +- (NSString *)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties; +- (NSString *)getShortUrlWithLinkPropertiesAndIgnoreFirstClick:(BranchLinkProperties *)linkProperties; +- (void)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties andCallback:(callbackWithUrl)callback; + +- (UIActivityItemProvider *)getBranchActivityItemWithLinkProperties:(BranchLinkProperties *)linkProperties; + +- (void)showShareSheetWithShareText:(NSString *)shareText completion:(shareCompletion)completion; +- (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties andShareText:(NSString *)shareText fromViewController:(UIViewController *)viewController completion:(shareCompletion)completion; +//iPad +- (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties andShareText:(NSString *)shareText fromViewController:(UIViewController *)viewController anchor:(UIBarButtonItem *)anchor completion:(shareCompletion)completion; + +- (void)listOnSpotlight; +- (void)listOnSpotlightWithCallback:(callbackWithUrl)callback; +- (void)listOnSpotlightWithIdentifierCallback:(callbackWithUrlAndSpotlightIdentifier)spotlightCallback; + +// Convenience method for initSession methods that return BranchUniversalObject, but can be used safely by anyone. ++ (BranchUniversalObject *)getBranchUniversalObjectFromDictionary:(NSDictionary *)dictionary; + +- (NSString *)description; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchView.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchView.h new file mode 100644 index 00000000..a85f1f21 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchView.h @@ -0,0 +1,49 @@ +// +// BranchView.h +// Branch-TestBed +// +// Created by Sojan P.R. on 3/4/16. +// Copyright © 2016 Branch Metrics. All rights reserved. +// + +#import +#import + +@interface BranchView : NSObject +//-------- properties-------------------// +/** + Unique ID for this Branch view + */ +@property (strong, nonatomic) NSString *branchViewID; +/** + User or Branch action associated with the Branch view + */ +@property (strong, nonatomic) NSString *branchViewAction; +/** + Number of times this Branch view can be used + */ +@property (nonatomic) NSInteger numOfUse; +/** + Web url to for showing html content for the Branch View + */ +@property (strong, nonatomic) NSString *webUrl; +/** + Html content for loading the web view + */ +@property (strong, nonatomic) NSString *webHtml; + +//---------- Methods---------------// +/** + Initialises Branch View with the given dictionary + */ +- (id)initWithBranchView:(NSDictionary *)branchViewDict andActionName:(NSString *)actionName; +/** + Check Branch view for usage limit + */ +- (BOOL)isAvailable; +/** + update the usage count for this Branch view + */ +- (void)updateUsageCount; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchViewHandler.h b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchViewHandler.h new file mode 100644 index 00000000..40a003f8 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/A/Headers/BranchViewHandler.h @@ -0,0 +1,42 @@ +// +// BNCViewHandler.h +// Branch-TestBed +// +// Created by Sojan P.R. on 3/3/16. +// Copyright © 2016 Branch Metrics. All rights reserved. +// + +#ifndef BranchViewHandler_h +#define BranchViewHandler_h + + +#endif /* BranchViewHandler_h */ +#import "BranchView.h" + + +@protocol BranchViewControllerDelegate + +- (void)branchViewVisible:(NSString *)actionName withID:(NSString *)branchViewID; +- (void)branchViewAccepted:(NSString *)actionName withID:(NSString *)branchViewID; +- (void)branchViewCancelled:(NSString *)actionName withID:(NSString *)branchViewID; +- (void)branchViewErrorCode:(NSInteger)errorCode message:(NSString *)errorMsg actionName:(NSString *)actionName withID:(NSString *)branchViewID; +@end + +@interface BranchViewHandler : NSObject +//---- Properties---------------// +/** + Callback for Branch View events + */ +@property (nonatomic, assign) id branchViewCallback; + +//-- Methods--------------------// +/** + Gets the global instance for BranchViewHandler. + */ ++ (BranchViewHandler *)getInstance; +/** + Shows a Branch view for the given action if available + */ +- (BOOL)showBranchView:(NSString *)actionName withBranchViewDictionary:(NSDictionary*)branchViewDict andWithDelegate:(id)callback; + +@end diff --git a/src/ios/dependencies/Branch.framework/Versions/Current b/src/ios/dependencies/Branch.framework/Versions/Current new file mode 120000 index 00000000..8c7e5a66 --- /dev/null +++ b/src/ios/dependencies/Branch.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file