Skip to content

Commit

Permalink
tweaks to new iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
aaustin committed Sep 15, 2016
1 parent 8e9c58a commit 5085e3c
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "BNCFabricAnswers.h"
#import "BNCPreferenceHelper.h"
#import "../Fabric/Answers.h"
#import "Answers.h"

@implementation BNCFabricAnswers

Expand Down
2 changes: 1 addition & 1 deletion src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/ios/dependencies/Branch-SDK/Branch.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#import "BranchContentDiscoverer.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";
Expand Down
Binary file modified src/ios/dependencies/Branch.framework/Versions/A/Branch
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

@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);
typedef void (^callbackWithParams) (NSDictionary * _Nonnull params, NSError * _Nullable error);
typedef void (^callbackWithUrl) (NSString * _Nonnull url, NSError * _Nullable error);
typedef void (^callbackWithStatus) (BOOL changed, NSError * _Nullable error);
typedef void (^callbackWithList) (NSArray * _Nullable list, NSError * _Nullable error);
typedef void (^callbackWithUrlAndSpotlightIdentifier) (NSString * _Nullable url, NSString * _Nullable spotlightIdentifier, NSError * _Nullable error);
typedef void (^callbackWithBranchUniversalObject) (BranchUniversalObject * _Nonnull universalObject, BranchLinkProperties * _Nonnull linkProperties, NSError * _Nullable error);

#endif /* BNCCallbacks_h */
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef Branch_SDK_Config_h
#define Branch_SDK_Config_h

#define SDK_VERSION @"0.12.5"
#define SDK_VERSION @"0.12.9"

#define BNC_PROD_ENV
//#define BNC_STAGE_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ typedef NS_ENUM(NSUInteger, BranchLinkType) {
- (void)setupChannel:(NSString *)channel;
- (void)setupFeature:(NSString *)feature;
- (void)setupStage:(NSString *)stage;
- (void)setupCampaign:(NSString *)campaign;
- (void)setupParams:(NSDictionary *)params;
- (void)setupMatchDuration:(NSUInteger)duration;
- (void)setupIgnoreUAString:(NSString *)ignoreUAString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
@property (assign, nonatomic) NSTimeInterval retryInterval;
@property (assign, nonatomic) NSTimeInterval timeout;
@property (strong, nonatomic) NSString *externalIntentURI;
@property (strong, nonatomic) NSMutableDictionary *savedAnalyticsData;

+ (BNCPreferenceHelper *)preferenceHelper;

Expand Down Expand Up @@ -68,4 +69,10 @@

- (void)log:(NSString *)filename line:(int)line message:(NSString *)format, ...;
- (void)logWarning:(NSString *)message;

- (void)saveBranchAnalyticsData:(NSDictionary *)analyticsData;
- (void)clearBranchAnalyticsData;
- (NSMutableDictionary *)getBranchAnalyticsData;
- (NSDictionary *)getContentAnalyticsManifest;
- (void)saveContentAnalyticsManifest:(NSDictionary *)cdManifest;
@end
108 changes: 93 additions & 15 deletions src/ios/dependencies/Branch.framework/Versions/A/Headers/Branch.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- (NSArray *)activityItemTagsForChannel:(NSString *)channel;
- (NSString *)activityItemFeatureForChannel:(NSString *)channel;
- (NSString *)activityItemStageForChannel:(NSString *)channel;
- (NSString *)activityItemCampaignForChannel:(NSString *)channel;
- (NSString *)activityItemAliasForChannel:(NSString *)channel;
- (NSString *)activityItemOverrideChannelForChannel:(NSString *)channel;

Expand All @@ -29,6 +30,6 @@
@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 <BranchActivityItemProviderDelegate>)delegate;
- (id)initWithParams:(NSDictionary *)params tags:(NSArray *)tags feature:(NSString *)feature stage:(NSString *)stage campaign:(NSString *)campaign alias:(NSString *)alias delegate:(id <BranchActivityItemProviderDelegate>)delegate;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@property (nonatomic, strong) NSString *alias;
@property (nonatomic, strong) NSString *channel;
@property (nonatomic, strong) NSString *stage;
@property (nonatomic, strong) NSString *campaign;
@property (nonatomic) NSUInteger matchDuration;
@property (nonatomic, strong) NSDictionary *controlParams;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

@class BranchLinkProperties;

typedef void (^callback) ();
typedef void (^shareCompletion) (NSString *activityType, BOOL completed);
typedef void (^shareCompletion) (NSString * _Nullable activityType, BOOL completed);
typedef void (^shareCompletionWithError) (NSString * _Nullable activityType, BOOL completed, NSError * _Nullable activityError);

typedef NS_ENUM(NSInteger, ContentIndexMode) {
ContentIndexModePublic,
Expand All @@ -21,45 +21,55 @@ typedef NS_ENUM(NSInteger, ContentIndexMode) {

@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;
@property (nonatomic, strong, nonnull) NSString *canonicalIdentifier;
@property (nonatomic, strong, nullable) NSString *canonicalUrl;
@property (nonatomic, strong, nullable) NSString *title;
@property (nonatomic, strong, nullable) NSString *contentDescription;
@property (nonatomic, strong, nullable) 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, strong, nullable) NSDictionary *metadata;
@property (nonatomic, strong, nullable) NSString *type;
@property (nonatomic) ContentIndexMode contentIndexMode;
@property (nonatomic, strong) NSArray *keywords;
@property (nonatomic, strong) NSDate *expirationDate;
@property (nonatomic, strong) NSString *spotlightIdentifier;
@property (nonatomic, strong, nullable) NSArray *keywords;
@property (nonatomic, strong, nullable) NSDate *expirationDate;
@property (nonatomic, strong, nullable) NSString *spotlightIdentifier;
@property (nonatomic, assign) CGFloat price;
@property (nonatomic, strong, nullable) NSString *currency;
@property (nonatomic, assign) BOOL automaticallyListOnSpotlight;

- (instancetype)initWithCanonicalIdentifier:(NSString *)canonicalIdentifier;
- (instancetype)initWithTitle:(NSString *)title;

- (void)addMetadataKey:(NSString *)key value:(NSString *)value;
- (nullable instancetype)initWithCanonicalIdentifier:(nonnull NSString *)canonicalIdentifier;
- (nullable instancetype)initWithTitle:(nonnull NSString *)title;

- (void)addMetadataKey:(nonnull NSString *)key value:(nonnull NSString *)value;

- (void)registerView;
- (void)registerViewWithCallback:(callbackWithParams)callback;
- (void)registerViewWithCallback:(nullable callbackWithParams)callback;

- (void)userCompletedAction:(nonnull NSString *)action;

- (NSString *)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties;
- (NSString *)getShortUrlWithLinkPropertiesAndIgnoreFirstClick:(BranchLinkProperties *)linkProperties;
- (void)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties andCallback:(callbackWithUrl)callback;
- (nullable NSString *)getShortUrlWithLinkProperties:(nonnull BranchLinkProperties *)linkProperties;
- (nullable NSString *)getShortUrlWithLinkPropertiesAndIgnoreFirstClick:(nonnull BranchLinkProperties *)linkProperties;
- (void)getShortUrlWithLinkProperties:(nonnull BranchLinkProperties *)linkProperties andCallback:(nonnull callbackWithUrl)callback;

- (UIActivityItemProvider *)getBranchActivityItemWithLinkProperties:(BranchLinkProperties *)linkProperties;
- (nullable UIActivityItemProvider *)getBranchActivityItemWithLinkProperties:(nonnull BranchLinkProperties *)linkProperties;

- (void)showShareSheetWithShareText:(NSString *)shareText completion:(shareCompletion)completion;
- (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties andShareText:(NSString *)shareText fromViewController:(UIViewController *)viewController completion:(shareCompletion)completion;
- (void)showShareSheetWithShareText:(nullable NSString *)shareText completion:(nullable shareCompletion)completion;
- (void)showShareSheetWithLinkProperties:(nullable BranchLinkProperties *)linkProperties andShareText:(nullable NSString *)shareText fromViewController:(nullable UIViewController *)viewController completion:(nullable shareCompletion)completion;
// Returns with activityError as well
- (void)showShareSheetWithLinkProperties:(nullable BranchLinkProperties *)linkProperties andShareText:(nullable NSString *)shareText fromViewController:(nullable UIViewController *)viewController completionWithError:(nullable shareCompletionWithError)completion;
//iPad
- (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties andShareText:(NSString *)shareText fromViewController:(UIViewController *)viewController anchor:(UIBarButtonItem *)anchor completion:(shareCompletion)completion;
- (void)showShareSheetWithLinkProperties:(nullable BranchLinkProperties *)linkProperties andShareText:(nullable NSString *)shareText fromViewController:(nullable UIViewController *)viewController anchor:(nullable UIBarButtonItem *)anchor completion:(nullable shareCompletion)completion;
// Returns with activityError as well
- (void)showShareSheetWithLinkProperties:(nullable BranchLinkProperties *)linkProperties andShareText:(nullable NSString *)shareText fromViewController:(nullable UIViewController *)viewController anchor:(nullable UIBarButtonItem *)anchor completionWithError:(nullable shareCompletionWithError)completion;

- (void)listOnSpotlight;
- (void)listOnSpotlightWithCallback:(callbackWithUrl)callback;
- (void)listOnSpotlightWithIdentifierCallback:(callbackWithUrlAndSpotlightIdentifier)spotlightCallback;
- (void)listOnSpotlightWithCallback:(nullable callbackWithUrl)callback;
- (void)listOnSpotlightWithIdentifierCallback:(nullable callbackWithUrlAndSpotlightIdentifier)spotlightCallback __attribute__((deprecated(("iOS 10 has changed how Spotlight indexing works and we’ve updated the SDK to reflect this. Please see https://dev.branch.io/features/spotlight-indexing/overview/ for instructions on migration"))));;

// Convenience method for initSession methods that return BranchUniversalObject, but can be used safely by anyone.
+ (BranchUniversalObject *)getBranchUniversalObjectFromDictionary:(NSDictionary *)dictionary;
+ (nonnull BranchUniversalObject *)getBranchUniversalObjectFromDictionary:(nonnull NSDictionary *)dictionary;

- (NSString *)description;
- (nonnull NSString *)description;

@end

0 comments on commit 5085e3c

Please sign in to comment.