Skip to content

Commit 2ad9ad2

Browse files
authored
feat: add upload bypass option for logscreen (#57)
1 parent 1d445aa commit 2ad9ad2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

android/src/main/java/com/mparticle/react/MParticleModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ public void logCommerceEvent(final ReadableMap map) {
8686
}
8787

8888
@ReactMethod
89-
public void logScreenEvent(final String event, final ReadableMap attributesMap) {
89+
public void logScreenEvent(final String event, final ReadableMap attributesMap, final boolean shouldUploadEvent) {
9090
Map<String, String> attributes = ConvertStringMap(attributesMap);
91-
MParticle.getInstance().logScreen(event, attributes);
91+
MParticle.getInstance().logScreen(event, attributes, shouldUploadEvent);
9292
}
9393

9494
@ReactMethod

ios/RNMParticle/RNMParticle.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ + (void)load {
3434
[[MParticle sharedInstance] logCommerceEvent:commerceEvent];
3535
}
3636

37-
RCT_EXPORT_METHOD(logScreenEvent:(NSString *)screenName attributes:(NSDictionary *)attributes)
37+
RCT_EXPORT_METHOD(logScreenEvent:(NSString *)screenName attributes:(NSDictionary *)attributes shouldUploadEvent:(BOOL)shouldUploadEvent)
3838
{
39-
[[MParticle sharedInstance] logScreen:screenName eventInfo:attributes];
39+
[[MParticle sharedInstance] logScreen:screenName eventInfo:attributes shouldUploadEvent:shouldUploadEvent];
4040
}
4141

4242
RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status withATTStatusTimestampMillis:(nonnull NSNumber *)timestamp)

js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ const logCommerceEvent = (commerceEvent) => {
9696
NativeModules.MParticle.logCommerceEvent(commerceEvent)
9797
}
9898

99-
const logScreenEvent = (screenName, attributes = null) => {
100-
NativeModules.MParticle.logScreenEvent(screenName, attributes)
99+
const logScreenEvent = (screenName, attributes = null, shouldUploadEvent = true) => {
100+
NativeModules.MParticle.logScreenEvent(screenName, attributes, shouldUploadEvent)
101101
}
102102

103103
// Use ATTAuthStatus constants for status

0 commit comments

Comments
 (0)