Skip to content

Commit

Permalink
Merge pull request BranchMetrics#28 from BranchMetrics/staging
Browse files Browse the repository at this point in the history
Prepping release
  • Loading branch information
echo-branch authored Jan 11, 2020
2 parents efeb92d + a5ac64a commit 00e59ab
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 31 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Branch-Segment-iOS Change Log

- v0.1.20
* Update to Branch iOS SDK 0.31.x
* Fix broken 0.1.19 release
* Note, we recommend using data export integration instead.

- v0.1.19
* Update to Branch iOS SDK 0.30.x
* Add Carthage support
Expand Down
14 changes: 7 additions & 7 deletions Examples/Basic/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- Analytics (3.7.0)
- Branch (0.28.1):
- Branch/Core (= 0.28.1)
- Branch/Core (0.28.1)
- Segment-Branch (0.1.18):
- Branch (0.31.0):
- Branch/Core (= 0.31.0)
- Branch/Core (0.31.0)
- Segment-Branch (0.1.19):
- Analytics
- Branch (~> 0.28.1)
- Branch (~> 0.31.0)

DEPENDENCIES:
- Segment-Branch (from `../../`)
Expand All @@ -21,8 +21,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Analytics: 77fd5fb102a4a5eedafa2c2b0245ceb7b7c15e45
Branch: edf6cab0cecb437d6a6abba3a25d0a0fa6f277ec
Segment-Branch: 72a94a85370f5f1d8e602efee1c2718e720e382b
Branch: d2e1611afa9ea9aa36fa1996df7f38ca2c3eb03e
Segment-Branch: 5e4417c60dfe3e637dfe0e3bf43d29cd3bbabe3e

PODFILE CHECKSUM: 78184f7517c6ccb70de817ffff6b14b6aa2be09c

Expand Down
8 changes: 8 additions & 0 deletions Examples/Fortune/Fortune.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
AC82B3C46524DFE4413D237A /* Pods-Fortune.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Fortune.release.xcconfig"; path = "Pods/Target Support Files/Pods-Fortune/Pods-Fortune.release.xcconfig"; sourceTree = "<group>"; };
BB3C167ABDA2BEF39A727D83 /* Pods_Fortune.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Fortune.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CD1B4B16E0C1F91754DFDA87 /* Pods-Fortune.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Fortune.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Fortune/Pods-Fortune.debug.xcconfig"; sourceTree = "<group>"; };
E3C8947F23A458B30003C9AA /* Fortune-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Fortune-Bridging-Header.h"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -147,6 +148,7 @@
4D193B4E1F858D7B00228824 /* UIViewController+Fortune.swift */,
4D8B77731F8462C200EFD3FF /* WaitingViewController.swift */,
4D8B77721F8462C200EFD3FF /* WaitingViewController.xib */,
E3C8947F23A458B30003C9AA /* Fortune-Bridging-Header.h */,
);
path = Fortune;
sourceTree = "<group>";
Expand Down Expand Up @@ -206,6 +208,7 @@
TargetAttributes = {
4D8B775A1F8442D100EFD3FF = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 1120;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.SafariKeychain = {
Expand Down Expand Up @@ -455,13 +458,16 @@
baseConfigurationReference = CD1B4B16E0C1F91754DFDA87 /* Pods-Fortune.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Fortune/Fortune.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = R63EM248DP;
INFOPLIST_FILE = Fortune/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.branch.SegmentFortune;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Fortune/Fortune-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -472,13 +478,15 @@
baseConfigurationReference = AC82B3C46524DFE4413D237A /* Pods-Fortune.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Fortune/Fortune.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = R63EM248DP;
INFOPLIST_FILE = Fortune/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.branch.SegmentFortune;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Fortune/Fortune-Bridging-Header.h";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
4 changes: 4 additions & 0 deletions Examples/Fortune/Fortune/Fortune-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

14 changes: 7 additions & 7 deletions Examples/Fortune/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- Analytics (3.7.0)
- Branch (0.28.1):
- Branch/Core (= 0.28.1)
- Branch/Core (0.28.1)
- Segment-Branch (0.1.18):
- Branch (0.31.0):
- Branch/Core (= 0.31.0)
- Branch/Core (0.31.0)
- Segment-Branch (0.1.19):
- Analytics
- Branch (~> 0.28.1)
- Branch (~> 0.31.0)

DEPENDENCIES:
- Segment-Branch (from `../../`)
Expand All @@ -21,8 +21,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Analytics: 77fd5fb102a4a5eedafa2c2b0245ceb7b7c15e45
Branch: edf6cab0cecb437d6a6abba3a25d0a0fa6f277ec
Segment-Branch: 72a94a85370f5f1d8e602efee1c2718e720e382b
Branch: d2e1611afa9ea9aa36fa1996df7f38ca2c3eb03e
Segment-Branch: 5e4417c60dfe3e637dfe0e3bf43d29cd3bbabe3e

PODFILE CHECKSUM: d99c63e88e20aad6d9f4c2ebd3ecbccf350dc1e8

Expand Down
33 changes: 18 additions & 15 deletions Pod/Classes/BNCBranchIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#import <Analytics/SEGAnalytics.h>
#import <Analytics/SEGAnalyticsUtils.h>

@interface Branch (SegmentBranch)
- (void) initSessionIfNeededAndNotInProgress;
@end

@implementation BNCBranchIntegration

Expand All @@ -24,13 +21,14 @@ - (instancetype)initWithSettings:(NSDictionary *)settings analytics:(SEGAnalytic
self.settings = settings ?: @{};
NSString *branchKey = [self.settings objectForKey:@"branch_key"];
[Branch setBranchKey:branchKey];
NSString*segmentID = [analytics getAnonymousId];
if (segmentID.length) {
[[BNCPreferenceHelper preferenceHelper] setRequestMetadataKey:@"$segment_anonymous_id" value:segmentID];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.20 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[[Branch getInstance] initSessionIfNeededAndNotInProgress];
});

[[Branch getInstance] dispatchToIsolationQueue:^{
NSString *segmentID = [analytics getAnonymousId];
if (segmentID.length) {
[[BNCPreferenceHelper preferenceHelper] setRequestMetadataKey:@"$segment_anonymous_id" value:segmentID];
}
}];

return self;
}

Expand Down Expand Up @@ -267,20 +265,25 @@ + (BranchEvent*) branchEventFromSegmentEvent:(NSString*)eventName
addStringField(event.searchQuery, query);

NSArray *products = dictionary[@"products"];
NSMutableArray *contentItems = [NSMutableArray<BranchUniversalObject *> new];
if ([products isKindOfClass:NSArray.class]) {
for (NSMutableDictionary *product in products) {
BranchUniversalObject *object = [self universalObjectFromDictionary:product];
if (object) [event.contentItems addObject:object];
if (object) {
[contentItems addObject:object];
}
}
dictionary[@"products"] = nil;
}

// Maybe the some product fields are at the first level. Don't add if we already have:
if (event.contentItems.count == 0) {
if (contentItems.count == 0) {
BranchUniversalObject *object = [self universalObjectFromDictionary:dictionary];
if (object) [event.contentItems addObject:object];
if (object) {
[contentItems addObject:object];
}
}

event.contentItems = [NSArray arrayWithArray:contentItems];

// Add any extra fields to customData:
event.customData = [self stringDictionaryFromDictionary:dictionary];

Expand Down
4 changes: 2 additions & 2 deletions Segment-Branch.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Segment-Branch"
s.version = "0.1.19"
s.version = "0.1.20"
s.summary = "Branch Integration for Analytics for iOS."

s.description = <<-DESC
Expand All @@ -24,5 +24,5 @@ Pod::Spec.new do |s|
s.source_files = 'Pod/Classes/**/*'

s.dependency 'Analytics'
s.dependency 'Branch', '~> 0.30.0'
s.dependency 'Branch', '~> 0.31.0'
end

0 comments on commit 00e59ab

Please sign in to comment.