-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
- Loading branch information
1 parent
2a430f2
commit e235ec8
Showing
29 changed files
with
573 additions
and
88 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// BranchPasteControl.h | ||
// Branch | ||
// | ||
// Created by Nidhi Dixit on 9/26/22. | ||
// Copyright © 2022 Branch, Inc. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000 | ||
API_AVAILABLE(ios(16.0)) | ||
@interface BranchPasteControl : UIView <UIPasteConfigurationSupporting> | ||
|
||
// 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 |
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,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<NSItemProvider *> *)itemProviders { | ||
[[Branch getInstance] passPasteItemProviders:itemProviders]; | ||
} | ||
|
||
- (BOOL)canPasteItemProviders:(NSArray<NSItemProvider *> *)itemProviders { | ||
for (NSItemProvider* item in itemProviders) | ||
if ( [item hasItemConformingToTypeIdentifier: UTTypeURL.identifier] ) | ||
return true; | ||
return false; | ||
} | ||
|
||
@end | ||
#endif |
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.