1111
1212@class BranchLinkProperties;
1313
14- typedef void (^shareCompletion) (NSString *_Nonnull activityType, BOOL completed);
14+ typedef void (^shareCompletion) (NSString * _Nullable activityType, BOOL completed);
15+ typedef void (^shareCompletionWithError) (NSString * _Nullable activityType, BOOL completed, NSError * _Nullable activityError);
1516
1617typedef NS_ENUM (NSInteger , ContentIndexMode) {
1718 ContentIndexModePublic,
@@ -20,51 +21,55 @@ typedef NS_ENUM(NSInteger, ContentIndexMode) {
2021
2122@interface BranchUniversalObject : NSObject
2223
23- @property (nonatomic , strong ) NSString *canonicalIdentifier;
24- @property (nonatomic , strong ) NSString *canonicalUrl;
25- @property (nonatomic , strong ) NSString *title;
26- @property (nonatomic , strong ) NSString *contentDescription;
27- @property (nonatomic , strong ) NSString *imageUrl;
24+ @property (nonatomic , strong , nonnull ) NSString *canonicalIdentifier;
25+ @property (nonatomic , strong , nullable ) NSString *canonicalUrl;
26+ @property (nonatomic , strong , nullable ) NSString *title;
27+ @property (nonatomic , strong , nullable ) NSString *contentDescription;
28+ @property (nonatomic , strong , nullable ) NSString *imageUrl;
2829// Note: properties found in metadata will overwrite properties on the BranchUniversalObject itself
29- @property (nonatomic , strong ) NSDictionary *metadata;
30- @property (nonatomic , strong ) NSString *type;
30+ @property (nonatomic , strong , nullable ) NSDictionary *metadata;
31+ @property (nonatomic , strong , nullable ) NSString *type;
3132@property (nonatomic ) ContentIndexMode contentIndexMode;
32- @property (nonatomic , strong ) NSArray *keywords;
33- @property (nonatomic , strong ) NSDate *expirationDate;
34- @property (nonatomic , strong ) NSString *spotlightIdentifier;
33+ @property (nonatomic , strong , nullable ) NSArray *keywords;
34+ @property (nonatomic , strong , nullable ) NSDate *expirationDate;
35+ @property (nonatomic , strong , nullable ) NSString *spotlightIdentifier;
3536@property (nonatomic , assign ) CGFloat price;
36- @property (nonatomic , strong ) NSString *currency;
37+ @property (nonatomic , strong , nullable ) NSString *currency;
3738@property (nonatomic , assign ) BOOL automaticallyListOnSpotlight;
3839
3940
40- - (instancetype )initWithCanonicalIdentifier : (NSString *)canonicalIdentifier ;
41- - (instancetype )initWithTitle : (NSString *)title ;
41+ - (nullable instancetype )initWithCanonicalIdentifier : (nonnull NSString *)canonicalIdentifier ;
42+ - (nullable instancetype )initWithTitle : (nonnull NSString *)title ;
4243
43- - (void )addMetadataKey : (NSString *)key value : (NSString *)value ;
44+ - (void )addMetadataKey : (nonnull NSString *)key value : (nonnull NSString *)value ;
4445
4546- (void )registerView ;
46- - (void )registerViewWithCallback : (callbackWithParams)callback ;
47+ - (void )registerViewWithCallback : (nullable callbackWithParams)callback ;
4748
48- - (void )userCompletedAction : (NSString *)action ;
49+ - (void )userCompletedAction : (nonnull NSString *)action ;
4950
50- - (NSString *)getShortUrlWithLinkProperties : (BranchLinkProperties *)linkProperties ;
51- - (NSString *)getShortUrlWithLinkPropertiesAndIgnoreFirstClick : (BranchLinkProperties *)linkProperties ;
52- - (void )getShortUrlWithLinkProperties : (BranchLinkProperties *)linkProperties andCallback : (callbackWithUrl)callback ;
51+ - (nullable NSString *)getShortUrlWithLinkProperties : (nonnull BranchLinkProperties *)linkProperties ;
52+ - (nullable NSString *)getShortUrlWithLinkPropertiesAndIgnoreFirstClick : (nonnull BranchLinkProperties *)linkProperties ;
53+ - (void )getShortUrlWithLinkProperties : (nonnull BranchLinkProperties *)linkProperties andCallback : (nonnull callbackWithUrl)callback ;
5354
54- - (UIActivityItemProvider *)getBranchActivityItemWithLinkProperties : (BranchLinkProperties *)linkProperties ;
55+ - (nullable UIActivityItemProvider *)getBranchActivityItemWithLinkProperties : (nonnull BranchLinkProperties *)linkProperties ;
5556
56- - (void )showShareSheetWithShareText : (NSString *)shareText completion : (shareCompletion)completion ;
57- - (void )showShareSheetWithLinkProperties : (BranchLinkProperties *)linkProperties andShareText : (NSString *)shareText fromViewController : (UIViewController *)viewController completion : (shareCompletion)completion ;
57+ - (void )showShareSheetWithShareText : (nullable NSString *)shareText completion : (nullable shareCompletion)completion ;
58+ - (void )showShareSheetWithLinkProperties : (nullable BranchLinkProperties *)linkProperties andShareText : (nullable NSString *)shareText fromViewController : (nullable UIViewController *)viewController completion : (nullable shareCompletion)completion ;
59+ // Returns with activityError as well
60+ - (void )showShareSheetWithLinkProperties : (nullable BranchLinkProperties *)linkProperties andShareText : (nullable NSString *)shareText fromViewController : (nullable UIViewController *)viewController completionWithError : (nullable shareCompletionWithError)completion ;
5861// iPad
59- - (void )showShareSheetWithLinkProperties : (BranchLinkProperties *)linkProperties andShareText : (NSString *)shareText fromViewController : (UIViewController *)viewController anchor : (UIBarButtonItem *)anchor completion : (shareCompletion)completion ;
62+ - (void )showShareSheetWithLinkProperties : (nullable BranchLinkProperties *)linkProperties andShareText : (nullable NSString *)shareText fromViewController : (nullable UIViewController *)viewController anchor : (nullable UIBarButtonItem *)anchor completion : (nullable shareCompletion)completion ;
63+ // Returns with activityError as well
64+ - (void )showShareSheetWithLinkProperties : (nullable BranchLinkProperties *)linkProperties andShareText : (nullable NSString *)shareText fromViewController : (nullable UIViewController *)viewController anchor : (nullable UIBarButtonItem *)anchor completionWithError : (nullable shareCompletionWithError)completion ;
6065
6166- (void )listOnSpotlight ;
62- - (void )listOnSpotlightWithCallback : (callbackWithUrl)callback ;
63- - (void )listOnSpotlightWithIdentifierCallback : (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" ))));;
67+ - (void )listOnSpotlightWithCallback : (nullable callbackWithUrl)callback ;
68+ - (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" ))));;
6469
6570// Convenience method for initSession methods that return BranchUniversalObject, but can be used safely by anyone.
66- + (BranchUniversalObject *)getBranchUniversalObjectFromDictionary : (NSDictionary *)dictionary ;
71+ + (nonnull BranchUniversalObject *)getBranchUniversalObjectFromDictionary : (nonnull NSDictionary *)dictionary ;
6772
68- - (NSString *)description ;
73+ - (nonnull NSString *)description ;
6974
7075@end
0 commit comments