Skip to content

Commit acd6c88

Browse files
authored
Deprecated 'start' and 'stop' methods (#236)
* Android: Removed session start/stop and apm foreground/background calls - Removed session start/stop and apm foreground/background calls from RN android lifecylces, now these things are handled by underlying Android SDK * Updated SDK version to 23.8.0 * Revert "Updated SDK version to 23.8.0" This reverts commit 06158a0. * Updated changelog * Deprecated 'start' and 'stop' methods -- Removed native side 'start' and 'stop' methods * updated logs for start and stop methods * typo fix * updated changelog
1 parent 0fd3b80 commit acd6c88

File tree

4 files changed

+4
-31
lines changed

4 files changed

+4
-31
lines changed

Countly.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -440,33 +440,25 @@ Countly.configureIntentRedirectionCheck = function (allowedIntentClassNames = []
440440
};
441441

442442
/**
443+
* @deprecated Automatic sessions are handled by underlying SDK, this function will do nothing.
443444
*
444445
* Countly start for android
445446
*
446447
* @return {String || void} error message or void
447448
*/
448449
Countly.start = function () {
449-
if (!_isInitialized) {
450-
const message = "'init' must be called before 'start'";
451-
Countly.logError('start', message);
452-
return message;
453-
}
454-
CountlyReactNative.start();
450+
Countly.logWarning('start', "Automatic sessions are handled by underlying SDK, this function will do nothing.");
455451
};
456452

457453
/**
454+
* @deprecated Automatic sessions are handled by underlying SDK, this function will do nothing.
458455
*
459456
* Countly stop for android
460457
*
461458
* @return {String || void} error message or void
462459
*/
463460
Countly.stop = function () {
464-
if (!_isInitialized) {
465-
const message = "'init' must be called before 'stop'";
466-
Countly.logError('stop', message);
467-
return message;
468-
}
469-
CountlyReactNative.stop();
461+
Countly.logWarning('stop', "Automatic sessions are handled by underlying SDK, this function will do nothing.");
470462
};
471463

472464
/**

android/src/main/java/ly/count/android/sdk/react/CountlyReactNative.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -820,16 +820,6 @@ public void configureIntentRedirectionCheck(ReadableArray intentClassNames, Read
820820
}
821821
}
822822

823-
@ReactMethod
824-
public void start() {
825-
log("onStart", LogLevel.INFO);
826-
}
827-
828-
@ReactMethod
829-
public void stop() {
830-
log("onStop", LogLevel.INFO);
831-
}
832-
833823
@ReactMethod
834824
public void userData_setProperty(ReadableArray args, Promise promise) {
835825
Countly.sharedInstance();

ios/src/CountlyReactNative.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ typedef void (^Result)(id _Nullable result);
66
- (void)event:(NSArray *_Nullable)arguments;
77
- (void)setLoggingEnabled:(NSArray *_Nullable)arguments;
88

9-
- (void)start;
10-
- (void)stop;
119
- (void)recordView:(NSArray *_Nullable)arguments;
1210

1311
- (void)setHttpPostForced:(NSArray *_Nullable)arguments;

ios/src/CountlyReactNative.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,6 @@ + (void)log:(NSString *)theMessage {
365365
COUNTLY_RN_LOG(theMessage);
366366
}
367367
}
368-
RCT_EXPORT_METHOD(start) {
369-
// [Countly.sharedInstance resume];
370-
}
371-
372-
RCT_EXPORT_METHOD(stop) {
373-
// [Countly.sharedInstance suspend];
374-
}
375368

376369
RCT_REMAP_METHOD(getCurrentDeviceId, getCurrentDeviceIdWithResolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
377370
dispatch_async(dispatch_get_main_queue(), ^{

0 commit comments

Comments
 (0)