Skip to content

Commit 85967dd

Browse files
author
Edward Smith
committed
Fixed searchAd debug mode. Version 0.19.4.
1 parent e27c7a0 commit 85967dd

File tree

10 files changed

+31
-15
lines changed

10 files changed

+31
-15
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.3";
14+
NSString * const BNC_SDK_VERSION = @"0.19.4";

Branch-SDK/Branch-SDK/BNCDeviceInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@property (atomic, copy, readonly) NSString* language; //!< The iso2 language code (en, ml).
2828
@property (atomic, copy, readonly) NSString* browserUserAgent; //!< Simple user agent string.
2929
@property (atomic, copy, readonly) NSString* localIPAddress; //!< The current local IP address.
30-
30+
@property (atomic, copy, readonly) NSArray<NSString*> *allIPAddresses; //!< All local IP addresses.
3131
//----------Methods----------------//
3232
+ (BNCDeviceInfo *)getInstance;
3333
+ (NSString*) userAgentString; // Warning: Has an implied lock on main thread on first call.

Branch-SDK/Branch-SDK/BNCDeviceInfo.m

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#import <arpa/inet.h>
2020
#import <netinet/in.h>
2121

22-
#pragma mark - BRNNetworkInfo
22+
#pragma mark BRNNetworkInfo
2323

2424
typedef NS_ENUM(NSInteger, BNCNetworkAddressType) {
2525
BNCNetworkAddressTypeUnknown = 0,
@@ -58,9 +58,15 @@ @implementation BNCNetworkInterface
5858
// BNCLogDebugSDK(@"Found %s: %x.", interface->ifa_name, interface->ifa_flags);
5959

6060
// Check the state: IFF_RUNNING, IFF_UP, IFF_LOOPBACK, etc.
61-
if (!(interface->ifa_flags & IFF_RUNNING) ||
62-
(interface->ifa_flags & IFF_LOOPBACK))
63-
continue;
61+
if ((interface->ifa_flags & IFF_UP) &&
62+
(interface->ifa_flags & IFF_RUNNING) &&
63+
!(interface->ifa_flags & IFF_LOOPBACK)) {
64+
} else {
65+
continue;
66+
}
67+
68+
// TODO: Check ifdata too.
69+
// struct if_data *ifdata = interface->ifa_data;
6470

6571
const struct sockaddr_in *addr = (const struct sockaddr_in*)interface->ifa_addr;
6672
if (!addr) continue;
@@ -189,6 +195,14 @@ - (NSString*) localIPAddress { // For 'local_ip' server field.
189195
}
190196
}
191197

198+
- (NSArray<NSString*>*) allIPAddresses {
199+
NSMutableArray *array = [NSMutableArray new];
200+
for (BNCNetworkInterface *inf in [BNCNetworkInterface currentInterfaces]) {
201+
[array addObject:inf.description];
202+
}
203+
return array;
204+
}
205+
192206
+ (NSString*) bnc_country {
193207

194208
NSString *country = nil;

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ - (BOOL)checkAppleSearchAdsAttribution {
811811
// If searchAdsDebugMode is on then force the result to a set value for testing:
812812
if (self.searchAdsDebugMode) {
813813
// Round down to one day for testing.
814-
NSTimeInterval const kOneDay = (60.0*60.0*24.0);
815-
NSTimeInterval t = trunc([[NSDate date] timeIntervalSince1970] / kOneDay) * kOneDay;
814+
NSTimeInterval const kOneHour = (60.0*60.0*1.0);
815+
NSTimeInterval t = trunc([[NSDate date] timeIntervalSince1970] / kOneHour) * kOneHour;
816816
NSDate *date = [NSDate dateWithTimeIntervalSince1970:t];
817817

818818
attrDetails = @{

Branch-TestBed/Branch-TestBed-UITests/UITestBed/TBAppDelegate.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ @implementation TBAppDelegate
2020

2121
- (BOOL)application:(UIApplication *)application
2222
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
23-
23+
BNCLogSetDisplayLevel(BNCLogLevelAll);
24+
2425
[self initializeViewControllers];
2526

2627
// Initialize Branch

Branch-TestBed/Branch-TestBed-UITests/UITestBed/TBBranchViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ - (IBAction) sendCommerceEvent:(id)sender {
274274
}
275275

276276
- (IBAction)showLocalIPAddress:(id)sender {
277+
BNCLogDebugSDK(@"All IP Addresses:\n%@\n.", [BNCDeviceInfo getInstance].allIPAddresses);
277278
NSString *lip = [BNCDeviceInfo getInstance].localIPAddress;
278279
if (!lip) lip = @"<nil>";
279280
if (lip.length == 0) lip = @"<empty string>";

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.3</string>
20+
<string>0.19.4</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>0.19.3</string>
24+
<string>0.19.4</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.3"
3+
s.version = "0.19.4"
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.3</string>
18+
<string>0.19.4</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.19.3</string>
22+
<string>0.19.4</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.3
34+
version=0.19.4
3535

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

0 commit comments

Comments
 (0)