Skip to content

Commit b7739fc

Browse files
committed
Merge branch 'staging' of ssh://github.com/BranchMetrics/ios-branch-deep-linking into staging
2 parents 1b507ca + c2057d6 commit b7739fc

File tree

31 files changed

+263
-98
lines changed

31 files changed

+263
-98
lines changed

Branch-SDK/Branch-SDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
BOOL const BNC_API_PINNED = YES;
1313
NSString * const BNC_API_VERSION = @"v1";
1414
NSString * const BNC_LINK_URL = @"https://bnc.lt";
15-
NSString * const BNC_SDK_VERSION = @"0.23.4";
15+
NSString * const BNC_SDK_VERSION = @"0.23.5";

Branch-SDK/Branch-SDK/BNCEncodingUtils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ extern NSString* BNCWireFormatFromString(NSString *string);
4949
+ (NSData *)encodeDictionaryToJsonData:(NSDictionary *)dictionary;
5050

5151
+ (NSString*) stringByPercentDecodingString:(NSString*)string;
52+
+ (NSString*) stringByPercentEncodingStringForQuery:(NSString *)string;
5253

5354
+ (NSDictionary *)decodeJsonDataToDictionary:(NSData *)jsonData;
5455
+ (NSDictionary *)decodeJsonStringToDictionary:(NSString *)jsonString;

Branch-SDK/Branch-SDK/BNCEncodingUtils.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ + (NSString*) stringByPercentDecodingString:(NSString *)string {
325325
return [string stringByRemovingPercentEncoding];
326326
}
327327

328+
+ (NSString*) stringByPercentEncodingStringForQuery:(NSString *)string {
329+
return [string stringByAddingPercentEncodingWithAllowedCharacters:
330+
[NSCharacterSet URLQueryAllowedCharacterSet]];
331+
}
332+
328333
#pragma mark - Param Decoding Methods
329334

330335
+ (NSDictionary *)decodeJsonDataToDictionary:(NSData *)jsonData {

Branch-SDK/Branch-SDK/BNCLog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ extern BNCLogFlushFunctionPtr _Nullable BNCLogFlushFunction(void);
131131
extern void BNCLogWriteMessageFormat(
132132
BNCLogLevel logLevel,
133133
const char *_Nullable sourceFileName,
134-
int sourceLineNumber,
134+
int32_t sourceLineNumber,
135135
id _Nullable messageFormat,
136136
...
137137
);
@@ -140,7 +140,7 @@ extern void BNCLogWriteMessageFormat(
140140
extern void BNCLogWriteMessage(
141141
BNCLogLevel logLevel,
142142
NSString *_Nonnull sourceFileName,
143-
NSUInteger sourceLineNumber,
143+
int32_t sourceLineNumber,
144144
NSString *_Nonnull message
145145
);
146146

Branch-SDK/Branch-SDK/BNCLog.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ void BNCLogSetFlushFunction(BNCLogFlushFunctionPtr flushFunction) {
593593
void BNCLogWriteMessageFormat(
594594
BNCLogLevel logLevel,
595595
const char *_Nullable file,
596-
int lineNumber,
596+
int32_t lineNumber,
597597
NSString *_Nullable message,
598598
...
599599
) {
@@ -642,10 +642,10 @@ void BNCLogWriteMessageFormat(
642642
void BNCLogWriteMessage(
643643
BNCLogLevel logLevel,
644644
NSString *_Nonnull file,
645-
NSUInteger lineNumber,
645+
int32_t lineNumber,
646646
NSString *_Nonnull message
647647
) {
648-
BNCLogWriteMessageFormat(logLevel, file.UTF8String, (int)lineNumber, @"%@", message);
648+
BNCLogWriteMessageFormat(logLevel, file.UTF8String, lineNumber, @"%@", message);
649649
}
650650

651651
void BNCLogFlushMessages() {

Branch-SDK/Branch-SDK/BNCURLBlackList.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,12 @@ - (void) processServerOperation:(id<BNCNetworkOperationProtocol>)operation {
149149
NSString *responseString = nil;
150150
if (operation.responseData)
151151
responseString = [[NSString alloc] initWithData:operation.responseData encoding:NSUTF8StringEncoding];
152-
BNCLogDebugSDK(@"No new BlackList refresh found. Error was: %@ status: %ld body:\n%@.",
153-
operation.error, operation.response.statusCode, responseString);
152+
if (operation.response.statusCode == 404) {
153+
BNCLogDebugSDK(@"No new BlackList refresh found.");
154+
} else {
155+
BNCLogDebugSDK(@"BlackList refresh result. Error: %@ status: %ld body:\n%@.",
156+
operation.error, operation.response.statusCode, responseString);
157+
}
154158
if (operation.error || operation.responseData == nil || operation.response.statusCode != 200) {
155159
self.error = operation.error;
156160
return;

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ - (void) setBlackListURLRegex:(NSArray<NSString*>*)blackListURLs {
664664
}
665665

666666
- (BOOL)handleDeepLink:(NSURL *)url {
667-
return [self handleDeepLink:url fromSelf:NO];
667+
return [self handleDeepLink:url fromSelf:YES];
668668
}
669669

670670
-(BOOL)handleDeepLinkWithNewSession:(NSURL *)url{
@@ -1777,23 +1777,23 @@ - (NSString *)longUrlWithBaseUrl:(NSString *)baseUrl
17771777
NSMutableString *longUrl = [[NSMutableString alloc] initWithFormat:@"%@?", baseUrl];
17781778

17791779
for (NSString *tag in tags) {
1780-
[longUrl appendFormat:@"tags=%@&", tag];
1780+
[longUrl appendFormat:@"tags=%@&", [BNCEncodingUtils stringByPercentEncodingStringForQuery:tag]];
17811781
}
17821782

17831783
if ([alias length]) {
1784-
[longUrl appendFormat:@"alias=%@&", alias];
1784+
[longUrl appendFormat:@"alias=%@&", [BNCEncodingUtils stringByPercentEncodingStringForQuery:alias]];
17851785
}
17861786

17871787
if ([channel length]) {
1788-
[longUrl appendFormat:@"channel=%@&", channel];
1788+
[longUrl appendFormat:@"channel=%@&", [BNCEncodingUtils stringByPercentEncodingStringForQuery:channel]];
17891789
}
17901790

17911791
if ([feature length]) {
1792-
[longUrl appendFormat:@"feature=%@&", feature];
1792+
[longUrl appendFormat:@"feature=%@&", [BNCEncodingUtils stringByPercentEncodingStringForQuery:feature]];
17931793
}
17941794

17951795
if ([stage length]) {
1796-
[longUrl appendFormat:@"stage=%@&", stage];
1796+
[longUrl appendFormat:@"stage=%@&", [BNCEncodingUtils stringByPercentEncodingStringForQuery:stage]];
17971797
}
17981798
if (type) {
17991799
[longUrl appendFormat:@"type=%ld&", (long)type];

Branch-SDK/Branch-SDK/BranchActivityItemProvider.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ - (id)item {
107107

108108
// Because Facebook et al immediately scrape URLs, we add an additional parameter to the
109109
// existing list, telling the backend to ignore the first click
110-
NSArray *scrapers = @[@"Facebook", @"Twitter", @"Slack", @"Apple Notes"];
110+
NSArray *scrapers = @[@"Facebook", @"Twitter", @"Slack", @"Apple Notes", @"Skype"];
111111
for (NSString *scraper in scrapers) {
112112
if ([channel isEqualToString:scraper]) {
113113
NSURL *URL = [NSURL URLWithString:[[Branch getInstance]
@@ -188,6 +188,7 @@ + (NSString *)humanReadableChannelWithActivityType:(NSString *)activityString {
188188
@"WeChat", @"com.tencent.xin.sharetimeline",
189189
@"LINE", @"jp.naver.line.Share",
190190
@"Pinterest", @"pinterest.ShareExtension",
191+
@"Skype", @"com.skype.skype.sharingextension",
191192

192193
// Keys for older app versions --
193194

Branch-SDK/Branch-SDK/BranchLinkProperties.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ - (NSDictionary *)controlParams {
1919
}
2020

2121
- (void)addControlParam:(NSString *)controlParam withValue:(NSString *)value {
22-
if (!controlParam || !value) {
23-
return;
24-
}
22+
if (!controlParam) return;
2523
NSMutableDictionary *temp = [self.controlParams mutableCopy];
2624
temp[controlParam] = value;
2725
_controlParams = [temp copy];

Branch-SDK/Branch-SDK/BranchShareLink.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ Presents a UIActivityViewController that shares the Branch link.
9494
///This object can be changed later when the `branchShareSheetWillShare:` delegate method is called.
9595
@property (nonatomic, strong) id _Nullable shareObject;
9696

97+
///Sets an email subject line for the share activity. If the Branch link property already has an
98+
///email subject, that attribute takes precedence over this field.
99+
@property (nonatomic, strong) NSString*_Nullable emailSubject;
100+
97101
///The resulting Branch URL that was shared.
98102
@property (nonatomic, strong, readonly) NSURL*_Nullable shareURL;
99103

0 commit comments

Comments
 (0)