File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
android/src/main/java/com/mparticle/react Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ public void upload() {
6868 MParticle .getInstance ().upload ();
6969 }
7070
71+ @ ReactMethod
72+ public void setUploadInterval (int uploadInterval ) {
73+ MParticle .getInstance ().setUpdateInterval (uploadInterval );
74+ }
75+
7176 @ ReactMethod
7277 public void logEvent (final String name , int type , final ReadableMap attributesMap ) {
7378 Map <String , String > attributes = ConvertStringMap (attributesMap );
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ + (void)load {
2424 [[MParticle sharedInstance ] upload ];
2525}
2626
27+ RCT_EXPORT_METHOD (setUploadInterval:(NSInteger )uploadInterval)
28+ {
29+ [[MParticle sharedInstance ] setUploadInterval: uploadInterval];
30+ }
31+
2732RCT_EXPORT_METHOD (logEvent:(NSString *)eventName type:(NSInteger )type attributes:(NSDictionary *)attributes)
2833{
2934 [[MParticle sharedInstance ] logEvent: eventName eventType: type eventInfo: attributes];
Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ const upload = () => {
8888 NativeModules . MParticle . upload ( )
8989}
9090
91+ const setUploadInterval = ( uploadInterval ) => {
92+ NativeModules . MParticle . setUploadInterval ( uploadInterval )
93+ }
94+
9195const logEvent = ( eventName , type = EventType . Other , attributes = null ) => {
9296 NativeModules . MParticle . logEvent ( eventName , type , attributes )
9397}
@@ -664,8 +668,9 @@ const MParticle = {
664668 GDPRConsent,
665669 CCPAConsent,
666670
667- upload,
668- logEvent, // Methods
671+ upload, // Methods
672+ setUploadInterval,
673+ logEvent,
669674 logMPEvent,
670675 logCommerceEvent,
671676 logScreenEvent,
You can’t perform that action at this time.
0 commit comments