Skip to content

Commit be2e56d

Browse files
authored
Merge pull request #214 from BranchMetrics/update-ios-sdk
Update iOS SDK to 0.15.3
2 parents d122f33 + 4c22019 commit be2e56d

File tree

17 files changed

+327
-197
lines changed

17 files changed

+327
-197
lines changed

examples/testbed_native_ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
PODS:
2-
- Branch-SDK (0.14.12):
3-
- Branch-SDK/Core (= 0.14.12)
4-
- Branch-SDK/without-IDFA (= 0.14.12)
5-
- Branch-SDK/Core (0.14.12)
6-
- Branch-SDK/without-IDFA (0.14.12)
2+
- Branch-SDK (0.15.3):
3+
- Branch-SDK/Core (= 0.15.3)
4+
- Branch-SDK/without-IDFA (= 0.15.3)
5+
- Branch-SDK/Core (0.15.3)
6+
- Branch-SDK/without-IDFA (0.15.3)
77
- React (0.42.3):
88
- React/Core (= 0.42.3)
9-
- react-native-branch (2.0.0-beta.4):
9+
- react-native-branch (2.0.0-beta.6):
1010
- Branch-SDK
1111
- React
1212
- React/Core (0.42.3):
@@ -50,9 +50,9 @@ EXTERNAL SOURCES:
5050
:path: node_modules/react-native/ReactCommon/yoga
5151

5252
SPEC CHECKSUMS:
53-
Branch-SDK: 8a59b08daa0b283cd1bf0fd4842a521885e35ae6
53+
Branch-SDK: 07641c651b8cf3aaee9e250785377e37a2099950
5454
React: 35e039680feacd0563677d49ba410112d2748559
55-
react-native-branch: 67cdd488b224814f94b40deb9741598ba169d845
55+
react-native-branch: 986b869e807976b340d7e799b32d09c82afc5cde
5656
Yoga: 86ce777665c8259b94ef8dbea76b84634237f4ea
5757

5858
PODFILE CHECKSUM: add4645b825f22aaa2eb629899a1687f650a9588

examples/webview_example_native_ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
PODS:
2-
- Branch-SDK (0.14.12):
3-
- Branch-SDK/Core (= 0.14.12)
4-
- Branch-SDK/without-IDFA (= 0.14.12)
5-
- Branch-SDK/Core (0.14.12)
6-
- Branch-SDK/without-IDFA (0.14.12)
2+
- Branch-SDK (0.15.3):
3+
- Branch-SDK/Core (= 0.15.3)
4+
- Branch-SDK/without-IDFA (= 0.15.3)
5+
- Branch-SDK/Core (0.15.3)
6+
- Branch-SDK/without-IDFA (0.15.3)
77
- Cartography (1.1.0)
88
- React (0.42.3):
99
- React/Core (= 0.42.3)
10-
- react-native-branch (2.0.0-beta.3):
10+
- react-native-branch (2.0.0-beta.6):
1111
- Branch-SDK
1212
- React
1313
- React/Core (0.42.3):
@@ -54,10 +54,10 @@ EXTERNAL SOURCES:
5454
:path: node_modules/react-native/ReactCommon/yoga
5555

5656
SPEC CHECKSUMS:
57-
Branch-SDK: 8a59b08daa0b283cd1bf0fd4842a521885e35ae6
57+
Branch-SDK: 07641c651b8cf3aaee9e250785377e37a2099950
5858
Cartography: '0538ccb4044acbbda2266335fc58cb4228794d90'
5959
React: 35e039680feacd0563677d49ba410112d2748559
60-
react-native-branch: 55612ff46bcddee14cd40eb654f8fdb81ebc69b8
60+
react-native-branch: 986b869e807976b340d7e799b32d09c82afc5cde
6161
TextAttributes: 45b2713a1d174c377d320b51129c304eac381638
6262
Yoga: 86ce777665c8259b94ef8dbea76b84634237f4ea
6363

ios/Branch-SDK.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-SDK"
3-
s.version = "0.14.12"
3+
s.version = "0.15.3"
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?

ios/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.14.12";
14+
NSString * const BNC_SDK_VERSION = @"0.15.3";

ios/Branch-SDK/Branch-SDK/BNCLog.h

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,26 @@ extern void BNCLogSetFlushFunction(BNCLogFlushFunctionPtr _Nullable flushFunctio
119119
extern BNCLogFlushFunctionPtr _Nullable BNCLogFlushFunction();
120120

121121

122-
#pragma mark - BNCLogMessageInternal
122+
#pragma mark - BNCLogWriteMessage
123123

124124

125-
/// The main logging function used in the logging defines.
126-
extern void BNCLogMessageInternal(
125+
/// The main logging function used in the variadic logging defines.
126+
extern void BNCLogWriteMessageFormat(
127127
BNCLogLevel logLevel,
128128
const char *_Nullable sourceFileName,
129129
int sourceLineNumber,
130130
id _Nullable messageFormat,
131131
...
132132
);
133133

134+
/// Swift-friendly wrapper for BNCLogWriteMessageFormat
135+
extern void BNCLogWriteMessage(
136+
BNCLogLevel logLevel,
137+
NSString *_Nonnull sourceFileName,
138+
NSUInteger sourceLineNumber,
139+
NSString *_Nonnull message
140+
);
141+
134142
/// This function synchronizes all outstanding log messages and writes them to the logging function
135143
/// set by BNCLogSetOutputFunction.
136144
extern void BNCLogFlushMessages();
@@ -141,25 +149,25 @@ extern void BNCLogFlushMessages();
141149

142150
///@param format Log a debug message with the specified formatting.
143151
#define BNCLogDebug(...) \
144-
do { BNCLogMessageInternal(BNCLogLevelDebug, __FILE__, __LINE__, __VA_ARGS__); } while (0)
152+
do { BNCLogWriteMessageFormat(BNCLogLevelDebug, __FILE__, __LINE__, __VA_ARGS__); } while (0)
145153

146154
///@param format Log a warning message with the specified formatting.
147155
#define BNCLogWarning(...) \
148-
do { BNCLogMessageInternal(BNCLogLevelWarning, __FILE__, __LINE__, __VA_ARGS__); } while (0)
156+
do { BNCLogWriteMessageFormat(BNCLogLevelWarning, __FILE__, __LINE__, __VA_ARGS__); } while (0)
149157

150158
///@param format Log an error message with the specified formatting.
151159
#define BNCLogError(...) \
152-
do { BNCLogMessageInternal(BNCLogLevelError, __FILE__, __LINE__, __VA_ARGS__); } while (0)
160+
do { BNCLogWriteMessageFormat(BNCLogLevelError, __FILE__, __LINE__, __VA_ARGS__); } while (0)
153161

154162
///@param format Log a message with the specified formatting.
155163
#define BNCLog(...) \
156-
do { BNCLogMessageInternal(BNCLogLevelLog, __FILE__, __LINE__, __VA_ARGS__); } while (0)
164+
do { BNCLogWriteMessageFormat(BNCLogLevelLog, __FILE__, __LINE__, __VA_ARGS__); } while (0)
157165

158166
///Cause a programmatic breakpoint if breakpoints are enabled.
159167
#define BNCLogBreakPoint() \
160168
do { \
161169
if (BNCLogBreakPointsAreEnabled()) { \
162-
BNCLogMessageInternal(BNCLogLevelBreakPoint, __FILE__, __LINE__, @"Programmatic breakpoint."); \
170+
BNCLogWriteMessageFormat(BNCLogLevelBreakPoint, __FILE__, __LINE__, @"Programmatic breakpoint."); \
163171
if (BNCDebuggerIsAttached()) { \
164172
BNCLogFlushMessages(); \
165173
BNCDebugBreakpoint(); \
@@ -171,7 +179,7 @@ extern void BNCLogFlushMessages();
171179
#define BNCBreakPointWithMessage(...) \
172180
do { \
173181
if (BNCLogBreakPointsAreEnabled() { \
174-
BNCLogMessageInternal(BNCLogLevelBreakPoint, __FILE__, __LINE__, __VA_ARGS__); \
182+
BNCLogWriteMessageFormat(BNCLogLevelBreakPoint, __FILE__, __LINE__, __VA_ARGS__); \
175183
if (BNCDebuggerIsAttached()) { \
176184
BNCLogFlushMessages(); \
177185
BNCDebugBreakpoint(); \
@@ -183,7 +191,7 @@ extern void BNCLogFlushMessages();
183191
#define BNCLogAssert(condition) \
184192
do { \
185193
if (!(condition)) { \
186-
BNCLogMessageInternal(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!!", #condition); \
194+
BNCLogWriteMessageFormat(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!!", #condition); \
187195
if (BNCLogBreakPointsAreEnabled() && BNCDebuggerIsAttached()) { \
188196
BNCLogFlushMessages(); \
189197
BNCDebugBreakpoint(); \
@@ -197,7 +205,7 @@ extern void BNCLogFlushMessages();
197205
do { \
198206
if (!(condition)) { \
199207
NSString *m = [NSString stringWithFormat:message, __VA_ARGS__]; \
200-
BNCLogMessageInternal(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!! %@", #condition, m); \
208+
BNCLogWriteMessageFormat(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!! %@", #condition, m); \
201209
if (BNCLogBreakPointsAreEnabled() && BNCDebuggerIsAttached()) { \
202210
BNCLogFlushMessages(); \
203211
BNCDebugBreakpoint(); \

ios/Branch-SDK/Branch-SDK/BNCLog.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ void BNCLogSetBreakPointsEnabled(BOOL enabled) {
463463

464464
#pragma mark - Log Functions
465465

466-
static BNCLogOutputFunctionPtr bnc_LoggingFunction = BNCLogFunctionOutputToStdOut;
466+
static BNCLogOutputFunctionPtr bnc_LoggingFunction = nil; // Default to just NSLog output.
467467
static BNCLogFlushFunctionPtr bnc_LogFlushFunction = BNCLogFlushFileDescriptor;
468468

469469
BNCLogOutputFunctionPtr _Nullable BNCLogOutputFunction() {
@@ -498,7 +498,7 @@ void BNCLogSetFlushFunction(BNCLogFlushFunctionPtr flushFunction) {
498498

499499
static dispatch_queue_t bnc_LogQueue = nil;
500500

501-
void BNCLogMessageInternal(
501+
void BNCLogWriteMessageFormat(
502502
BNCLogLevel logLevel,
503503
const char *_Nullable file,
504504
int lineNumber,
@@ -551,6 +551,15 @@ void BNCLogMessageInternal(
551551
}
552552
}
553553

554+
void BNCLogWriteMessage(
555+
BNCLogLevel logLevel,
556+
NSString *_Nonnull file,
557+
NSUInteger lineNumber,
558+
NSString *_Nonnull message
559+
) {
560+
BNCLogWriteMessageFormat(logLevel, file.UTF8String, (int)lineNumber, @"%@", message);
561+
}
562+
554563
void BNCLogFlushMessages() {
555564
if (BNCLogSynchronizeMessages()) {
556565
dispatch_sync(bnc_LogQueue, ^{

ios/Branch-SDK/Branch-SDK/BNCServerRequestQueue.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
//
77
//
88

9-
#import "BNCServerRequest.h"
109

10+
#import "BNCServerRequest.h"
1111
@class BranchOpenRequest;
1212

13-
@interface BNCServerRequestQueue : NSObject
1413

15-
@property (nonatomic, readonly) unsigned int size;
14+
@interface BNCServerRequestQueue : NSObject
1615

1716
- (void)enqueue:(BNCServerRequest *)request;
1817
- (BNCServerRequest *)dequeue;
@@ -32,4 +31,6 @@
3231

3332
+ (id)getInstance;
3433

34+
@property (readonly, assign) NSInteger queueDepth;
35+
@property (readonly, assign) BOOL isDirty;
3536
@end

0 commit comments

Comments
 (0)