Skip to content

Commit d33164d

Browse files
a7medevHeshamMegid
authored andcommitted
chore: remove deprecated apis (#1027)
Jira ID: MOB-12994
1 parent 8a1d23e commit d33164d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+81
-1182
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v11.14.0...dev)
4+
5+
### Changed
6+
7+
- **BREAKING** Remove deprecated APIs ([#1027](https://github.com/Instabug/Instabug-React-Native/pull/1027)). See migration guide for more details.
8+
39
## [11.14.0](https://github.com/Instabug/Instabug-React-Native/compare/v11.13.0...v11.14.0) (September 15, 2023)
410

511
### Added

android/sourcemaps.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ boolean isUploadSourcemapsEnabled() {
8484
def envValue = System.getenv('INSTABUG_SOURCEMAPS_UPLOAD_DISABLE')?.toBoolean()
8585
def defaultValue = true
8686

87-
if (rootProject.hasProperty('instabugUploadEnable')) {
88-
project.logger.warn "The property instabugUploadEnable is deprecated and will be removed in an upcoming version. \n" +
89-
"You can use INSTABUG_SOURCEMAPS_UPLOAD_DISABLE environment variable instead."
90-
defaultValue = rootProject.property('instabugUploadEnable')
91-
}
92-
9387
return (envValue != null) ? !envValue : defaultValue
9488
}
9589

android/src/main/java/com/instabug/reactlibrary/ArgsRegistry.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22

33
import androidx.annotation.NonNull;
44

5-
import com.instabug.apm.model.LogLevel;
65
import com.instabug.bug.BugReporting;
76
import com.instabug.bug.invocation.Option;
87
import com.instabug.featuresrequest.ActionType;
98

10-
import com.instabug.library.OnSdkDismissCallback;
119
import com.instabug.library.InstabugColorTheme;
1210
import com.instabug.library.InstabugCustomTextPlaceHolder.Key;
1311
import com.instabug.library.OnSdkDismissCallback.DismissType;
1412
import com.instabug.library.ReproMode;
15-
import com.instabug.library.core.plugin.PluginPromptOption;
1613
import com.instabug.library.extendedbugreport.ExtendedBugReport;
1714
import com.instabug.library.internal.module.InstabugLocale;
1815
import com.instabug.library.invocation.InstabugInvocationEvent;
1916
import com.instabug.library.invocation.util.InstabugFloatingButtonEdge;
2017
import com.instabug.library.invocation.util.InstabugVideoRecordingButtonPosition;
2118
import com.instabug.library.ui.onboarding.WelcomeMessage;
22-
import com.instabug.library.visualusersteps.State;
2319

2420
import java.util.ArrayList;
2521
import java.util.HashMap;
@@ -47,7 +43,6 @@ public ArrayList<T> getAll(ArrayList<String> keys) {
4743
@SuppressWarnings("deprecation")
4844
static Map<String, Object> getAll() {
4945
return new HashMap<String, Object>() {{
50-
putAll(logLevels);
5146
putAll(invocationEvents);
5247
putAll(invocationOptions);
5348
putAll(colorThemes);
@@ -58,24 +53,13 @@ static Map<String, Object> getAll() {
5853
putAll(dismissTypes);
5954
putAll(actionTypes);
6055
putAll(extendedBugReportStates);
61-
putAll(reproStates);
6256
putAll(reproModes);
6357
putAll(sdkLogLevels);
64-
putAll(promptOptions);
6558
putAll(locales);
6659
putAll(placeholders);
6760
}};
6861
}
6962

70-
static final ArgsMap<Integer> logLevels = new ArgsMap<Integer>() {{
71-
put("logLevelNone", LogLevel.NONE);
72-
put("logLevelError", LogLevel.ERROR);
73-
put("logLevelWarning", LogLevel.WARNING);
74-
put("logLevelInfo", LogLevel.INFO);
75-
put("logLevelDebug", LogLevel.DEBUG);
76-
put("logLevelVerbose", LogLevel.VERBOSE);
77-
}};
78-
7963
static ArgsMap<InstabugInvocationEvent> invocationEvents = new ArgsMap<InstabugInvocationEvent>() {{
8064
put("invocationEventNone", InstabugInvocationEvent.NONE);
8165
put("invocationEventShake", InstabugInvocationEvent.SHAKE);
@@ -132,7 +116,6 @@ static Map<String, Object> getAll() {
132116

133117
static final ArgsMap<Integer> actionTypes = new ArgsMap<Integer>() {{
134118
put("allActions", ActionType.REQUEST_NEW_FEATURE | ActionType.ADD_COMMENT_TO_FEATURE);
135-
put("reportBugAction", 0); // Deprecated
136119
put("requestNewFeature", ActionType.REQUEST_NEW_FEATURE);
137120
put("addCommentToFeature", ActionType.ADD_COMMENT_TO_FEATURE);
138121
}};
@@ -143,13 +126,6 @@ static Map<String, Object> getAll() {
143126
put("disabled", ExtendedBugReport.State.DISABLED);
144127
}};
145128

146-
@Deprecated()
147-
static final ArgsMap<State> reproStates = new ArgsMap<State>() {{
148-
put("reproStepsEnabledWithNoScreenshots", State.ENABLED_WITH_NO_SCREENSHOTS);
149-
put("reproStepsEnabled", State.ENABLED);
150-
put("reproStepsDisabled", State.DISABLED);
151-
}};
152-
153129
static final ArgsMap<Integer> reproModes = new ArgsMap<Integer>() {{
154130
put("reproStepsEnabledWithNoScreenshots", ReproMode.EnableWithNoScreenshots);
155131
put("reproStepsEnabled", ReproMode.EnableWithScreenshots);
@@ -163,13 +139,6 @@ static Map<String, Object> getAll() {
163139
put("sdkDebugLogsLevelVerbose", com.instabug.library.LogLevel.VERBOSE);
164140
}};
165141

166-
@Deprecated
167-
static final ArgsMap<Integer> promptOptions = new ArgsMap<Integer>() {{
168-
put("promptOptionBug", PluginPromptOption.PromptOptionIdentifier.BUG_REPORT);
169-
put("promptOptionChat", PluginPromptOption.PromptOptionIdentifier.CHAT_LIST);
170-
put("promptOptionFeedback", PluginPromptOption.PromptOptionIdentifier.FEEDBACK);
171-
}};
172-
173142
static final ArgsMap<InstabugLocale> locales = new ArgsMap<InstabugLocale>() {{
174143
put("localeArabic", InstabugLocale.ARABIC);
175144
put("localeAzerbaijani", InstabugLocale.AZERBAIJANI);
@@ -201,8 +170,6 @@ static Map<String, Object> getAll() {
201170
put("shakeHint", Key.SHAKE_HINT);
202171
put("swipeHint", Key.SWIPE_HINT);
203172
put("invalidEmailMessage", Key.INVALID_EMAIL_MESSAGE);
204-
// Deprecated
205-
put("invalidCommentMessage", Key.INVALID_COMMENT_MESSAGE);
206173
put("emailFieldHint", Key.EMAIL_FIELD_HINT);
207174
put("commentFieldHintForBugReport", Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT);
208175
put("commentFieldHintForFeedback", Key.COMMENT_FIELD_HINT_FOR_FEEDBACK);
@@ -243,8 +210,6 @@ static Map<String, Object> getAll() {
243210

244211
put("discardAlertTitle", Key.REPORT_DISCARD_DIALOG_TITLE);
245212
put("discardAlertMessage", Key.REPORT_DISCARD_DIALOG_BODY);
246-
put("discardAlertCancel", Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
247-
put("discardAlertAction", Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION);
248213
put("discardAlertStay", Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
249214
put("discardAlertDiscard", Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION);
250215

@@ -256,7 +221,6 @@ static Map<String, Object> getAll() {
256221
put("reproStepsListHeader", Key.REPRO_STEPS_LIST_HEADER);
257222
put("reproStepsListDescription", Key.REPRO_STEPS_LIST_DESCRIPTION);
258223
put("reproStepsListEmptyStateDescription", Key.REPRO_STEPS_LIST_EMPTY_STATE_DESCRIPTION);
259-
put("reproStepsListItemTitle", Key.REPRO_STEPS_LIST_ITEM_NUMBERING_TITLE);
260224
put("reproStepsListItemNumberingTitle", Key.REPRO_STEPS_LIST_ITEM_NUMBERING_TITLE);
261225
put("okButtonTitle", Key.BUG_ATTACHMENT_DIALOG_OK_BUTTON);
262226
put("audio", Key.CHATS_TYPE_AUDIO);

android/src/main/java/com/instabug/reactlibrary/RNInstabug.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import com.instabug.library.invocation.InstabugInvocationEvent;
1414
import com.instabug.reactlibrary.utils.InstabugUtil;
1515

16-
import java.lang.reflect.InvocationTargetException;
1716
import java.lang.reflect.Method;
1817

1918
public class RNInstabug {

android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,6 @@ public void run() {
5252
});
5353
}
5454

55-
/**
56-
* Sets the printed logs priority. Filter to one of the following levels.
57-
*
58-
* @param logLevel the priority level.
59-
*/
60-
@ReactMethod
61-
public void setLogLevel(final String logLevel) {
62-
MainThreadHandler.runOnMainThread(new Runnable() {
63-
@Override
64-
public void run() {
65-
try {
66-
final Integer parsedLevel = ArgsRegistry.logLevels.get(logLevel);
67-
if (parsedLevel == null) return;
68-
APM.setLogLevel(parsedLevel);
69-
} catch (Exception e) {
70-
e.printStackTrace();
71-
}
72-
}
73-
});
74-
}
75-
7655
/**
7756
* Enables or disables APM.
7857
* @param isEnabled boolean indicating enabled or disabled.
@@ -101,7 +80,7 @@ public void setAppLaunchEnabled(final boolean isEnabled) {
10180
@Override
10281
public void run() {
10382
try {
104-
APM.setAppLaunchEnabled(isEnabled);
83+
APM.setColdAppLaunchEnabled(isEnabled);
10584
} catch (Exception e) {
10685
e.printStackTrace();
10786
}

android/src/main/java/com/instabug/reactlibrary/RNInstabugFeatureRequestsModule.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.instabug.reactlibrary;
22

33
import android.annotation.SuppressLint;
4-
import android.os.Handler;
5-
import android.os.Looper;
64

75
import com.facebook.react.bridge.ReactApplicationContext;
86
import com.facebook.react.bridge.ReactContextBaseJavaModule;
@@ -11,11 +9,9 @@
119
import com.instabug.featuresrequest.FeatureRequests;
1210
import com.instabug.library.Feature;
1311
import com.instabug.reactlibrary.utils.ArrayUtil;
14-
import com.instabug.reactlibrary.utils.InstabugUtil;
1512
import com.instabug.reactlibrary.utils.MainThreadHandler;
1613

1714
import java.util.ArrayList;
18-
import java.util.Arrays;
1915

2016
import javax.annotation.Nonnull;
2117

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.facebook.react.uimanager.NativeViewHierarchyManager;
2020
import com.facebook.react.uimanager.UIBlock;
2121
import com.facebook.react.uimanager.UIManagerModule;
22-
import com.instabug.bug.instabugdisclaimer.Internal;
2322
import com.instabug.library.Feature;
2423
import com.instabug.library.Instabug;
2524
import com.instabug.library.InstabugColorTheme;
@@ -33,7 +32,6 @@
3332
import com.instabug.library.model.NetworkLog;
3433
import com.instabug.library.model.Report;
3534
import com.instabug.library.ui.onboarding.WelcomeMessage;
36-
import com.instabug.library.visualusersteps.State;
3735
import com.instabug.reactlibrary.utils.ArrayUtil;
3836
import com.instabug.reactlibrary.utils.EventEmitterModule;
3937
import com.instabug.reactlibrary.utils.MainThreadHandler;
@@ -51,8 +49,6 @@
5149
import java.util.Locale;
5250
import java.util.Map;
5351

54-
import javax.annotation.Nullable;
55-
5652

5753
/**
5854
* The type Rn instabug reactnative module.
@@ -304,26 +300,6 @@ public void run() {
304300
});
305301
}
306302

307-
/**
308-
* Enable/Disable debug logs from Instabug SDK
309-
* Default state: disabled
310-
*
311-
* @param isDebugEnabled whether debug logs should be printed or not into LogCat
312-
*/
313-
@ReactMethod
314-
public void setDebugEnabled(final boolean isDebugEnabled) {
315-
MainThreadHandler.runOnMainThread(new Runnable() {
316-
@Override
317-
public void run() {
318-
try {
319-
Instabug.setDebugEnabled(isDebugEnabled);
320-
} catch (Exception e) {
321-
e.printStackTrace();
322-
}
323-
}
324-
});
325-
}
326-
327303
@ReactMethod
328304
public void logVerbose(final String message) {
329305
MainThreadHandler.runOnMainThread(new Runnable() {
@@ -765,29 +741,6 @@ public void run() {
765741
});
766742
}
767743

768-
/**
769-
* Sets whether user steps tracking is visual, non visual or disabled.
770-
*
771-
* @param reproStepsMode A string to set user steps tracking to be
772-
* enabled, non visual or disabled.
773-
*/
774-
@SuppressWarnings("deprecation")
775-
@Deprecated()
776-
@ReactMethod
777-
public void setReproStepsMode(final String reproStepsMode) {
778-
MainThreadHandler.runOnMainThread(new Runnable() {
779-
@Override
780-
public void run() {
781-
try {
782-
final State parsedState = ArgsRegistry.reproStates.get(reproStepsMode);
783-
Instabug.setReproStepsState(parsedState);
784-
} catch (Exception e) {
785-
e.printStackTrace();
786-
}
787-
}
788-
});
789-
}
790-
791744
@ReactMethod
792745
public void setReproStepsConfig(final String bugMode, final String crashMode) {
793746
MainThreadHandler.runOnMainThread(new Runnable() {
@@ -864,24 +817,6 @@ public void run() {
864817
});
865818
}
866819

867-
@ReactMethod
868-
public void callPrivateApi(String apiName, String param) {
869-
try {
870-
if (param == null) {
871-
Method m = Internal.class.getDeclaredMethod(apiName);
872-
m.setAccessible(true);
873-
m.invoke(null);
874-
} else {
875-
Method m = Internal.class.getDeclaredMethod(apiName, param.getClass());
876-
m.setAccessible(true);
877-
m.invoke(null, param);
878-
}
879-
880-
} catch (Exception e) {
881-
e.printStackTrace();
882-
}
883-
}
884-
885820
/**
886821
* Enable/disable session profiler
887822
*

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativePackage.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.facebook.react.uimanager.ViewManager;
99

1010
import java.util.ArrayList;
11-
import java.util.Arrays;
1211
import java.util.Collections;
1312
import java.util.List;
1413

android/src/main/java/com/instabug/reactlibrary/utils/InstabugUtil.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package com.instabug.reactlibrary.utils;
22

3-
import android.os.Handler;
4-
import android.os.Looper;
5-
6-
import com.facebook.react.bridge.ReactApplicationContext;
7-
import com.facebook.react.bridge.WritableMap;
8-
import com.facebook.react.modules.core.DeviceEventManagerModule;
93
import com.instabug.survey.Survey;
104

115
import org.json.JSONArray;

android/src/main/java/com/instabug/reactlibrary/utils/ReportUtil.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
import com.facebook.react.bridge.ReadableMapKeySetIterator;
88
import com.facebook.react.bridge.ReadableType;
99
import com.facebook.react.bridge.WritableArray;
10-
import com.facebook.react.bridge.WritableMap;
1110
import com.facebook.react.bridge.WritableNativeArray;
1211
import com.instabug.library.model.Report;
1312
import com.instabug.library.model.a;
1413

1514
import org.json.JSONException;
16-
import org.json.JSONObject;
1715

1816
import java.util.ArrayList;
1917

0 commit comments

Comments
 (0)