@@ -33,18 +33,30 @@ - (id)initWithParams:(NSDictionary *)params andTags:(NSArray *)tags andFeature:(
3333
3434- (id )initWithParams : (NSDictionary *)params tags : (NSArray *)tags feature : (NSString *)feature stage : (NSString *)stage campaign : (NSString *)campaign alias : (NSString *)alias delegate : (id <BranchActivityItemProviderDelegate>)delegate {
3535 NSString *url = [[Branch getInstance ] getLongURLWithParams: params andChannel: nil andTags: tags andFeature: feature andStage: stage andAlias: alias];
36-
37- if ((self = [super initWithPlaceholderItem: [NSURL URLWithString: url]])) {
38- _params = params;
39- _tags = tags;
40- _feature = feature;
41- _stage = stage;
42- _campaign = campaign;
43- _alias = alias;
44- _userAgentString = [BNCDeviceInfo userAgentString ];
45- _delegate = delegate;
36+
37+ if ([UIDevice currentDevice ].systemVersion .doubleValue < 11.0 ) {
38+ if ((self = [super initWithPlaceholderItem: [NSURL URLWithString: url]])) {
39+ _params = params;
40+ _tags = tags;
41+ _feature = feature;
42+ _stage = stage;
43+ _campaign = campaign;
44+ _alias = alias;
45+ _userAgentString = [BNCDeviceInfo userAgentString ];
46+ _delegate = delegate;
47+ }
48+ } else {
49+ if ((self = [super initWithPlaceholderItem: url])) {
50+ _params = params;
51+ _tags = tags;
52+ _feature = feature;
53+ _stage = stage;
54+ _campaign = campaign;
55+ _alias = alias;
56+ _userAgentString = [BNCDeviceInfo userAgentString ];
57+ _delegate = delegate;
58+ }
4659 }
47-
4860 return self;
4961}
5062
@@ -68,8 +80,8 @@ - (id)item {
6880 // existing list, telling the backend to ignore the first click
6981 NSArray *scrapers = @[@" Facebook" , @" Twitter" , @" Slack" , @" Apple Notes" ];
7082 for (NSString *scraper in scrapers) {
71- if ([channel isEqualToString: scraper])
72- return [NSURL URLWithString: [[Branch getInstance ]
83+ if ([channel isEqualToString: scraper]) {
84+ NSURL *URL = [NSURL URLWithString: [[Branch getInstance ]
7385 getShortURLWithParams: params
7486 andTags: tags
7587 andChannel: channel
@@ -79,6 +91,8 @@ - (id)item {
7991 andAlias: alias
8092 ignoreUAString: self .userAgentString
8193 forceLinkCreation: YES ]];
94+ return ([UIDevice currentDevice ].systemVersion .doubleValue < 11.0 ) ? URL : URL.absoluteString ;
95+ }
8296 }
8397
8498 // Wrap the link in HTML content
@@ -109,17 +123,18 @@ - (id)item {
109123 [params objectForKey: BRANCH_LINK_DATA_KEY_EMAIL_HTML_FOOTER]];
110124 }
111125
112- return [NSURL URLWithString: [[Branch getInstance ]
113- getShortURLWithParams: params
114- andTags: tags
115- andChannel: channel
116- andFeature: feature
117- andStage: stage
118- andCampaign: campaign
119- andAlias: alias
120- ignoreUAString: nil
121- forceLinkCreation: YES ]];
122-
126+ NSURL *URL =
127+ [NSURL URLWithString: [[Branch getInstance ]
128+ getShortURLWithParams: params
129+ andTags: tags
130+ andChannel: channel
131+ andFeature: feature
132+ andStage: stage
133+ andCampaign: campaign
134+ andAlias: alias
135+ ignoreUAString: nil
136+ forceLinkCreation: YES ]];
137+ return ([UIDevice currentDevice ].systemVersion .doubleValue < 11.0 ) ? URL : URL.absoluteString ;
123138}
124139
125140#pragma mark - Internals
0 commit comments