Skip to content

Commit

Permalink
fix: updated iOS SDK to 0.12.16 [ √ iOS ]
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Nov 15, 2016
1 parent 1b3d48e commit afb4446
Show file tree
Hide file tree
Showing 37 changed files with 506 additions and 166 deletions.
3 changes: 1 addition & 2 deletions hooks/afterPrepareHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ function activateUniversalLinksInIos(cordovaContext, pluginPreferences) {

// generate entitlements file
iosProjectEntitlements.generateAssociatedDomainsEntitlements(cordovaContext, pluginPreferences);
}
//# sourceMappingURL=afterPrepareHook.js.map
}
3 changes: 1 addition & 2 deletions hooks/beforePluginInstallHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,4 @@ module.exports = function (ctx) {
installRequiredNodeModules(modules);

createPluginInstalledFlag(ctx);
};
//# sourceMappingURL=beforePluginInstallHook.js.map
};
3 changes: 1 addition & 2 deletions hooks/iosBeforePrepareHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,4 @@ function getOldProjectName(projectDir) {
return projectName;
}

// endregion
//# sourceMappingURL=iosBeforePrepareHook.js.map
// endregion
3 changes: 1 addition & 2 deletions hooks/lib/android/manifestWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,4 @@ Class injects plugin preferences into AndroidManifest.xml file.
}

// endregion
})();
//# sourceMappingURL=manifestWriter.js.map
})();
3 changes: 1 addition & 2 deletions hooks/lib/configXmlHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ Helper class to read data from config.xml file.
}

// endregion
})();
//# sourceMappingURL=configXmlHelper.js.map
})();
3 changes: 1 addition & 2 deletions hooks/lib/configXmlParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ Parser for config.xml file. Read plugin-specific preferences (from <branch-confi
}

// endregion
})();
//# sourceMappingURL=configXmlParser.js.map
})();
3 changes: 1 addition & 2 deletions hooks/lib/ios/projectEntitlements.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,4 @@ Script only generates content. File it self is included in the xcode project in
}

// endregion
})();
//# sourceMappingURL=projectEntitlements.js.map
})();
3 changes: 1 addition & 2 deletions hooks/lib/ios/xcodePreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,4 @@ Which is:
}

// endregion
})();
//# sourceMappingURL=xcodePreferences.js.map
})();
3 changes: 1 addition & 2 deletions hooks/lib/xmlHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ Small helper class to read/write from/to xml file.

return isSaved;
}
})();
//# sourceMappingURL=xmlHelper.js.map
})();
2 changes: 1 addition & 1 deletion src/ios/dependencies/Branch-SDK/BNCConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef Branch_SDK_Config_h
#define Branch_SDK_Config_h

#define SDK_VERSION @"0.12.11"
#define SDK_VERSION @"0.12.16"

#define BNC_PROD_ENV
//#define BNC_STAGE_ENV
Expand Down
5 changes: 1 addition & 4 deletions src/ios/dependencies/Branch-SDK/BNCContentDiscoveryManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ - (NSString *)spotlightIdentifierFromActivity:(NSUserActivity *)userActivity {
// If it has our prefix, then the link identifier is just the last piece of the identifier.
NSString *activityIdentifier = userActivity.userInfo[CSSearchableItemActivityIdentifier];
BOOL isBranchIdentifier = [activityIdentifier hasPrefix:BRANCH_SPOTLIGHT_PREFIX];

// Checking for CSSearchableItemActionType in the activity for legacy spotlight indexing (pre 0.12.7)
// Now we index NSUserActivies with type set to io.branch. + bundleId for better SEO
if ([userActivity.activityType isEqualToString:CSSearchableItemActionType] || isBranchIdentifier) {
if (isBranchIdentifier) {
return activityIdentifier;
}
#endif
Expand Down
10 changes: 7 additions & 3 deletions src/ios/dependencies/Branch-SDK/BNCDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
@property (nonatomic, strong) NSString *modelName;
@property (nonatomic, strong) NSString *osName;
@property (nonatomic, strong) NSString *osVersion;
@property (nonatomic) NSNumber *screenWidth;
@property (nonatomic) NSNumber *screenHeight;
@property (nonatomic, strong) NSNumber *screenWidth;
@property (nonatomic, strong) NSNumber *screenHeight;
@property (nonatomic) BOOL isAdTrackingEnabled;

@property (nonatomic, strong) NSString* country; // iso2 Country name (us, in,etc).
@property (nonatomic, strong) NSString* language; // iso2 language code (en, ml).
@property (nonatomic, strong) NSString* browserUserAgent; // Simple user agent string.


//----------Methods----------------//
+ (BNCDeviceInfo *)getInstance;

@end
@end
77 changes: 59 additions & 18 deletions src/ios/dependencies/Branch-SDK/BNCDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
// Copyright © 2016 Branch Metrics. All rights reserved.
//


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BNCDeviceInfo.h"
#import "BNCPreferenceHelper.h"
#import "BNCSystemObserver.h"
#import "BNCXcode7Support.h"


@interface BNCDeviceInfo()

Expand All @@ -27,26 +31,63 @@ + (BNCDeviceInfo *)getInstance {
}

- (id)init {
if (self = [super init]) {
BNCPreferenceHelper *preferenceHelper = [BNCPreferenceHelper preferenceHelper];
BOOL isRealHardwareId;
NSString *hardwareIdType;
NSString *hardwareId = [BNCSystemObserver getUniqueHardwareId:&isRealHardwareId isDebug:preferenceHelper.isDebug andType:&hardwareIdType];
if (hardwareId) {
self.hardwareId = hardwareId;
self.isRealHardwareId = isRealHardwareId;
self.hardwareIdType = hardwareIdType;
self = [super init];
if (!self) return self;

BNCPreferenceHelper *preferenceHelper = [BNCPreferenceHelper preferenceHelper];
BOOL isRealHardwareId;
NSString *hardwareIdType;
NSString *hardwareId =
[BNCSystemObserver getUniqueHardwareId:&isRealHardwareId
isDebug:preferenceHelper.isDebug
andType:&hardwareIdType];
if (hardwareId) {
self.hardwareId = hardwareId;
self.isRealHardwareId = isRealHardwareId;
self.hardwareIdType = hardwareIdType;
}

self.vendorId = [BNCSystemObserver getVendorId];
self.brandName = [BNCSystemObserver getBrand];
self.modelName = [BNCSystemObserver getModel];
self.osName = [BNCSystemObserver getOS];
self.osVersion = [BNCSystemObserver getOSVersion];
self.screenWidth = [BNCSystemObserver getScreenWidth];
self.screenHeight = [BNCSystemObserver getScreenHeight];
self.isAdTrackingEnabled = [BNCSystemObserver adTrackingSafe];

// Get the locale info --
CGFloat systemVersion = [UIDevice currentDevice].systemVersion.floatValue;
if (systemVersion < 9.0) {

self.language = [[NSLocale preferredLanguages] firstObject];
NSString *rawLocale = [NSLocale currentLocale].localeIdentifier;
NSRange range = [rawLocale rangeOfString:@"_"];
if (range.location != NSNotFound) {
range = NSMakeRange(range.location+1, rawLocale.length-range.location-1);
self.country = [rawLocale substringWithRange:range];
}

self.vendorId = [BNCSystemObserver getVendorId];
self.brandName = [BNCSystemObserver getBrand];
self.modelName = [BNCSystemObserver getModel];
self.osName = [BNCSystemObserver getOS];
self.osVersion = [BNCSystemObserver getOSVersion];
self.screenWidth = [BNCSystemObserver getScreenWidth];
self.screenHeight = [BNCSystemObserver getScreenHeight];
self.isAdTrackingEnabled = [BNCSystemObserver adTrackingSafe];

} else if (systemVersion < 10.0) {

NSString *rawLanguage = [[NSLocale preferredLanguages] firstObject];
NSDictionary *languageDictionary = [NSLocale componentsFromLocaleIdentifier:rawLanguage];
self.country = [languageDictionary objectForKey:@"kCFLocaleCountryCodeKey"];
self.language = [languageDictionary objectForKey:@"kCFLocaleLanguageCodeKey"];

} else {

NSLocale *locale = [NSLocale currentLocale];
self.country = [locale countryCode];
self.language = [locale languageCode ];

}

self.browserUserAgent =
[[[UIWebView alloc]
initWithFrame:CGRectZero]
stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];

return self;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ios/dependencies/Branch-SDK/BNCEncodingUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ + (NSString *)encodeDictionaryToJsonString:(NSDictionary *)dictionary {
}
else {
// If this type is not a known type, don't attempt to encode it.
NSLog(@"Cannot encode value for key %@, type is in list of accepted types", key);
NSLog(@"[encodeDictionaryToJsonString] Cannot encode value for key %@, type is not in list of accepted types", key);
continue;
}

Expand Down Expand Up @@ -311,7 +311,7 @@ + (NSString *)encodeArrayToJsonString:(NSArray *)array {
}
else {
// If this type is not a known type, don't attempt to encode it.
NSLog(@"Cannot encode value %@, type is not in list of accepted types", obj);
NSLog(@"[encodedArray] Cannot encode value %@, type is not in list of accepted types", obj);
continue;
}

Expand Down Expand Up @@ -365,7 +365,7 @@ + (NSString *)encodeDictionaryToQueryString:(NSDictionary *)dictionary {
}
else {
// If this type is not a known type, don't attempt to encode it.
NSLog(@"Cannot encode value %@, type is in not list of accepted types", obj);
NSLog(@"[encodeDictionaryToQueryString] Cannot encode value %@, type is not in list of accepted types", obj);
continue;
}

Expand Down
6 changes: 4 additions & 2 deletions src/ios/dependencies/Branch-SDK/BNCError.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
// Copyright (c) 2014 Branch Metrics. All rights reserved.
//


#import <Foundation/Foundation.h>

FOUNDATION_EXPORT NSString * const BNCErrorDomain;

FOUNDATION_EXPORT NSString *_Nonnull const BNCErrorDomain;

enum {
BNCInitError = 1000,
Expand All @@ -22,4 +24,4 @@ enum {

@interface BNCError : NSObject

@end
@end
2 changes: 2 additions & 0 deletions src/ios/dependencies/Branch-SDK/BNCError.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
// Copyright (c) 2014 Branch Metrics. All rights reserved.
//


#import "BNCError.h"


NSString * const BNCErrorDomain = @"io.branch";

@implementation BNCError
Expand Down
2 changes: 2 additions & 0 deletions src/ios/dependencies/Branch-SDK/BNCPreferenceHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
@property (strong, nonatomic) NSString *externalIntentURI;
@property (strong, nonatomic) NSMutableDictionary *savedAnalyticsData;
@property (assign, nonatomic) NSInteger installRequestDelay;
@property (strong, nonatomic) NSDictionary *appleSearchAdDetails;

+ (BNCPreferenceHelper *)preferenceHelper;
+ (NSURL*) URLForBranchDirectory;

- (NSString *)getAPIBaseURL;
- (NSString *)getAPIURL:(NSString *)endpoint;
Expand Down
Loading

0 comments on commit afb4446

Please sign in to comment.