Skip to content

Commit 7cf43fc

Browse files
Merge pull request #21 from BranchMetrics/SDK-1189
[SDK-1189] Added deviceDataSharedState function
2 parents ada4b85 + 582a57e commit 7cf43fc

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

AdobeBranchExtension.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ Pod::Spec.new do |s|
2424
s.source_files = 'AdobeBranchExtension/Classes/**/*'
2525

2626
s.dependency 'ACPCore', '~> 2.9'
27-
s.dependency 'Branch', '~> 1.39.0'
27+
s.dependency 'Branch', '~> 1.40.0'
2828
end

AdobeBranchExtension/Classes/AdobeBranchExtensionClass.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "AdobeBranchExtension.h"
1010
#import "AdobeBranchExtensionConfig.h"
1111
#import <Branch/Branch.h>
12+
#import <Branch/BranchPluginSupport.h>
1213

1314
#pragma mark Constants
1415

@@ -256,6 +257,7 @@ - (void) trackEvent:(ACPExtensionEvent*)event {
256257
NSDictionary *content = [eventData objectForKey:@"contextdata"];
257258
BranchEvent *branchEvent = [self.class branchEventFromAdobeEventName:eventName dictionary:content];
258259
[branchEvent logEvent];
260+
[self deviceDataSharedState:event];
259261
}
260262

261263
- (BOOL)isValidEventForBranch:(NSString*)eventName {
@@ -299,4 +301,13 @@ - (void) passAdobeIdsToBranch:(ACPExtensionEvent*)eventToProcess {
299301
}
300302
}
301303

304+
- (void) deviceDataSharedState: (nonnull ACPExtensionEvent*) event {
305+
306+
NSDictionary* newDeviceData = [[BranchPluginSupport instance] deviceDescription];
307+
NSError* err = nil;
308+
if (![self.api setSharedEventState:newDeviceData event:event error:&err] && err) {
309+
NSLog(@"Error setting shared state %@:%ld", [err domain], [err code]);
310+
}
311+
}
312+
302313
@end

Examples/AdobeBranchExample/AdobeBranchExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
ACAE8131212264550049505B /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACAE8130212264550049505B /* WebKit.framework */; };
2525
ACAE81332122645B0049505B /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACAE81322122645B0049505B /* UserNotifications.framework */; };
2626
ACAE8135212264610049505B /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACAE8134212264610049505B /* SystemConfiguration.framework */; };
27+
C10F392A278E39AD00BF5D36 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C10F3929278E39AD00BF5D36 /* AdSupport.framework */; };
2728
/* End PBXBuildFile section */
2829

2930
/* Begin PBXFileReference section */
@@ -61,6 +62,7 @@
6162
ACF671D821534E4F00CDC900 /* ACPSignal_iOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ACPSignal_iOS.framework; path = Pods/ACPCoreBeta/ACPSignal_iOS.framework; sourceTree = "<group>"; };
6263
ACF671D921534E4F00CDC900 /* ACPLifecycle_iOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ACPLifecycle_iOS.framework; path = Pods/ACPCoreBeta/ACPLifecycle_iOS.framework; sourceTree = "<group>"; };
6364
B0EA9C30991048D8A522C726 /* Pods_AdobeBranchExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AdobeBranchExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
65+
C10F3929278E39AD00BF5D36 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
6466
F8688AE753553EE80251EE11 /* Pods-adobe-branch-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-adobe-branch-example.release.xcconfig"; path = "Pods/Target Support Files/Pods-adobe-branch-example/Pods-adobe-branch-example.release.xcconfig"; sourceTree = "<group>"; };
6567
FD81B1B19DDC0E314016948F /* Pods-adobe-branch-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-adobe-branch-example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-adobe-branch-example/Pods-adobe-branch-example.debug.xcconfig"; sourceTree = "<group>"; };
6668
/* End PBXFileReference section */
@@ -71,6 +73,7 @@
7173
buildActionMask = 2147483647;
7274
files = (
7375
ACAE8135212264610049505B /* SystemConfiguration.framework in Frameworks */,
76+
C10F392A278E39AD00BF5D36 /* AdSupport.framework in Frameworks */,
7477
ACAE81332122645B0049505B /* UserNotifications.framework in Frameworks */,
7578
ACAE8131212264550049505B /* WebKit.framework in Frameworks */,
7679
ACAE812F2122644F0049505B /* libz.tbd in Frameworks */,
@@ -139,6 +142,7 @@
139142
ACAE81292122643A0049505B /* Frameworks */ = {
140143
isa = PBXGroup;
141144
children = (
145+
C10F3929278E39AD00BF5D36 /* AdSupport.framework */,
142146
5FF9D44421FA692500A73E56 /* libACPCoreBeta.a */,
143147
ACF671D721534E4F00CDC900 /* ACPCore_iOS.framework */,
144148
ACF671D621534E4F00CDC900 /* ACPIdentity_iOS.framework */,

Examples/AdobeBranchExample/AdobeBranchExample/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2929
[ACPCore setLogLevel:ACPMobileLogLevelError];
3030
// [ACPCore setLogLevel:ACPMobileLogLevelVerbose];
3131
// [ACPAnalytics setVisitorIdentifier:@"custom_identifier_bb"];// for testing passAdobeIdsToBranch method
32-
32+
3333
// register ACPCore
3434
if ((YES)) {
3535
// option 1 - access hosted Adobe config

0 commit comments

Comments
 (0)