Skip to content

Commit

Permalink
Deprecated 'start' and 'stop' methods (#236)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ijunaid committed Sep 15, 2023
1 parent 0fd3b80 commit acd6c88
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 31 deletions.
16 changes: 4 additions & 12 deletions Countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,33 +440,25 @@ Countly.configureIntentRedirectionCheck = function (allowedIntentClassNames = []
};

/**
* @deprecated Automatic sessions are handled by underlying SDK, this function will do nothing.
*
* Countly start for android
*
* @return {String || void} error message or void
*/
Countly.start = function () {
if (!_isInitialized) {
const message = "'init' must be called before 'start'";
Countly.logError('start', message);
return message;
}
CountlyReactNative.start();
Countly.logWarning('start', "Automatic sessions are handled by underlying SDK, this function will do nothing.");
};

/**
* @deprecated Automatic sessions are handled by underlying SDK, this function will do nothing.
*
* Countly stop for android
*
* @return {String || void} error message or void
*/
Countly.stop = function () {
if (!_isInitialized) {
const message = "'init' must be called before 'stop'";
Countly.logError('stop', message);
return message;
}
CountlyReactNative.stop();
Countly.logWarning('stop', "Automatic sessions are handled by underlying SDK, this function will do nothing.");
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,16 +820,6 @@ public void configureIntentRedirectionCheck(ReadableArray intentClassNames, Read
}
}

@ReactMethod
public void start() {
log("onStart", LogLevel.INFO);
}

@ReactMethod
public void stop() {
log("onStop", LogLevel.INFO);
}

@ReactMethod
public void userData_setProperty(ReadableArray args, Promise promise) {
Countly.sharedInstance();
Expand Down
2 changes: 0 additions & 2 deletions ios/src/CountlyReactNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ typedef void (^Result)(id _Nullable result);
- (void)event:(NSArray *_Nullable)arguments;
- (void)setLoggingEnabled:(NSArray *_Nullable)arguments;

- (void)start;
- (void)stop;
- (void)recordView:(NSArray *_Nullable)arguments;

- (void)setHttpPostForced:(NSArray *_Nullable)arguments;
Expand Down
7 changes: 0 additions & 7 deletions ios/src/CountlyReactNative.m
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,6 @@ + (void)log:(NSString *)theMessage {
COUNTLY_RN_LOG(theMessage);
}
}
RCT_EXPORT_METHOD(start) {
// [Countly.sharedInstance resume];
}

RCT_EXPORT_METHOD(stop) {
// [Countly.sharedInstance suspend];
}

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

0 comments on commit acd6c88

Please sign in to comment.