Skip to content

Commit 415c949

Browse files
author
Edward Smith
committed
Updated URL sharing and updated version to 0.19.1.
1 parent 83e8bc5 commit 415c949

File tree

8 files changed

+74
-27
lines changed

8 files changed

+74
-27
lines changed

Branch-SDK/Branch-SDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
NSString * const BNC_API_BASE_URL = @"https://api.branch.io";
1212
NSString * const BNC_API_VERSION = @"v1";
1313
NSString * const BNC_LINK_URL = @"https://bnc.lt";
14-
NSString * const BNC_SDK_VERSION = @"0.19.0";
14+
NSString * const BNC_SDK_VERSION = @"0.19.1";

Branch-SDK/Branch-SDK/BNCStrongMatchHelper.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,8 @@ + (NSURL *)getUrlForCookieBasedMatchingWithBranchKey:(NSString *)branchKey
192192
#pragma clang diagnostic pop
193193
}
194194

195-
+ (BOOL)cookiesAvailableInOS
196-
{
197-
return [UIDevice currentDevice].systemVersion.floatValue < 11.0;
195+
+ (BOOL)cookiesAvailableInOS {
196+
return [UIDevice currentDevice].systemVersion.doubleValue < 11.0;
198197
}
199198

200199
- (void)createStrongMatchWithBranchKey:(NSString *)branchKey {

Branch-SDK/Branch-SDK/BranchActivityItemProvider.m

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,32 @@ @interface BranchActivityItemProvider ()
2727

2828
@implementation BranchActivityItemProvider
2929

30-
- (id)initWithParams:(NSDictionary *)params andTags:(NSArray *)tags andFeature:(NSString *)feature andStage:(NSString *)stage andAlias:(NSString *)alias {
30+
- (id)initWithParams:(NSDictionary *)params
31+
andTags:(NSArray *)tags
32+
andFeature:(NSString *)feature
33+
andStage:(NSString *)stage
34+
andAlias:(NSString *)alias {
3135
return [self initWithParams:params tags:tags feature:feature stage:stage campaign:nil alias:alias delegate:nil];
3236
}
3337

34-
- (id)initWithParams:(NSDictionary *)params tags:(NSArray *)tags feature:(NSString *)feature stage:(NSString *)stage campaign:(NSString *)campaign alias:(NSString *)alias delegate:(id <BranchActivityItemProviderDelegate>)delegate {
35-
NSString *url = [[Branch getInstance] getLongURLWithParams:params andChannel:nil andTags:tags andFeature:feature andStage:stage andAlias:alias];
36-
37-
if ([UIDevice currentDevice].systemVersion.doubleValue < 11.0) {
38+
- (id)initWithParams:(NSDictionary *)params
39+
tags:(NSArray *)tags
40+
feature:(NSString *)feature
41+
stage:(NSString *)stage
42+
campaign:(NSString *)campaign
43+
alias:(NSString *)alias
44+
delegate:(id <BranchActivityItemProviderDelegate>)delegate {
45+
46+
NSString *url =
47+
[[Branch getInstance]
48+
getLongURLWithParams:params
49+
andChannel:nil
50+
andTags:tags
51+
andFeature:feature
52+
andStage:stage
53+
andAlias:alias];
54+
55+
if (self.returnURL) {
3856
if ((self = [super initWithPlaceholderItem:[NSURL URLWithString:url]])) {
3957
_params = params;
4058
_tags = tags;
@@ -60,9 +78,19 @@ - (id)initWithParams:(NSDictionary *)params tags:(NSArray *)tags feature:(NSStri
6078
return self;
6179
}
6280

81+
- (BOOL) returnURL {
82+
BOOL returnURL = YES;
83+
if ([UIDevice currentDevice].systemVersion.doubleValue >= 11.0 &&
84+
[self.activityType isEqualToString:UIActivityTypeCopyToPasteboard]) {
85+
returnURL = NO;
86+
}
87+
return returnURL;
88+
}
89+
6390
- (id)item {
6491
NSString *channel = [BranchActivityItemProvider humanReadableChannelWithActivityType:self.activityType];
65-
92+
93+
6694
// Allow for overrides specific to channel
6795
NSDictionary *params = [self paramsForChannel:channel];
6896
NSArray *tags = [self tagsForChannel:channel];
@@ -91,7 +119,7 @@ - (id)item {
91119
andAlias:alias
92120
ignoreUAString:self.userAgentString
93121
forceLinkCreation:YES]];
94-
return ([UIDevice currentDevice].systemVersion.doubleValue < 11.0) ? URL : URL.absoluteString;
122+
return (self.returnURL) ? URL : URL.absoluteString;
95123
}
96124
}
97125

@@ -134,7 +162,7 @@ - (id)item {
134162
andAlias:alias
135163
ignoreUAString:nil
136164
forceLinkCreation:YES]];
137-
return ([UIDevice currentDevice].systemVersion.doubleValue < 11.0) ? URL : URL.absoluteString;
165+
return (self.returnURL) ? URL : URL.absoluteString;
138166
}
139167

140168
#pragma mark - Internals
@@ -175,28 +203,39 @@ + (NSString *)humanReadableChannelWithActivityType:(NSString *)activityString {
175203
}
176204

177205
- (NSDictionary *)paramsForChannel:(NSString *)channel {
178-
return ([self.delegate respondsToSelector:@selector(activityItemParamsForChannel:)]) ? [self.delegate activityItemParamsForChannel:channel] : self.params;
206+
return ([self.delegate respondsToSelector:@selector(activityItemParamsForChannel:)])
207+
? [self.delegate activityItemParamsForChannel:channel]
208+
: self.params;
179209
}
180210

181211
- (NSArray *)tagsForChannel:(NSString *)channel {
182-
return ([self.delegate respondsToSelector:@selector(activityItemTagsForChannel:)]) ? [self.delegate activityItemTagsForChannel:channel] : self.tags;
212+
return ([self.delegate respondsToSelector:@selector(activityItemTagsForChannel:)])
213+
? [self.delegate activityItemTagsForChannel:channel]
214+
: self.tags;
183215
}
184216

185217
- (NSString *)featureForChannel:(NSString *)channel {
186-
return ([self.delegate respondsToSelector:@selector(activityItemFeatureForChannel:)]) ? [self.delegate activityItemFeatureForChannel:channel] : self.feature;
218+
return ([self.delegate respondsToSelector:@selector(activityItemFeatureForChannel:)])
219+
? [self.delegate activityItemFeatureForChannel:channel]
220+
: self.feature;
187221
}
188222

189223
- (NSString *)stageForChannel:(NSString *)channel {
190-
return ([self.delegate respondsToSelector:@selector(activityItemStageForChannel:)]) ? [self.delegate activityItemStageForChannel:channel] : self.stage;
224+
return ([self.delegate respondsToSelector:@selector(activityItemStageForChannel:)])
225+
? [self.delegate activityItemStageForChannel:channel]
226+
: self.stage;
191227
}
192228

193229
- (NSString *)campaignForChannel:(NSString *)channel {
194-
return ([self.delegate respondsToSelector:@selector(activityItemCampaignForChannel:)]) ? [self.delegate activityItemCampaignForChannel:channel] : self.campaign;
230+
return ([self.delegate respondsToSelector:@selector(activityItemCampaignForChannel:)])
231+
? [self.delegate activityItemCampaignForChannel:channel]
232+
: self.campaign;
195233
}
196234

197-
198235
- (NSString *)aliasForChannel:(NSString *)channel {
199-
return ([self.delegate respondsToSelector:@selector(activityItemAliasForChannel:)]) ? [self.delegate activityItemAliasForChannel:channel] : self.alias;
236+
return ([self.delegate respondsToSelector:@selector(activityItemAliasForChannel:)])
237+
? [self.delegate activityItemAliasForChannel:channel]
238+
: self.alias;
200239
}
201240

202241
@end

Branch-SDK/Branch-SDK/BranchShareLink.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (void) shareDidComplete:(BOOL)completed activityError:(NSError*)error {
128128
andStage:self.linkProperties.stage
129129
andAlias:self.linkProperties.alias];
130130
self.shareURL = [[NSURL alloc] initWithString:URLString];
131-
if ([UIDevice currentDevice].systemVersion.doubleValue < 11.0)
131+
if (self.returnURL)
132132
item = [[BranchShareActivityItem alloc] initWithPlaceholderItem:self.shareURL];
133133
else
134134
item = [[BranchShareActivityItem alloc] initWithPlaceholderItem:self.shareURL.absoluteString];
@@ -261,7 +261,16 @@ - (id) shareObjectForItem:(BranchShareActivityItem*)activityItem
261261
ignoreUAString:userAgentString
262262
forceLinkCreation:YES];
263263
self.shareURL = [NSURL URLWithString:URLString];
264-
return ([UIDevice currentDevice].systemVersion.doubleValue < 11.0) ? self.shareURL :self.shareURL.absoluteString;
264+
return (self.returnURL) ? self.shareURL :self.shareURL.absoluteString;
265+
}
266+
267+
- (BOOL) returnURL {
268+
BOOL returnURL = YES;
269+
if ([UIDevice currentDevice].systemVersion.doubleValue >= 11.0 &&
270+
[self.activityType isEqualToString:UIActivityTypeCopyToPasteboard]) {
271+
returnURL = NO;
272+
}
273+
return returnURL;
265274
}
266275

267276
@end

Branch-TestBed/Framework-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.19.0</string>
20+
<string>0.19.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>0.19.0</string>
24+
<string>0.19.1</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>NSHumanReadableCopyright</key>

Branch.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Branch"
3-
s.version = "0.19.0"
3+
s.version = "0.19.1"
44
s.summary = "Create an HTTP URL for any piece of content in your app"
55
s.description = <<-DESC
66
- Want the highest possible conversions on your sharing feature?

carthage-files/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.19.0</string>
18+
<string>0.19.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.19.0</string>
22+
<string>0.19.1</string>
2323
<key>NSPrincipalClass</key>
2424
<string></string>
2525
</dict>

scripts/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Options:
3131
USAGE
3232
}
3333

34-
version=0.19.0
34+
version=0.19.1
3535

3636
if (( $# == 0 )); then
3737
echo $version

0 commit comments

Comments
 (0)