File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
android/src/main/java/com/batch/batch_rn Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -642,6 +642,14 @@ public void userData_save(ReadableArray actions) {
642
642
String value = action .getString ("value" );
643
643
editor .setRegion (value );
644
644
}
645
+ } else if (type .equals ("setAttributionId" )) {
646
+ ReadableType valueType = action .getType ("value" );
647
+ if (valueType .equals (ReadableType .Null )) {
648
+ editor .setAttributionIdentifier (null );
649
+ } else {
650
+ String value = action .getString ("value" );
651
+ editor .setAttributionIdentifier (value );
652
+ }
645
653
} else if (type .equals ("addTag" )) {
646
654
String collection = action .getString ("collection" );
647
655
String tag = action .getString ("tag" );
Original file line number Diff line number Diff line change @@ -302,7 +302,6 @@ -(void)stopObserving {
302
302
303
303
else if ([type isEqualToString: @" setIdentifier" ]) {
304
304
[editor setIdentifier: [self safeNilValue: action[@" value" ]]];
305
-
306
305
}
307
306
308
307
else if ([type isEqualToString: @" setEmail" ]) {
@@ -326,6 +325,10 @@ -(void)stopObserving {
326
325
[editor setRegion: [self safeNilValue: action[@" value" ]]];
327
326
}
328
327
328
+ else if ([type isEqualToString: @" setAttributionId" ]) {
329
+ [editor setAttributionIdentifier: [self safeNilValue: action[@" value" ]]];
330
+ }
331
+
329
332
else if ([type isEqualToString: @" addTag" ]) {
330
333
[editor addTag: action[@" tag" ] inCollection: action[@" collection" ]];
331
334
}
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ interface IUserSettingsSetEmailMarketingSubscriptionStateAction {
61
61
value : BatchEmailSubscriptionState ;
62
62
}
63
63
64
+ interface IUserSettingsSetAttributionIdAction {
65
+ type : 'setAttributionId' ;
66
+ value : string | null ;
67
+ }
68
+
64
69
interface IUserSettingsAddTagAction {
65
70
type : 'addTag' ;
66
71
collection : string ;
@@ -96,7 +101,8 @@ type IUserSettingsAction =
96
101
| IUserSettingsClearTagsAction
97
102
| IUserSettingsClearTagCollectionAction
98
103
| IUserSettingsSetEmailAction
99
- | IUserSettingsSetEmailMarketingSubscriptionStateAction ;
104
+ | IUserSettingsSetEmailMarketingSubscriptionStateAction
105
+ | IUserSettingsSetAttributionIdAction ;
100
106
101
107
type IUserSettingsActions = IUserSettingsAction [ ] ;
102
108
@@ -187,6 +193,13 @@ export class BatchUserEditor {
187
193
} ) ;
188
194
}
189
195
196
+ public setAttributionIdentifier ( value : string | null ) : BatchUserEditor {
197
+ return this . addAction ( {
198
+ type : 'setAttributionId' ,
199
+ value,
200
+ } ) ;
201
+ }
202
+
190
203
public addTag ( collection : string , tag : string ) : BatchUserEditor {
191
204
return this . addAction ( {
192
205
type : 'addTag' ,
You can’t perform that action at this time.
0 commit comments