Skip to content

Commit c740500

Browse files
authored
Release20.11.9 (#60)
* — Automatic crash reporting issue fixed. — Android background session logging issue fixed. — Updated underlying android SDK to 20.11.10 — RN SDK version updated to 20.11.9 * Activity missing fixed.
1 parent 0104452 commit c740500

File tree

8 files changed

+31
-7
lines changed

8 files changed

+31
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 20.11.9
2+
* Automatic crash reporting issue fixed.
3+
* Android background session logging issue fixed.
4+
* Updated underlying android SDK to 20.11.10
5+
* Underlying iOS SDK version is 20.11.1
6+
17
## 20.11.8
28
* For android devices, moving a push related broadcast receiver decleration to the manifest to comply with 'PendingIntent' checks from the Play store
39
* Updated underlying android SDK to 20.11.9

Countly.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Countly.isCrashReportingEnabled = false;
301301
* Should be called before Countly init
302302
*/
303303
Countly.enableCrashReporting = async function(){
304+
CountlyReactNative.enableCrashReporting();
304305
if (ErrorUtils && !Countly.isCrashReportingEnabled) {
305306
if(await CountlyReactNative.isLoggingEnabled()) {
306307
console.log("[CountlyReactNative] Adding Countly JS error handler.");
@@ -338,7 +339,6 @@ Countly.enableCrashReporting = async function(){
338339
});
339340
}
340341
Countly.isCrashReportingEnabled = true;
341-
CountlyReactNative.enableCrashReporting();
342342
}
343343

344344
Countly.addCrashLog = function(crashLog){

CountlyReactNative.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CountlyReactNative'
3-
s.version = '20.11.8'
3+
s.version = '20.11.9'
44
s.license = {
55
:type => 'COMMUNITY',
66
:text => <<-LICENSE

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ repositories {
4646

4747
dependencies {
4848
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
49-
implementation 'ly.count.android:sdk:20.11.9'
49+
implementation 'ly.count.android:sdk:20.11.10'
5050

5151
//if any version higher than 18.0.0 is used then it forces AndroidX
5252
implementation 'com.google.firebase:firebase-messaging:18.0.0'

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public String toString(){
7474
public class CountlyReactNative extends ReactContextBaseJavaModule implements LifecycleEventListener {
7575

7676
public static final String TAG = "CountlyRNPlugin";
77-
private String COUNTLY_RN_SDK_VERSION_STRING = "20.11.8";
77+
private String COUNTLY_RN_SDK_VERSION_STRING = "20.11.9";
7878
private String COUNTLY_RN_SDK_NAME = "js-rnb-android";
7979

8080
private static CountlyConfig config = new CountlyConfig();
@@ -86,6 +86,7 @@ public class CountlyReactNative extends ReactContextBaseJavaModule implements Li
8686
protected static boolean loggingEnabled = false;
8787

8888
private boolean isOnResumeBeforeInit = false;
89+
private Boolean isSessionStarted_ = false;
8990

9091
private ReactApplicationContext _reactContext;
9192

@@ -562,16 +563,26 @@ public void onComplete(Task<InstanceIdResult> task) {
562563

563564
@ReactMethod
564565
public void start(){
566+
if (isSessionStarted_) {
567+
log("session already started", LogLevel.INFO);
568+
return;
569+
}
565570
Activity activity = this.getActivity();
566571
if (activity == null) {
567572
log("While calling 'start', Activity is null", LogLevel.WARNING);
568573
}
569574
Countly.sharedInstance().onStart(activity);
575+
isSessionStarted_ = true;
570576
}
571577

572578
@ReactMethod
573579
public void stop(){
580+
if (!isSessionStarted_) {
581+
log("must call Start before Stop", LogLevel.INFO);
582+
return;
583+
}
574584
Countly.sharedInstance().onStop();
585+
isSessionStarted_ = false;
575586
}
576587

577588
@ReactMethod
@@ -1071,6 +1082,10 @@ Activity getActivity() {
10711082
@Override
10721083
public void onHostResume() {
10731084
if(Countly.sharedInstance().isInitialized()) {
1085+
if (isSessionStarted_) {
1086+
Activity activity = getActivity();
1087+
Countly.sharedInstance().onStart(activity);
1088+
}
10741089
Countly.sharedInstance().apm().triggerForeground();
10751090
}
10761091
else {
@@ -1081,6 +1096,9 @@ public void onHostResume() {
10811096
@Override
10821097
public void onHostPause() {
10831098
if(Countly.sharedInstance().isInitialized()) {
1099+
if (isSessionStarted_) {
1100+
Countly.sharedInstance().onStop();
1101+
}
10841102
Countly.sharedInstance().apm().triggerBackground();
10851103
}
10861104
}

example/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rm App.js
1111
curl https://raw.githubusercontent.com/Countly/countly-sdk-react-native-bridge/master/example/App.js --output App.js
1212
curl https://raw.githubusercontent.com/Countly/countly-sdk-react-native-bridge/master/example/Example.js --output Example.js
1313

14-
14+
1515

1616
cd ./ios
1717
pod install

ios/src/CountlyReactNative.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ @interface CountlyFeedbackWidget ()
2121
+ (CountlyFeedbackWidget *)createWithDictionary:(NSDictionary *)dictionary;
2222
@end
2323

24-
NSString* const kCountlyReactNativeSDKVersion = @"20.11.8";
24+
NSString* const kCountlyReactNativeSDKVersion = @"20.11.9";
2525
NSString* const kCountlyReactNativeSDKName = @"js-rnb-ios";
2626

2727
CountlyConfig* config = nil;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "countly-sdk-react-native-bridge",
3-
"version": "20.11.8",
3+
"version": "20.11.9",
44
"author": "Countly <[email protected]> (https://count.ly/)",
55
"bugs": {
66
"url": "https://github.com/Countly/countly-sdk-react-native-bridge/issues"

0 commit comments

Comments
 (0)