Skip to content

Commit

Permalink
chore: updated iOS sdk to 0.15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed May 30, 2017
1 parent 62537d0 commit 42ea93d
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 166 deletions.
2 changes: 1 addition & 1 deletion src/ios/dependencies/Branch-SDK/BNCConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
NSString * const BNC_API_BASE_URL = @"https://api.branch.io";
NSString * const BNC_API_VERSION = @"v1";
NSString * const BNC_LINK_URL = @"https://bnc.lt";
NSString * const BNC_SDK_VERSION = @"0.14.12";
NSString * const BNC_SDK_VERSION = @"0.15.3";
30 changes: 19 additions & 11 deletions src/ios/dependencies/Branch-SDK/BNCLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,26 @@ extern void BNCLogSetFlushFunction(BNCLogFlushFunctionPtr _Nullable flushFunctio
extern BNCLogFlushFunctionPtr _Nullable BNCLogFlushFunction();


#pragma mark - BNCLogMessageInternal
#pragma mark - BNCLogWriteMessage


/// The main logging function used in the logging defines.
extern void BNCLogMessageInternal(
/// The main logging function used in the variadic logging defines.
extern void BNCLogWriteMessageFormat(
BNCLogLevel logLevel,
const char *_Nullable sourceFileName,
int sourceLineNumber,
id _Nullable messageFormat,
...
);

/// Swift-friendly wrapper for BNCLogWriteMessageFormat
extern void BNCLogWriteMessage(
BNCLogLevel logLevel,
NSString *_Nonnull sourceFileName,
NSUInteger sourceLineNumber,
NSString *_Nonnull message
);

/// This function synchronizes all outstanding log messages and writes them to the logging function
/// set by BNCLogSetOutputFunction.
extern void BNCLogFlushMessages();
Expand All @@ -141,25 +149,25 @@ extern void BNCLogFlushMessages();

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

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

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

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

///Cause a programmatic breakpoint if breakpoints are enabled.
#define BNCLogBreakPoint() \
do { \
if (BNCLogBreakPointsAreEnabled()) { \
BNCLogMessageInternal(BNCLogLevelBreakPoint, __FILE__, __LINE__, @"Programmatic breakpoint."); \
BNCLogWriteMessageFormat(BNCLogLevelBreakPoint, __FILE__, __LINE__, @"Programmatic breakpoint."); \
if (BNCDebuggerIsAttached()) { \
BNCLogFlushMessages(); \
BNCDebugBreakpoint(); \
Expand All @@ -171,7 +179,7 @@ extern void BNCLogFlushMessages();
#define BNCBreakPointWithMessage(...) \
do { \
if (BNCLogBreakPointsAreEnabled() { \
BNCLogMessageInternal(BNCLogLevelBreakPoint, __FILE__, __LINE__, __VA_ARGS__); \
BNCLogWriteMessageFormat(BNCLogLevelBreakPoint, __FILE__, __LINE__, __VA_ARGS__); \
if (BNCDebuggerIsAttached()) { \
BNCLogFlushMessages(); \
BNCDebugBreakpoint(); \
Expand All @@ -183,7 +191,7 @@ extern void BNCLogFlushMessages();
#define BNCLogAssert(condition) \
do { \
if (!(condition)) { \
BNCLogMessageInternal(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!!", #condition); \
BNCLogWriteMessageFormat(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!!", #condition); \
if (BNCLogBreakPointsAreEnabled() && BNCDebuggerIsAttached()) { \
BNCLogFlushMessages(); \
BNCDebugBreakpoint(); \
Expand All @@ -197,7 +205,7 @@ extern void BNCLogFlushMessages();
do { \
if (!(condition)) { \
NSString *m = [NSString stringWithFormat:message, __VA_ARGS__]; \
BNCLogMessageInternal(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!! %@", #condition, m); \
BNCLogWriteMessageFormat(BNCLogLevelAssert, __FILE__, __LINE__, @"(%s) !!! %@", #condition, m); \
if (BNCLogBreakPointsAreEnabled() && BNCDebuggerIsAttached()) { \
BNCLogFlushMessages(); \
BNCDebugBreakpoint(); \
Expand Down
13 changes: 11 additions & 2 deletions src/ios/dependencies/Branch-SDK/BNCLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ void BNCLogSetBreakPointsEnabled(BOOL enabled) {

#pragma mark - Log Functions

static BNCLogOutputFunctionPtr bnc_LoggingFunction = BNCLogFunctionOutputToStdOut;
static BNCLogOutputFunctionPtr bnc_LoggingFunction = nil; // Default to just NSLog output.
static BNCLogFlushFunctionPtr bnc_LogFlushFunction = BNCLogFlushFileDescriptor;

BNCLogOutputFunctionPtr _Nullable BNCLogOutputFunction() {
Expand Down Expand Up @@ -498,7 +498,7 @@ void BNCLogSetFlushFunction(BNCLogFlushFunctionPtr flushFunction) {

static dispatch_queue_t bnc_LogQueue = nil;

void BNCLogMessageInternal(
void BNCLogWriteMessageFormat(
BNCLogLevel logLevel,
const char *_Nullable file,
int lineNumber,
Expand Down Expand Up @@ -551,6 +551,15 @@ void BNCLogMessageInternal(
}
}

void BNCLogWriteMessage(
BNCLogLevel logLevel,
NSString *_Nonnull file,
NSUInteger lineNumber,
NSString *_Nonnull message
) {
BNCLogWriteMessageFormat(logLevel, file.UTF8String, (int)lineNumber, @"%@", message);
}

void BNCLogFlushMessages() {
if (BNCLogSynchronizeMessages()) {
dispatch_sync(bnc_LogQueue, ^{
Expand Down
7 changes: 4 additions & 3 deletions src/ios/dependencies/Branch-SDK/BNCServerRequestQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
//
//

#import "BNCServerRequest.h"

#import "BNCServerRequest.h"
@class BranchOpenRequest;

@interface BNCServerRequestQueue : NSObject

@property (nonatomic, readonly) unsigned int size;
@interface BNCServerRequestQueue : NSObject

- (void)enqueue:(BNCServerRequest *)request;
- (BNCServerRequest *)dequeue;
Expand All @@ -32,4 +31,6 @@

+ (id)getInstance;

@property (readonly, assign) NSInteger queueDepth;
@property (readonly, assign) BOOL isDirty;
@end
Loading

0 comments on commit 42ea93d

Please sign in to comment.