-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1139 from BranchMetrics/CORE-2088-backport
Prep maintenance release 1.39.4
- Loading branch information
Showing
25 changed files
with
490 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// BNCPasteboard.h | ||
// Branch | ||
// | ||
// Created by Ernest Cho on 6/24/21. | ||
// Copyright © 2021 Branch, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface BNCPasteboard : NSObject | ||
|
||
/* | ||
Indicates if the client wishes to check for Branch links on install. By default, this is NO. | ||
Set via Branch.checkPasteboardOnInstall | ||
Checked by BranchInstallRequest.makeRequest before checking the pasteboard for a Branch link. | ||
*/ | ||
@property (nonatomic, assign) BOOL checkOnInstall; | ||
|
||
- (BOOL)isUrlOnPasteboard; | ||
- (nullable NSURL *)checkForBranchLink; | ||
|
||
+ (BNCPasteboard *)sharedInstance; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// BNCPasteboard.m | ||
// Branch | ||
// | ||
// Created by Ernest Cho on 6/24/21. | ||
// Copyright © 2021 Branch, Inc. All rights reserved. | ||
// | ||
|
||
#import "BNCPasteboard.h" | ||
#import <UIKit/UIKit.h> | ||
#import "Branch.h" | ||
|
||
@implementation BNCPasteboard | ||
|
||
+ (BNCPasteboard *)sharedInstance { | ||
static BNCPasteboard *pasteboard; | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
pasteboard = [BNCPasteboard new]; | ||
}); | ||
return pasteboard; | ||
} | ||
|
||
- (instancetype)init { | ||
self = [super init]; | ||
if (self) { | ||
self.checkOnInstall = NO; | ||
} | ||
return self; | ||
} | ||
|
||
- (BOOL)isUrlOnPasteboard { | ||
#if !TARGET_OS_TV | ||
if (@available(iOS 10.0, *)) { | ||
if ([UIPasteboard.generalPasteboard hasURLs]) { | ||
return YES; | ||
} | ||
} | ||
#endif | ||
return NO; | ||
} | ||
|
||
- (nullable NSURL *)checkForBranchLink { | ||
if ([self isUrlOnPasteboard]) { | ||
#if !TARGET_OS_TV | ||
// triggers the end user toast message | ||
NSURL *tmp = UIPasteboard.generalPasteboard.URL; | ||
if ([Branch isBranchLink:tmp.absoluteString]) { | ||
return tmp; | ||
} | ||
#endif | ||
} | ||
return nil; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.