diff --git a/BranchMonsterFactory.xcodeproj/project.pbxproj b/BranchMonsterFactory.xcodeproj/project.pbxproj index 276e727..65f636d 100644 --- a/BranchMonsterFactory.xcodeproj/project.pbxproj +++ b/BranchMonsterFactory.xcodeproj/project.pbxproj @@ -919,7 +919,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branchsters.Clip; @@ -962,7 +962,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = io.branch.Branchsters.Clip; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1238,7 +1238,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3; PRODUCT_BUNDLE_IDENTIFIER = "io.branch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = Branchsters; PROVISIONING_PROFILE = ""; @@ -1271,7 +1271,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.3; PRODUCT_BUNDLE_IDENTIFIER = "io.branch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = Branchsters; PROVISIONING_PROFILE = ""; diff --git a/BranchMonsterFactory.xcworkspace/xcshareddata/swiftpm/Package.resolved b/BranchMonsterFactory.xcworkspace/xcshareddata/swiftpm/Package.resolved index df4dc6b..ed75f77 100644 --- a/BranchMonsterFactory.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/BranchMonsterFactory.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,16 +1,14 @@ { - "object": { - "pins": [ - { - "package": "Branch", - "repositoryURL": "https://github.com/BranchMetrics/ios-branch-sdk-spm", - "state": { - "branch": null, - "revision": "a189a664f7c7bcb43245e3c244cb71af5f7a25e2", - "version": "1.42.0" - } + "pins" : [ + { + "identity" : "ios-branch-sdk-spm", + "kind" : "remoteSourceControl", + "location" : "https://github.com/BranchMetrics/ios-branch-sdk-spm", + "state" : { + "revision" : "e235ec8904d8d94d1aca46a376915c4c61a15131", + "version" : "1.44.0" } - ] - }, - "version": 1 + } + ], + "version" : 2 } diff --git a/BranchMonsterFactory/AppDelegate.m b/BranchMonsterFactory/AppDelegate.m index a29b3a2..8017a7d 100644 --- a/BranchMonsterFactory/AppDelegate.m +++ b/BranchMonsterFactory/AppDelegate.m @@ -27,13 +27,17 @@ - (BOOL)application:(UIApplication *)application [FBSDKApplicationDelegate.sharedInstance application:application didFinishLaunchingWithOptions:launchOptions]; Branch *branch = [Branch getInstance]; - [branch checkPasteboardOnInstall]; + + // NativeLink + if (@available(iOS 16.0, *)) { + // Don't check pasteboard on install, instead utilize UIPasteControl + } else if (@available(iOS 15.0, *)) { + [branch checkPasteboardOnInstall]; + } + [branch setAppClipAppGroup:@"group.io.branch"]; [branch registerFacebookDeepLinkingClass:[FBSDKAppLinkUtility class]]; - // Enable this to track Apple Search Ad attribution: - [branch delayInitToCheckForSearchAds]; - /* * Initalize Branch and register the deep link handler: * diff --git a/BranchMonsterFactory/Base.lproj/Main.storyboard b/BranchMonsterFactory/Base.lproj/Main.storyboard index f575f2e..99adc4a 100644 --- a/BranchMonsterFactory/Base.lproj/Main.storyboard +++ b/BranchMonsterFactory/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -12,7 +12,7 @@ - + diff --git a/BranchMonsterFactory/ViewControllers/MonsterViewerViewController.m b/BranchMonsterFactory/ViewControllers/MonsterViewerViewController.m index e8e7645..414be54 100644 --- a/BranchMonsterFactory/ViewControllers/MonsterViewerViewController.m +++ b/BranchMonsterFactory/ViewControllers/MonsterViewerViewController.m @@ -42,7 +42,7 @@ @implementation MonsterViewerViewController static CGFloat MONSTER_HEIGHT = 0.4f; - +@synthesize pasteConfiguration; - (void)viewDidLoad { [super viewDidLoad]; @@ -89,6 +89,21 @@ - (void)viewDidLoad { [self.progressBar hide]; [self setViewingMonster:self.viewingMonster]; //not awesome, but it triggers the setter + + if (@available(iOS 16.0, *)) { + + UIPasteControlConfiguration *pcConfig = [UIPasteControlConfiguration new]; + pcConfig.baseBackgroundColor = [UIColor colorWithRed:81.0f/255.0f green:131.0f/255.0f blue:212.0f/255.0f alpha:1.0f]; + pcConfig.displayMode = UIPasteControlDisplayModeLabelOnly; + + CGRect rectPC = CGRectMake(15, (self.view.bounds.size.height - 53), 68, 34); + UIPasteControl *pc = [[UIPasteControl alloc] initWithConfiguration:pcConfig]; + pc.frame = rectPC; + pc.target = self; + [self.view addSubview:pc]; + + pasteConfiguration = [[UIPasteConfiguration alloc] initWithAcceptableTypeIdentifiers:@[UTTypeURL.identifier]]; + } } - (void) viewDidAppear:(BOOL)animated { @@ -101,6 +116,22 @@ - (void) viewDidAppear:(BOOL)animated { }]; } + +- (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; +} + -(void) setViewingMonster: (BranchUniversalObject *)monster { _viewingMonster = monster;