From e235ec8904d8d94d1aca46a376915c4c61a15131 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:45:34 -0700 Subject: [PATCH] Release 1.44.0 - SDK-1658 Added Support for VIEW_AD, INITIATE_STREAM, COMPLETE_STREAM and all V2 Events as Standard events - SDK-1480 [iOS 16] Added UIPaste Support for NativeLink Flow --- Branch-SDK/BNCConfig.m | 2 +- Branch-SDK/BNCPreferenceHelper.h | 5 +- Branch-SDK/BNCPreferenceHelper.m | 10 + Branch-SDK/Branch.h | 11 + Branch-SDK/Branch.m | 25 ++- Branch-SDK/BranchEvent.h | 3 + Branch-SDK/BranchEvent.m | 4 + Branch-SDK/BranchInstallRequest.m | 15 +- Branch-SDK/BranchOpenRequest.h | 1 + Branch-SDK/BranchOpenRequest.m | 19 ++ Branch-SDK/BranchPasteControl.h | 25 +++ Branch-SDK/BranchPasteControl.m | 55 +++++ .../Branch-SDK-Tests/BNCPasteboardTests.m | 25 +++ .../Branch-SDK-Tests/BranchEvent.Test.m | 45 ++++ .../Branch-TestBed.xcodeproj/project.pbxproj | 14 ++ Branch-TestBed/Branch-TestBed/Main.storyboard | 198 +++++++++++++++--- .../PasteControlViewController.h | 17 ++ .../PasteControlViewController.m | 79 +++++++ .../Branch-TestBed/ViewController.m | 35 +--- Branch-TestBed/Framework-Info.plist | Bin 568 -> 568 bytes Branch.podspec | 9 +- ChangeLog.md | 10 + Package.swift | 4 +- .../BranchSDK.xcodeproj/project.pbxproj | 40 ++-- carthage-files/checksum.txt | 2 +- carthage-files/checksum_noidfa.txt | 2 +- carthage-files/checksum_static.txt | 2 +- carthage-files/checksum_static_noidfa.txt | 2 +- scripts/version.sh | 2 +- 29 files changed, 573 insertions(+), 88 deletions(-) create mode 100644 Branch-SDK/BranchPasteControl.h create mode 100644 Branch-SDK/BranchPasteControl.m create mode 100644 Branch-TestBed/Branch-TestBed/PasteControlViewController.h create mode 100644 Branch-TestBed/Branch-TestBed/PasteControlViewController.m diff --git a/Branch-SDK/BNCConfig.m b/Branch-SDK/BNCConfig.m index 6e24bd2..b8db9a0 100644 --- a/Branch-SDK/BNCConfig.m +++ b/Branch-SDK/BNCConfig.m @@ -11,4 +11,4 @@ NSString * const BNC_API_BASE_URL = @"https://api2.branch.io"; NSString * const BNC_API_VERSION = @"v1"; NSString * const BNC_LINK_URL = @"https://bnc.lt"; -NSString * const BNC_SDK_VERSION = @"1.43.2"; +NSString * const BNC_SDK_VERSION = @"1.44.0"; diff --git a/Branch-SDK/BNCPreferenceHelper.h b/Branch-SDK/BNCPreferenceHelper.h index ce49304..55e5486 100644 --- a/Branch-SDK/BNCPreferenceHelper.h +++ b/Branch-SDK/BNCPreferenceHelper.h @@ -29,9 +29,10 @@ NSURL* /* _Nonnull */ BNCURLForBranchDirectory(void); @property (copy, nonatomic) NSString *sessionID; @property (copy, nonatomic) NSString *linkClickIdentifier; @property (copy, nonatomic) NSString *spotlightIdentifier; -@property (copy, nonatomic) NSString *universalLinkUrl; -@property (copy, nonatomic) NSString *initialReferrer; +@property (copy, nonatomic) NSString *universalLinkUrl; +@property (copy, nonatomic) NSString *initialReferrer; @property (copy, nonatomic) NSString *userUrl; +@property (copy, nonatomic) NSString *localUrl; @property (copy, nonatomic) NSString *userIdentity; @property (copy, nonatomic) NSString *sessionParams; @property (copy, nonatomic) NSString *installParams; diff --git a/Branch-SDK/BNCPreferenceHelper.m b/Branch-SDK/BNCPreferenceHelper.m index caccae1..9639e60 100644 --- a/Branch-SDK/BNCPreferenceHelper.m +++ b/Branch-SDK/BNCPreferenceHelper.m @@ -36,6 +36,7 @@ static NSString * const BRANCH_PREFS_KEY_LINK_CLICK_IDENTIFIER = @"bnc_link_click_identifier"; static NSString * const BRANCH_PREFS_KEY_SPOTLIGHT_IDENTIFIER = @"bnc_spotlight_identifier"; static NSString * const BRANCH_PREFS_KEY_UNIVERSAL_LINK_URL = @"bnc_universal_link_url"; +static NSString * const BRANCH_PREFS_KEY_LOCAL_URL = @"bnc_local_url"; static NSString * const BRANCH_PREFS_KEY_INITIAL_REFERRER = @"bnc_initial_referrer"; static NSString * const BRANCH_PREFS_KEY_SESSION_PARAMS = @"bnc_session_params"; static NSString * const BRANCH_PREFS_KEY_INSTALL_PARAMS = @"bnc_install_params"; @@ -80,6 +81,7 @@ @implementation BNCPreferenceHelper installParams = _installParams, universalLinkUrl = _universalLinkUrl, initialReferrer = _initialReferrer, + localUrl = _localUrl, externalIntentURI = _externalIntentURI, isDebug = _isDebug, retryCount = _retryCount, @@ -325,6 +327,14 @@ - (void)setUniversalLinkUrl:(NSString *)universalLinkUrl { [self writeObjectToDefaults:BRANCH_PREFS_KEY_UNIVERSAL_LINK_URL value:universalLinkUrl]; } +- (NSString *)localUrl { + return [self readStringFromDefaults:BRANCH_PREFS_KEY_LOCAL_URL]; +} + +- (void)setLocalUrl:(NSString *)localURL { + [self writeObjectToDefaults:BRANCH_PREFS_KEY_LOCAL_URL value:localURL]; +} + - (NSString *)initialReferrer { return [self readStringFromDefaults:BRANCH_REQUEST_KEY_INITIAL_REFERRER]; } diff --git a/Branch-SDK/Branch.h b/Branch-SDK/Branch.h index 12c06af..beb8bc4 100644 --- a/Branch-SDK/Branch.h +++ b/Branch-SDK/Branch.h @@ -10,6 +10,7 @@ @import Foundation; #else #import +#import #endif #import "BNCCallbacks.h" @@ -1838,6 +1839,16 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) { // Read-only property exposed for unit testing. @property (strong, readonly) BNCServerInterface* serverInterface; - (void) clearNetworkQueue; + +#if !TARGET_OS_TV +#pragma mark - UIPasteControl Support +/** + This method is used to pass paste board items to Branch SDK when user implements UIPasteControl at their end. SDK retrives URL from these item providers if any to support native link functionality. + @param itemProviders - an array of item providers collected from pasteboard. + @warning This function works with iOS 16 or above. + */ +- (void)passPasteItemProviders:(NSArray *)itemProviders API_AVAILABLE(ios(16)); +#endif @end NS_ASSUME_NONNULL_END diff --git a/Branch-SDK/Branch.m b/Branch-SDK/Branch.m index 86bb565..576014c 100644 --- a/Branch-SDK/Branch.m +++ b/Branch-SDK/Branch.m @@ -1592,6 +1592,30 @@ - (void)removeAllPrivateContentFromSpotLightWithCallback:(void (^)(NSError * err } #endif +#if !TARGET_OS_TV +#pragma mark - UIPasteControl Support methods + +- (void)passPasteItemProviders:(NSArray *)itemProviders { + + // 1. Extract URL from NSItemProvider arrary + for (NSItemProvider* item in itemProviders){ + if ( [item hasItemConformingToTypeIdentifier: UTTypeURL.identifier] ) { + // 2. Check if URL is branch URL and if yes -> store it. + [item loadItemForTypeIdentifier:UTTypeURL.identifier options:NULL completionHandler:^(NSURL *url, NSError * _Null_unspecified error) { + if (error) { + BNCLogError([NSString stringWithFormat:@"%@", error]); + } + else if ([Branch isBranchLink:url.absoluteString]) { + [self.preferenceHelper setLocalUrl:[url absoluteString]]; + // 3. Send Open Event + [[Branch getInstance] handleDeepLink:url]; + } + }]; + } + } +} +#endif + #pragma mark - Private methods + (Branch *)getInstanceInternal:(NSString *)key { @@ -2124,7 +2148,6 @@ - (void)initUserSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSStr // callback on main, this is generally what the client expects and maintains our previous behavior dispatch_async(dispatch_get_main_queue(), ^ { - if (self.sceneSessionInitWithCallback) { BNCInitSessionResponse *response = [BNCInitSessionResponse new]; response.params = [self getLatestReferringParams]; diff --git a/Branch-SDK/BranchEvent.h b/Branch-SDK/BranchEvent.h index f3b7d6e..d087aa2 100644 --- a/Branch-SDK/BranchEvent.h +++ b/Branch-SDK/BranchEvent.h @@ -35,6 +35,9 @@ FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventViewItem; FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventViewItems; FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventRate; FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventShare; +FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventInitiateStream; +FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventCompleteStream; + ///@name User Lifecycle Events diff --git a/Branch-SDK/BranchEvent.m b/Branch-SDK/BranchEvent.m index b7635c5..337868b 100644 --- a/Branch-SDK/BranchEvent.m +++ b/Branch-SDK/BranchEvent.m @@ -36,6 +36,8 @@ BranchStandardEvent BranchStandardEventViewItems = @"VIEW_ITEMS"; BranchStandardEvent BranchStandardEventRate = @"RATE"; BranchStandardEvent BranchStandardEventShare = @"SHARE"; +BranchStandardEvent BranchStandardEventInitiateStream = @"INITIATE_STREAM"; +BranchStandardEvent BranchStandardEventCompleteStream = @"COMPLETE_STREAM"; // User Lifecycle Events @@ -245,6 +247,8 @@ - (NSDictionary*) dictionary { BranchStandardEventViewAd, BranchStandardEventOptOut, BranchStandardEventOptIn, + BranchStandardEventInitiateStream, + BranchStandardEventCompleteStream ]; } diff --git a/Branch-SDK/BranchInstallRequest.m b/Branch-SDK/BranchInstallRequest.m index 1004e47..7b88e66 100644 --- a/Branch-SDK/BranchInstallRequest.m +++ b/Branch-SDK/BranchInstallRequest.m @@ -26,6 +26,7 @@ - (id)initWithCallback:(callbackWithStatus)callback { - (void)makeRequest:(BNCServerInterface *)serverInterface key:(NSString *)key callback:(BNCServerCallback)callback { BNCPreferenceHelper *preferenceHelper = [BNCPreferenceHelper sharedInstance]; NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; + super.clearLocalURL = FALSE; [self safeSetValue:[BNCSystemObserver getBundleID] forKey:BRANCH_REQUEST_KEY_BUNDLE_ID onDict:params]; [self safeSetValue:[BNCSystemObserver getTeamIdentifier] forKey:BRANCH_REQUEST_KEY_TEAM_ID onDict:params]; @@ -69,7 +70,19 @@ - (void)makeRequest:(BNCServerInterface *)serverInterface key:(NSString *)key ca } if ([BNCPasteboard sharedInstance].checkOnInstall) { - NSURL *pasteboardURL = [[BNCPasteboard sharedInstance] checkForBranchLink]; + NSURL *pasteboardURL = nil; + if (@available(iOS 16.0, *)) { + NSString *localURLString = [[BNCPreferenceHelper sharedInstance] localUrl]; + if(localURLString){ + pasteboardURL = [[NSURL alloc] initWithString:localURLString]; + super.clearLocalURL = TRUE; + } else { + pasteboardURL = [[BNCPasteboard sharedInstance] checkForBranchLink]; + } + } else { + pasteboardURL = [[BNCPasteboard sharedInstance] checkForBranchLink]; + } + if (pasteboardURL) { [self safeSetValue:pasteboardURL.absoluteString forKey:BRANCH_REQUEST_KEY_LOCAL_URL onDict:params]; } diff --git a/Branch-SDK/BranchOpenRequest.h b/Branch-SDK/BranchOpenRequest.h index e656c3d..305bf4a 100644 --- a/Branch-SDK/BranchOpenRequest.h +++ b/Branch-SDK/BranchOpenRequest.h @@ -12,6 +12,7 @@ @interface BranchOpenRequest : BNCServerRequest @property (nonatomic, copy) callbackWithStatus callback; +@property (assign, nonatomic) BOOL clearLocalURL; + (void) waitForOpenResponseLock; + (void) releaseOpenResponseLock; diff --git a/Branch-SDK/BranchOpenRequest.m b/Branch-SDK/BranchOpenRequest.m index c5001e0..4c92f0e 100644 --- a/Branch-SDK/BranchOpenRequest.m +++ b/Branch-SDK/BranchOpenRequest.m @@ -43,6 +43,7 @@ - (id)initWithCallback:(callbackWithStatus)callback isInstall:(BOOL)isInstall { } - (void)makeRequest:(BNCServerInterface *)serverInterface key:(NSString *)key callback:(BNCServerCallback)callback { + self.clearLocalURL = FALSE; NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; BNCPreferenceHelper *preferenceHelper = [BNCPreferenceHelper sharedInstance]; @@ -100,6 +101,17 @@ - (void)makeRequest:(BNCServerInterface *)serverInterface key:(NSString *)key ca if (partnerParameters.count > 0) { [self safeSetValue:partnerParameters forKey:BRANCH_REQUEST_KEY_PARTNER_PARAMETERS onDict:params]; } + + if (@available(iOS 16.0, *)) { + NSString *localURLString = [[BNCPreferenceHelper sharedInstance] localUrl]; + if(localURLString){ + NSURL *localURL = [[NSURL alloc] initWithString:localURLString]; + if (localURL) { + [self safeSetValue:localURL.absoluteString forKey:BRANCH_REQUEST_KEY_LOCAL_URL onDict:params]; + self.clearLocalURL = TRUE; + } + } + } BNCApplication *application = [BNCApplication currentApplication]; params[@"lastest_update_time"] = BNCWireFormatFromDate(application.currentBuildDate); @@ -269,6 +281,13 @@ - (void)processResponse:(BNCServerResponse *)response error:(NSError *)error { preferenceHelper.randomizedBundleToken = string; } + if (self.clearLocalURL) { + preferenceHelper.localUrl = nil; +#if !TARGET_OS_TV + UIPasteboard.generalPasteboard.URL = nil; +#endif + } + [BranchOpenRequest releaseOpenResponseLock]; BranchContentDiscoveryManifest *cdManifest = [BranchContentDiscoveryManifest getInstance]; diff --git a/Branch-SDK/BranchPasteControl.h b/Branch-SDK/BranchPasteControl.h new file mode 100644 index 0000000..d163c07 --- /dev/null +++ b/Branch-SDK/BranchPasteControl.h @@ -0,0 +1,25 @@ +// +// BranchPasteControl.h +// Branch +// +// Created by Nidhi Dixit on 9/26/22. +// Copyright © 2022 Branch, Inc. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000 +API_AVAILABLE(ios(16.0)) +@interface BranchPasteControl : UIView + +// This is designated initializer. All other initializers are blocked. +- (instancetype)initWithFrame:(CGRect)frame AndConfiguration:( UIPasteControlConfiguration * _Nullable) config NS_DESIGNATED_INITIALIZER; +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE; + +@end +#endif +NS_ASSUME_NONNULL_END diff --git a/Branch-SDK/BranchPasteControl.m b/Branch-SDK/BranchPasteControl.m new file mode 100644 index 0000000..1328d2b --- /dev/null +++ b/Branch-SDK/BranchPasteControl.m @@ -0,0 +1,55 @@ +// +// BranchPasteControl.m +// Branch +// +// Created by Nidhi Dixit on 9/26/22. +// Copyright © 2022 Branch, Inc. All rights reserved. +// + +#import "BranchPasteControl.h" +#import "Branch.h" + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000 + +@implementation BranchPasteControl + +@synthesize pasteConfiguration; + +// Make it designated initializer and block all others. +- (instancetype)initWithFrame:(CGRect)frame AndConfiguration:( UIPasteControlConfiguration * _Nullable) config { + + self = [super initWithFrame:frame]; + if(self){ + // 1. Create a UIPasteControl with dimensions = frame or with given configuration // 2. add it as subview to current view + UIPasteControl *pc; + CGRect rect = CGRectMake(0, 0, frame.size.width, frame.size.height); + + if(config){ + pc = [[UIPasteControl alloc] initWithConfiguration:config]; + pc.frame = rect; + } else { + + pc = [[UIPasteControl alloc] initWithFrame:rect]; + } + [self addSubview:pc]; + + // 3. Setup pasteConfiguration + pasteConfiguration = [[UIPasteConfiguration alloc] initWithAcceptableTypeIdentifiers:@[UTTypeURL.identifier]]; + pc.target = self; + } + return self; +} + +- (void)pasteItemProviders:(NSArray *)itemProviders { + [[Branch getInstance] passPasteItemProviders:itemProviders]; +} + +- (BOOL)canPasteItemProviders:(NSArray *)itemProviders { + for (NSItemProvider* item in itemProviders) + if ( [item hasItemConformingToTypeIdentifier: UTTypeURL.identifier] ) + return true; + return false; +} + +@end +#endif diff --git a/Branch-TestBed/Branch-SDK-Tests/BNCPasteboardTests.m b/Branch-TestBed/Branch-SDK-Tests/BNCPasteboardTests.m index 22631f7..5daf59b 100644 --- a/Branch-TestBed/Branch-SDK-Tests/BNCPasteboardTests.m +++ b/Branch-TestBed/Branch-SDK-Tests/BNCPasteboardTests.m @@ -8,6 +8,7 @@ #import #import "BNCPasteboard.h" +#import "Branch.h" @interface BNCPasteboardTests : XCTestCase @@ -152,4 +153,28 @@ - (void)testCheckForBranchLink_noLink { [self clearPasteboard]; } + +- (void) testPassPasteControl { +#if !TARGET_OS_TV + if (@available(iOS 16.0, *)) { + + long long timeStamp = ([[NSDate date] timeIntervalSince1970] - 5*60)*1000; // 5 minute earlier timestamp + NSString *urlString = [NSString stringWithFormat:@"https://bnctestbed-alternate.app.link/9R7MbTmnRtb?__branch_flow_type=viewapp&__branch_flow_id=1105940563590163783&__branch_mobile_deepview_type=1&nl_opt_in=1&_cpts=%lld", timeStamp]; + NSURL *testURL = [[NSURL alloc] initWithString:urlString]; + + NSArray *itemProviders = @[[[NSItemProvider alloc] initWithItem:testURL typeIdentifier:UTTypeURL.identifier]]; + XCTestExpectation *openExpectation = [self expectationWithDescription:@"Test open"]; + + [[Branch getInstance] initSessionWithLaunchOptions:@{} andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) { + [openExpectation fulfill]; + XCTAssertNil(error); + }]; + + [[Branch getInstance] passPasteItemProviders:itemProviders]; + [self waitForExpectationsWithTimeout:5.0 handler:NULL]; + + } +#endif +} + @end diff --git a/Branch-TestBed/Branch-SDK-Tests/BranchEvent.Test.m b/Branch-TestBed/Branch-SDK-Tests/BranchEvent.Test.m index ab249dd..04d7e66 100644 --- a/Branch-TestBed/Branch-SDK-Tests/BranchEvent.Test.m +++ b/Branch-TestBed/Branch-SDK-Tests/BranchEvent.Test.m @@ -685,6 +685,51 @@ - (void)testCustomOptOutEvent { XCTAssert([request.serverURL.absoluteString containsString:@"branch.io/v2/event/standard"]); } + +- (void)testStandardInitiateStreamEvent { + BranchEvent *event = [BranchEvent standardEvent:BranchStandardEventInitiateStream]; + + NSDictionary *eventDictionary = [event buildEventDictionary]; + XCTAssertNotNil(eventDictionary); + XCTAssert([eventDictionary[@"name"] isEqualToString:@"INITIATE_STREAM"]); + + BranchEventRequest *request = [event buildRequestWithEventDictionary:eventDictionary]; + XCTAssert([request.serverURL.absoluteString containsString:@"branch.io/v2/event/standard"]); +} + +- (void)testCustomInitiateStreamEvent { + BranchEvent *event = [BranchEvent customEventWithName:@"INITIATE_STREAM"]; + + NSDictionary *eventDictionary = [event buildEventDictionary]; + XCTAssertNotNil(eventDictionary); + XCTAssert([eventDictionary[@"name"] isEqualToString:@"INITIATE_STREAM"]); + + BranchEventRequest *request = [event buildRequestWithEventDictionary:eventDictionary]; + XCTAssert([request.serverURL.absoluteString containsString:@"branch.io/v2/event/standard"]); +} + +- (void)testStandardCompleteStreamEvent { + BranchEvent *event = [BranchEvent standardEvent:BranchStandardEventCompleteStream]; + + NSDictionary *eventDictionary = [event buildEventDictionary]; + XCTAssertNotNil(eventDictionary); + XCTAssert([eventDictionary[@"name"] isEqualToString:@"COMPLETE_STREAM"]); + + BranchEventRequest *request = [event buildRequestWithEventDictionary:eventDictionary]; + XCTAssert([request.serverURL.absoluteString containsString:@"branch.io/v2/event/standard"]); +} + +- (void)testCustomCompleteStreamEvent { + BranchEvent *event = [BranchEvent customEventWithName:@"COMPLETE_STREAM"]; + + NSDictionary *eventDictionary = [event buildEventDictionary]; + XCTAssertNotNil(eventDictionary); + XCTAssert([eventDictionary[@"name"] isEqualToString:@"COMPLETE_STREAM"]); + + BranchEventRequest *request = [event buildRequestWithEventDictionary:eventDictionary]; + XCTAssert([request.serverURL.absoluteString containsString:@"branch.io/v2/event/standard"]); +} + - (void)testJsonStringForAdTypeNone { BranchEvent *event = [BranchEvent standardEvent:BranchStandardEventViewAd]; XCTAssertNil([event jsonStringForAdType:BranchEventAdTypeNone]); diff --git a/Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj b/Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj index ffd2b8b..83b4dd6 100644 --- a/Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj +++ b/Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj @@ -278,6 +278,9 @@ C1614D5C285BD4AF0098946B /* BranchPluginSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = C1614D5A285BD4AF0098946B /* BranchPluginSupport.h */; }; C1614D5D285BD4AF0098946B /* BranchPluginSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = C1614D5B285BD4AF0098946B /* BranchPluginSupport.m */; }; E2B9474A1D15D75000F2270D /* BNCCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = E2B947491D15D73900F2270D /* BNCCallbacks.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E72489D228E40D0200DCD8FD /* PasteControlViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E72489D128E40D0200DCD8FD /* PasteControlViewController.m */; }; + E729974D28E2BBFA007D91B2 /* BranchPasteControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E729974B28E2BBFA007D91B2 /* BranchPasteControl.h */; }; + E729974E28E2BBFA007D91B2 /* BranchPasteControl.m in Sources */ = {isa = PBXBuildFile; fileRef = E729974C28E2BBFA007D91B2 /* BranchPasteControl.m */; }; F185BAAA1F3D30D70056300C /* BNCSpotlightService.h in Headers */ = {isa = PBXBuildFile; fileRef = F185BAA81F3D30D70056300C /* BNCSpotlightService.h */; }; F185BAAB1F3D30D70056300C /* BNCSpotlightService.m in Sources */ = {isa = PBXBuildFile; fileRef = F185BAA91F3D30D70056300C /* BNCSpotlightService.m */; }; F1CF14111F4CC79F00BB2694 /* CoreSpotlight.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67F270881BA9FCFF002546A7 /* CoreSpotlight.framework */; settings = {ATTRIBUTES = (Required, ); }; }; @@ -623,6 +626,10 @@ D258D2C41A794D64004A1C90 /* BranchActivityItemProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BranchActivityItemProvider.h; sourceTree = ""; }; D258D2C51A794D64004A1C90 /* BranchActivityItemProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BranchActivityItemProvider.m; sourceTree = ""; }; E2B947491D15D73900F2270D /* BNCCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BNCCallbacks.h; sourceTree = ""; }; + E72489D028E40D0200DCD8FD /* PasteControlViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasteControlViewController.h; sourceTree = ""; }; + E72489D128E40D0200DCD8FD /* PasteControlViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PasteControlViewController.m; sourceTree = ""; }; + E729974B28E2BBFA007D91B2 /* BranchPasteControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BranchPasteControl.h; sourceTree = ""; }; + E729974C28E2BBFA007D91B2 /* BranchPasteControl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BranchPasteControl.m; sourceTree = ""; }; F185BAA81F3D30D70056300C /* BNCSpotlightService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BNCSpotlightService.h; sourceTree = ""; }; F185BAA91F3D30D70056300C /* BNCSpotlightService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCSpotlightService.m; sourceTree = ""; }; F1D3591E1ED4DCC500A93FD5 /* BNCDeepLinkViewControllerInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BNCDeepLinkViewControllerInstance.h; sourceTree = ""; }; @@ -886,6 +893,8 @@ 63E4C4861D25E16A00A45FD8 /* LogOutputViewController.h */, 63E4C4871D25E16A00A45FD8 /* LogOutputViewController.m */, 4DBEFFFB1FB12A1000F7C41B /* Main.storyboard */, + E72489D028E40D0200DCD8FD /* PasteControlViewController.h */, + E72489D128E40D0200DCD8FD /* PasteControlViewController.m */, 63E4C4891D25E17B00A45FD8 /* NavigationController.h */, 63E4C48A1D25E17B00A45FD8 /* NavigationController.m */, 6700166A1940F51400A9E103 /* Supporting Files */, @@ -995,6 +1004,8 @@ 5F92B2382383703700CA909B /* BNCLocale.m */, 5F4101F326851DC7003699AD /* BNCPasteboard.h */, 5F4101F426851DC7003699AD /* BNCPasteboard.m */, + E729974B28E2BBFA007D91B2 /* BranchPasteControl.h */, + E729974C28E2BBFA007D91B2 /* BranchPasteControl.m */, 5FB0AA69231875B400A0F9EA /* BNCUserAgentCollector.h */, 5FB0AA6A231875B500A0F9EA /* BNCUserAgentCollector.m */, 464EA3991ACB38EC000E4094 /* BNCEncodingUtils.h */, @@ -1101,6 +1112,7 @@ 4DCAC80A1F426F7C00405D1D /* BNCLinkData.h in Headers */, 5F38021824DCC2E800E6FAFD /* BranchUserCompletedActionRequest.h in Headers */, 5F73FC7E23313F7A000EBD32 /* BNCJSONUtility.h in Headers */, + E729974D28E2BBFA007D91B2 /* BranchPasteControl.h in Headers */, 4DCAC80B1F426F7C00405D1D /* BNCLog.h in Headers */, 4DCAC80C1F426F7C00405D1D /* BNCPreferenceHelper.h in Headers */, 4DCAC8101F426F7C00405D1D /* Branch.h in Headers */, @@ -1450,6 +1462,7 @@ 5F38021924DCC2E800E6FAFD /* BranchUserCompletedActionRequest.m in Sources */, 4DB328001FA10B9000ACF9B0 /* BranchDelegate.m in Sources */, 5F38022F24DCC2E800E6FAFD /* BranchSpotlightUrlRequest.m in Sources */, + E729974E28E2BBFA007D91B2 /* BranchPasteControl.m in Sources */, 5F892EB82360EFE90023AEC1 /* BNCAppleSearchAds.m in Sources */, 466B58591B17779C00A69EDE /* BNCPreferenceHelper.m in Sources */, 4D8999ED1DC108FF00F7EE0A /* BNCAvailability.m in Sources */, @@ -1520,6 +1533,7 @@ 63E4C4881D25E16A00A45FD8 /* LogOutputViewController.m in Sources */, 6700167A1940F51400A9E103 /* ViewController.m in Sources */, 4DBEFFF61FB114F900F7C41B /* ArrayPickerView.m in Sources */, + E72489D228E40D0200DCD8FD /* PasteControlViewController.m in Sources */, 4683F0761B20A73F00A432E7 /* AppDelegate.m in Sources */, 670016701940F51400A9E103 /* main.m in Sources */, 63E4C48B1D25E17B00A45FD8 /* NavigationController.m in Sources */, diff --git a/Branch-TestBed/Branch-TestBed/Main.storyboard b/Branch-TestBed/Branch-TestBed/Main.storyboard index d4da7f9..b6018c8 100644 --- a/Branch-TestBed/Branch-TestBed/Main.storyboard +++ b/Branch-TestBed/Branch-TestBed/Main.storyboard @@ -1,12 +1,116 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,7 +160,7 @@ - + @@ -79,7 +183,7 @@ - + @@ -108,7 +212,7 @@ - + @@ -134,7 +238,7 @@ - + @@ -179,7 +283,7 @@ - + @@ -208,7 +312,7 @@ - + @@ -237,7 +341,7 @@ - + @@ -266,7 +370,7 @@ - + @@ -295,7 +399,7 @@ - + @@ -324,7 +428,7 @@ - + @@ -353,7 +457,7 @@ - + @@ -383,7 +487,7 @@ - + @@ -413,7 +517,7 @@ - + @@ -443,7 +547,7 @@ - + @@ -473,7 +577,7 @@ - + @@ -503,13 +607,13 @@ - + - + + + + + + - + - + + + + @@ -728,4 +862,12 @@ + + + + + + + + diff --git a/Branch-TestBed/Branch-TestBed/PasteControlViewController.h b/Branch-TestBed/Branch-TestBed/PasteControlViewController.h new file mode 100644 index 0000000..5cef300 --- /dev/null +++ b/Branch-TestBed/Branch-TestBed/PasteControlViewController.h @@ -0,0 +1,17 @@ +// +// PasteControlViewController.h +// Branch-TestBed +// +// Created by Nidhi Dixit on 9/27/22. +// Copyright © 2022 Branch, Inc. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PasteControlViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/Branch-TestBed/Branch-TestBed/PasteControlViewController.m b/Branch-TestBed/Branch-TestBed/PasteControlViewController.m new file mode 100644 index 0000000..614de43 --- /dev/null +++ b/Branch-TestBed/Branch-TestBed/PasteControlViewController.m @@ -0,0 +1,79 @@ +// +// PasteControlViewController.m +// Branch-TestBed +// +// Created by Nidhi Dixit on 9/27/22. +// Copyright © 2022 Branch, Inc. All rights reserved. +// + +#import "PasteControlViewController.h" +#import "Branch.h" +#import "BranchOpenRequest.h" +#import "BranchPasteControl.h" +#import "LogOutputViewController.h" +#import "AppDelegate.h" + +@interface PasteControlViewController () +@property (weak, nonatomic) IBOutlet UIView *applePasteControlView; +@property (weak, nonatomic) IBOutlet UIView *branchPasteControlView; + +@end + +@implementation PasteControlViewController + +@synthesize pasteConfiguration; + +- (void)viewDidLoad { + [super viewDidLoad]; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000 + if (@available(iOS 16.0, *)) { + + CGRect rectPC = CGRectMake(0, 0, _applePasteControlView.frame.size.width, _applePasteControlView.frame.size.height); + UIPasteControl *pc = [[UIPasteControl alloc] initWithFrame:rectPC]; + pc.target = self; + [_applePasteControlView addSubview:pc]; + + CGRect rectBC = CGRectMake(0, 0, _branchPasteControlView.frame.size.width, _branchPasteControlView.frame.size.height); + BranchPasteControl *bc = [[BranchPasteControl alloc] initWithFrame:rectBC AndConfiguration:nil]; + [_branchPasteControlView addSubview:bc]; + + pasteConfiguration = [[UIPasteConfiguration alloc] initWithAcceptableTypeIdentifiers:@[UTTypeURL.identifier]]; + } +#endif +} + +- (void)pasteItemProviders:(NSArray *)itemProviders { + if (@available(iOS 16, *)) { + [[Branch getInstance] passPasteItemProviders:itemProviders]; + } +} + +- (BOOL)canPasteItemProviders:(NSArray *)itemProviders { + for (NSItemProvider* item in itemProviders) + if (@available(iOS 14.0, *)) { + if ( [item hasItemConformingToTypeIdentifier: UTTypeURL.identifier] ) + return true; + } + return false; +} + +- (IBAction)sendOpenEvent:(id)sender { + [(AppDelegate *)[[UIApplication sharedApplication] delegate] setLogFile:@"Open"]; + [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillResignActiveNotification object:[UIApplication sharedApplication]]; + [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:[UIApplication sharedApplication]]; + } + +- (IBAction)showLogs:(id)sender { + UINavigationController *navigationController = + (UINavigationController *)self.view.window.rootViewController; + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; + LogOutputViewController *logOutputViewController = + [storyboard instantiateViewControllerWithIdentifier:@"LogOutputViewController"]; + + [navigationController pushViewController:logOutputViewController animated:YES]; + + NSString *logFileContents = [NSString stringWithContentsOfFile:((AppDelegate *)[UIApplication sharedApplication].delegate).PrevCommandLogFileName encoding:NSUTF8StringEncoding error:nil]; + logOutputViewController.logOutput = [NSString stringWithFormat:@"%@", logFileContents]; +} + +@end diff --git a/Branch-TestBed/Branch-TestBed/ViewController.m b/Branch-TestBed/Branch-TestBed/ViewController.m index 9c6ac81..340b58c 100644 --- a/Branch-TestBed/Branch-TestBed/ViewController.m +++ b/Branch-TestBed/Branch-TestBed/ViewController.m @@ -405,36 +405,11 @@ - (IBAction) sendCommerceEvent:(id)sender { } - (IBAction) sendV2EventAction:(id)sender { - NSArray *eventNames = @[ - - BranchStandardEventAddToCart - ,BranchStandardEventAddToWishlist - ,BranchStandardEventViewCart - ,BranchStandardEventInitiatePurchase - ,BranchStandardEventAddPaymentInfo - ,BranchStandardEventPurchase - ,BranchStandardEventSpendCredits - - ,BranchStandardEventSearch - ,BranchStandardEventViewItem - ,BranchStandardEventViewItems - ,BranchStandardEventRate - ,BranchStandardEventShare - - ,BranchStandardEventCompleteRegistration - ,BranchStandardEventCompleteTutorial - ,BranchStandardEventAchieveLevel - ,BranchStandardEventUnlockAchievement - ,BranchStandardEventInvite - ,BranchStandardEventLogin - ,BranchStandardEventReserve - ,BranchStandardEventSubscribe - ,BranchStandardEventStartTrial - ,BranchStandardEventClickAd - ,BranchStandardEventViewAd - ,@"iOS-CustomEvent" - - ]; + NSMutableArray *eventNames = [NSMutableArray arrayWithArray:BranchEvent.standardEvents]; + [eventNames sortUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { + return [(NSString *)obj1 compare:(NSString *)obj2 options:NSNumericSearch]; + }]; + [eventNames addObject:@"iOS-CustomEvent"]; __weak __typeof(self) weakSelf = self; ArrayPickerView *picker = [[ArrayPickerView alloc] initWithArray:eventNames]; diff --git a/Branch-TestBed/Framework-Info.plist b/Branch-TestBed/Framework-Info.plist index 2778e01f3449bae7ac8ed764cca8719d80e18c2c..7bfc4f702cc015c61c8629c09448c0f2ba3e8e30 100644 GIT binary patch delta 16 XcmdnNvV&!VF(b2yp221_MkYo8DF*}J delta 16 XcmdnNvV&!VF(b3Fp3!DAMkYo8DGLMO diff --git a/Branch.podspec b/Branch.podspec index 31ee72a..da07cf8 100644 --- a/Branch.podspec +++ b/Branch.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Branch" - s.version = "1.43.2" + s.version = "1.44.0" s.summary = "Create an HTTP URL for any piece of content in your app" s.description = <<-DESC - Want the highest possible conversions on your sharing feature? @@ -15,8 +15,8 @@ Use the Branch SDK (branch.io) to create and power the links that point back to s.license = 'MIT' s.author = { "Branch" => "sdk-team@branch.io" } s.source = { git: "https://github.com/BranchMetrics/ios-branch-deep-linking-attribution.git", tag: s.version.to_s } - s.ios.deployment_target = '9.0' - s.tvos.deployment_target = '9.0' + s.ios.deployment_target = '11.0' + s.tvos.deployment_target = '11.0' s.ios.source_files = "Branch-SDK/*.{h,m}" @@ -29,7 +29,8 @@ Use the Branch SDK (branch.io) to create and power the links that point back to "Branch-SDK/BNCSpotlightService.{h,m}", "Branch-SDK/BranchActivityItemProvider.{h,m}", "Branch-SDK/BranchCSSearchableItemAttributeSet.{h,m}", - "Branch-SDK/BranchShareLink.{h,m}" + "Branch-SDK/BranchShareLink.{h,m}", + "Branch-SDK/BranchPasteControl.{h,m}" s.frameworks = 'CoreServices', 'SystemConfiguration' s.weak_framework = 'LinkPresentation' diff --git a/ChangeLog.md b/ChangeLog.md index 5507dd4..cda95e7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,15 @@ Branch iOS SDK Change Log +v.1.44.0 +- SDK-1658 Add Support for VIEW_AD, INITIATE_STREAM, COMPLETE_STREAM and all V2 Events as Standard events +- SDK-1480 [iOS 16] UIPaste Support for NativeLink Flow + * Added API 'passPasteItemProviders' + * Added class 'BranchPasteControl' +- Requires Xcode 14+ + +- Known Issues: + * Integration with Carthage fails for tvOS. + v.1.43.2 - SDK-1625 Fix rare crash when used with Adobe Launch - Update developer id handling logic diff --git a/Package.swift b/Package.swift index 873b5f4..9e11507 100644 --- a/Package.swift +++ b/Package.swift @@ -6,8 +6,8 @@ import PackageDescription let package = Package( name: "Branch", platforms: [ - .iOS(.v9), - .tvOS(.v9), + .iOS(.v11), + .tvOS(.v11), ], products: [ .library( diff --git a/carthage-files/BranchSDK.xcodeproj/project.pbxproj b/carthage-files/BranchSDK.xcodeproj/project.pbxproj index 0dd0ae9..e51f304 100644 --- a/carthage-files/BranchSDK.xcodeproj/project.pbxproj +++ b/carthage-files/BranchSDK.xcodeproj/project.pbxproj @@ -184,6 +184,10 @@ 5F9071C6233D5FD5003AACAD /* BranchCrossPlatformID.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F9071C2233D5FD5003AACAD /* BranchCrossPlatformID.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5F9071D1233D6034003AACAD /* BNCJSONUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F9071CF233D6033003AACAD /* BNCJSONUtility.h */; }; 5F9071D2233D6034003AACAD /* BNCJSONUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F9071D0233D6034003AACAD /* BNCJSONUtility.m */; }; + 5F91E51528FF1BBA00FA4D24 /* BranchPasteControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F91E51328FF1BBA00FA4D24 /* BranchPasteControl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5F91E51628FF1BBA00FA4D24 /* BranchPasteControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F91E51328FF1BBA00FA4D24 /* BranchPasteControl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5F91E51728FF1BBA00FA4D24 /* BranchPasteControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F91E51428FF1BBA00FA4D24 /* BranchPasteControl.m */; }; + 5F91E51828FF1BBA00FA4D24 /* BranchPasteControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F91E51428FF1BBA00FA4D24 /* BranchPasteControl.m */; }; 5F92B24D2387703700CA909B /* BNCLocale.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F92B2432387703500CA909B /* BNCLocale.m */; }; 5F92B24E2387703700CA909B /* BNCDeviceSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F92B2442387703600CA909B /* BNCDeviceSystem.m */; }; 5F92B24F2387703700CA909B /* BNCReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F92B2452387703600CA909B /* BNCReachability.m */; }; @@ -599,6 +603,8 @@ 5F9071C2233D5FD5003AACAD /* BranchCrossPlatformID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BranchCrossPlatformID.h; sourceTree = ""; }; 5F9071CF233D6033003AACAD /* BNCJSONUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BNCJSONUtility.h; sourceTree = ""; }; 5F9071D0233D6034003AACAD /* BNCJSONUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCJSONUtility.m; sourceTree = ""; }; + 5F91E51328FF1BBA00FA4D24 /* BranchPasteControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BranchPasteControl.h; sourceTree = ""; }; + 5F91E51428FF1BBA00FA4D24 /* BranchPasteControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BranchPasteControl.m; sourceTree = ""; }; 5F92B2432387703500CA909B /* BNCLocale.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCLocale.m; sourceTree = ""; }; 5F92B2442387703600CA909B /* BNCDeviceSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCDeviceSystem.m; sourceTree = ""; }; 5F92B2452387703600CA909B /* BNCReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCReachability.m; sourceTree = ""; }; @@ -732,6 +738,8 @@ E230A1141D03DB9E006181D8 /* Branch-SDK */ = { isa = PBXGroup; children = ( + 5F91E51328FF1BBA00FA4D24 /* BranchPasteControl.h */, + 5F91E51428FF1BBA00FA4D24 /* BranchPasteControl.m */, 5F3D122226E2E8FD0026E592 /* BNCPasteboard.h */, 5F3D122326E2E8FD0026E592 /* BNCPasteboard.m */, 5F85110325B11E1000D544A1 /* BNCPartnerParameters.h */, @@ -1024,6 +1032,7 @@ 5FD0FA5225CE46BD008200EE /* BNCLinkData.h in Headers */, 5FD0FA5325CE46BD008200EE /* BNCServerRequestQueue.h in Headers */, 5FD0FA5425CE46BD008200EE /* BNCPreferenceHelper.h in Headers */, + 5F91E51628FF1BBA00FA4D24 /* BranchPasteControl.h in Headers */, 5FD0FA5525CE46BD008200EE /* NSError+Branch.h in Headers */, 5FD0FA5625CE46BD008200EE /* BNCServerInterface.h in Headers */, 5FD0FA5725CE46BD008200EE /* BNCSpotlightService.h in Headers */, @@ -1097,6 +1106,7 @@ 5F38027C24DCE73100E6FAFD /* BranchShortUrlSyncRequest.h in Headers */, 5FB6D3DD23219C46006C5094 /* BNCThreads.h in Headers */, 4D1ED27E1FB3A43A007390A8 /* BNCAvailability.h in Headers */, + 5F91E51528FF1BBA00FA4D24 /* BranchPasteControl.h in Headers */, E2B9477B1D15E31700F2270D /* BNCCallbacks.h in Headers */, 4D3922BD1E1F0C85004FB7C8 /* BNCCommerceEvent.h in Headers */, 5F7DB5FB237C95C30077A95F /* BNCAppleAdClient.h in Headers */, @@ -1367,7 +1377,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# config\nIOS_PATH=\"./build/ios/ios.xcarchive\"\nIOS_SIM_PATH=\"./build/ios/ios_sim.xcarchive\"\nXCFRAMEWORK_PATH=\"./build/Branch.xcframework\"\nCATALYST_PATH=\"./build/catalyst/catalyst.xcarchive\"\nSTATIC_LIB_SIM_PATH=\"./build/Branch.sim\"\nSTATIC_LIB_PATH=\"./build/Branch.a\"\n\n# delete previous build\nrm -rf \"./build\" \n\n# build iOS framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_PATH}\" \\\n -sdk iphoneos \\\n SKIP_INSTALL=NO \\\n GCC_PREPROCESSOR_DEFINITIONS='${inherited} BRANCH_EXCLUDE_IDFA_CODE=1'\n \n# build iOS simulator framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_SIM_PATH}\" \\\n -sdk iphonesimulator \\\n SKIP_INSTALL=NO \\\n GCC_PREPROCESSOR_DEFINITIONS='${inherited} BRANCH_EXCLUDE_IDFA_CODE=1'\n\n# build Catalyst framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${CATALYST_PATH}\" \\\n -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \\\n SKIP_INSTALL=NO \\\n GCC_PREPROCESSOR_DEFINITIONS='${inherited} BRANCH_EXCLUDE_IDFA_CODE=1'\n \n# package frameworks\nxcodebuild -create-xcframework \\\n -framework \"${IOS_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${IOS_SIM_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${CATALYST_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -output \"${XCFRAMEWORK_PATH}\"\n\n# build a static fat library from the xcframework\n# this is used by xamarin\nTEMP_LIB_PATH=\"./build/Branch.sim\"\nLIBRARY_PATH=\"./build/Branch.a\"\n\n# create simulator library without m1\nlipo -output \"${TEMP_LIB_PATH}\" -remove arm64 \"${XCFRAMEWORK_PATH}/ios-arm64_i386_x86_64-simulator/Branch.framework/Branch\"\n\n# create a fat static library\nlipo \"${XCFRAMEWORK_PATH}/ios-arm64_armv7/Branch.framework/Branch\" \"${TEMP_LIB_PATH}\" -create -output \"${LIBRARY_PATH}\"\n"; + shellScript = "# config\nIOS_PATH=\"./build/ios/ios.xcarchive\"\nIOS_SIM_PATH=\"./build/ios/ios_sim.xcarchive\"\nXCFRAMEWORK_PATH=\"./build/Branch.xcframework\"\nCATALYST_PATH=\"./build/catalyst/catalyst.xcarchive\"\nSTATIC_LIB_SIM_PATH=\"./build/Branch.sim\"\nSTATIC_LIB_PATH=\"./build/Branch.a\"\n\n# delete previous build\nrm -rf \"./build\" \n\n# build iOS framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_PATH}\" \\\n -sdk iphoneos \\\n SKIP_INSTALL=NO \\\n GCC_PREPROCESSOR_DEFINITIONS='${inherited} BRANCH_EXCLUDE_IDFA_CODE=1'\n \n# build iOS simulator framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_SIM_PATH}\" \\\n -sdk iphonesimulator \\\n SKIP_INSTALL=NO \\\n GCC_PREPROCESSOR_DEFINITIONS='${inherited} BRANCH_EXCLUDE_IDFA_CODE=1'\n\n# build Catalyst framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${CATALYST_PATH}\" \\\n -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \\\n SKIP_INSTALL=NO \\\n GCC_PREPROCESSOR_DEFINITIONS='${inherited} BRANCH_EXCLUDE_IDFA_CODE=1'\n \n# package frameworks\nxcodebuild -create-xcframework \\\n -framework \"${IOS_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${IOS_SIM_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${CATALYST_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -output \"${XCFRAMEWORK_PATH}\"\n\n# build a static fat library from the xcframework\n# this is used by xamarin\nTEMP_LIB_PATH=\"./build/Branch.sim\"\nLIBRARY_PATH=\"./build/Branch.a\"\n\n# create simulator library without m1\nlipo -output \"${TEMP_LIB_PATH}\" -remove arm64 \"${XCFRAMEWORK_PATH}/ios-arm64_x86_64-simulator/Branch.framework/Branch\"\n\n# create a fat static library\nlipo \"${XCFRAMEWORK_PATH}/ios-arm64/Branch.framework/Branch\" \"${TEMP_LIB_PATH}\" -create -output \"${LIBRARY_PATH}\"\n"; }; 5FD0FB1725CE4B93008200EE /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1384,7 +1394,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# config\nIOS_PATH=\"./build/ios/ios.xcarchive\"\nIOS_SIM_PATH=\"./build/ios/ios_sim.xcarchive\"\nCATALYST_PATH=\"./build/catalyst/catalyst.xcarchive\"\nXCFRAMEWORK_PATH=\"./build/Branch.xcframework\"\n\n# delete previous build\nrm -rf \"./build\" \n\n# build iOS framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_PATH}\" \\\n -sdk iphoneos \\\n SKIP_INSTALL=NO\n\n# build iOS simulator framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_SIM_PATH}\" \\\n -sdk iphonesimulator \\\n SKIP_INSTALL=NO\n \n# build Catalyst framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${CATALYST_PATH}\" \\\n -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \\\n SKIP_INSTALL=NO\n\n# package frameworks\nxcodebuild -create-xcframework \\\n -framework \"${IOS_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${IOS_SIM_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${CATALYST_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -output \"${XCFRAMEWORK_PATH}\"\n \n# build a static fat library from the xcframework\n# this is used by xamarin\nTEMP_LIB_PATH=\"./build/Branch.sim\"\nLIBRARY_PATH=\"./build/Branch.a\"\n\n# create simulator library without m1\nlipo -output \"${TEMP_LIB_PATH}\" -remove arm64 \"${XCFRAMEWORK_PATH}/ios-arm64_i386_x86_64-simulator/Branch.framework/Branch\"\n\n# create a fat static library\nlipo \"${XCFRAMEWORK_PATH}/ios-arm64_armv7/Branch.framework/Branch\" \"${TEMP_LIB_PATH}\" -create -output \"${LIBRARY_PATH}\"\n"; + shellScript = "# config\nIOS_PATH=\"./build/ios/ios.xcarchive\"\nIOS_SIM_PATH=\"./build/ios/ios_sim.xcarchive\"\nCATALYST_PATH=\"./build/catalyst/catalyst.xcarchive\"\nXCFRAMEWORK_PATH=\"./build/Branch.xcframework\"\n\n# delete previous build\nrm -rf \"./build\" \n\n# build iOS framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_PATH}\" \\\n -sdk iphoneos \\\n SKIP_INSTALL=NO\n\n# build iOS simulator framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_SIM_PATH}\" \\\n -sdk iphonesimulator \\\n SKIP_INSTALL=NO\n \n# build Catalyst framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${CATALYST_PATH}\" \\\n -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \\\n SKIP_INSTALL=NO\n\n# package frameworks\nxcodebuild -create-xcframework \\\n -framework \"${IOS_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${IOS_SIM_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${CATALYST_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -output \"${XCFRAMEWORK_PATH}\"\n \n# build a static fat library from the xcframework\n# this is used by xamarin\nTEMP_LIB_PATH=\"./build/Branch.sim\"\nLIBRARY_PATH=\"./build/Branch.a\"\n\n# create simulator library without m1\nlipo -output \"${TEMP_LIB_PATH}\" -remove arm64 \"${XCFRAMEWORK_PATH}/ios-arm64_x86_64-simulator/Branch.framework/Branch\"\n\n# create a fat static library\nlipo \"${XCFRAMEWORK_PATH}/ios-arm64/Branch.framework/Branch\" \"${TEMP_LIB_PATH}\" -create -output \"${LIBRARY_PATH}\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1497,6 +1507,7 @@ 5FD0FAAE25CE46BD008200EE /* BNCLinkData.m in Sources */, 5FD0FAAF25CE46BD008200EE /* BNCEncodingUtils.m in Sources */, 5FD0FAB025CE46BD008200EE /* BranchScene.m in Sources */, + 5F91E51828FF1BBA00FA4D24 /* BranchPasteControl.m in Sources */, 5FD0FAB125CE46BD008200EE /* BranchActivityItemProvider.m in Sources */, 5FD0FAB225CE46BD008200EE /* BNCServerRequest.m in Sources */, 5FD0FAB325CE46BD008200EE /* BNCTelephony.m in Sources */, @@ -1581,6 +1592,7 @@ E230A1781D03DB9E006181D8 /* BNCLinkData.m in Sources */, E230A1721D03DB9E006181D8 /* BNCEncodingUtils.m in Sources */, 5FD5EBE6243FB95000961CAF /* BranchScene.m in Sources */, + 5F91E51728FF1BBA00FA4D24 /* BranchPasteControl.m in Sources */, E230A1891D03DB9E006181D8 /* BranchActivityItemProvider.m in Sources */, 5F38027F24DCE73100E6FAFD /* BNCServerRequest.m in Sources */, 5F92B2562387703700CA909B /* BNCTelephony.m in Sources */, @@ -1711,7 +1723,7 @@ INFOPLIST_FILE = "Branch-tvOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.43.2; + MARKETING_VERSION = 1.44.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1722,7 +1734,7 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 11.0; }; name = Debug; }; @@ -1748,7 +1760,7 @@ INFOPLIST_FILE = "Branch-tvOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.43.2; + MARKETING_VERSION = 1.44.0; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branch; @@ -1758,7 +1770,7 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 11.0; }; name = Release; }; @@ -1775,12 +1787,12 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Branch/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_DYLIB_INSTALL_NAME = "@rpath/Branch.framework/Branch"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.43.2; + MARKETING_VERSION = 1.44.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branch; @@ -1804,12 +1816,12 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Branch/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_DYLIB_INSTALL_NAME = "@rpath/Branch.framework/Branch"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.43.2; + MARKETING_VERSION = 1.44.0; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branch; @@ -1961,10 +1973,10 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Branch/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.43.2; + MARKETING_VERSION = 1.44.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branch; @@ -1988,10 +2000,10 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Branch/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.43.2; + MARKETING_VERSION = 1.44.0; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branch; diff --git a/carthage-files/checksum.txt b/carthage-files/checksum.txt index 872a976..665373f 100644 --- a/carthage-files/checksum.txt +++ b/carthage-files/checksum.txt @@ -1,2 +1,2 @@ #checksum for Branch on Github -d21dfdbc177d4351b65b2d9b81eade8e0971a34c Branch.zip +59e5715af56505774d14f9ad46ff224f7c43eb21 Branch.zip diff --git a/carthage-files/checksum_noidfa.txt b/carthage-files/checksum_noidfa.txt index 5807acb..734105f 100644 --- a/carthage-files/checksum_noidfa.txt +++ b/carthage-files/checksum_noidfa.txt @@ -1,2 +1,2 @@ #checksum for Branch on Github -82f3671f396e6b476b4f363a80eb1208e685e4c6 Branch_noidfa.zip +ada5ad525e769de313b5a8af8eba4cc6327cef05 Branch_noidfa.zip diff --git a/carthage-files/checksum_static.txt b/carthage-files/checksum_static.txt index f96492d..833c4ce 100644 --- a/carthage-files/checksum_static.txt +++ b/carthage-files/checksum_static.txt @@ -1,2 +1,2 @@ #checksum for Branch on Github -2247d66843c4a7458fcd3ca51d8c99a10954382c Branch_static.zip +90cc254681c39b6be55ed33e8c7c147b3c6837d3 Branch_static.zip diff --git a/carthage-files/checksum_static_noidfa.txt b/carthage-files/checksum_static_noidfa.txt index 8714914..d903bc0 100644 --- a/carthage-files/checksum_static_noidfa.txt +++ b/carthage-files/checksum_static_noidfa.txt @@ -1,2 +1,2 @@ #checksum for Branch on Github -a071a39d43b60b04756c18de5c59e03c7b39ee4e Branch_static_noidfa.zip +aa75f251739480b0429729a75cc2eebe4565f167 Branch_static_noidfa.zip diff --git a/scripts/version.sh b/scripts/version.sh index c9fe347..4e69eaa 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -31,7 +31,7 @@ Options: USAGE } -version=1.43.2 +version=1.44.0 if (( $# == 0 )); then echo $version