diff --git a/android/build.gradle b/android/build.gradle index 15d56eb22..1716361cf 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -20,12 +20,14 @@ android { } lintOptions { warning 'InvalidPackage' + abortOnError true + // SuppressLint WrongConstant was used to suppress errors when using arrays of ints to represent annotations. } } dependencies { implementation 'com.facebook.react:react-native:+' - api ('com.instabug.library:instabug:8.2.2.0'){ + api ('com.instabug.library:instabug:8.3.0.0'){ exclude group: 'com.android.support:appcompat-v7' } } diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index c6ab1c9a9..7515a12e6 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -1,5 +1,6 @@ package com.instabug.reactlibrary; +import android.annotation.SuppressLint; import android.app.Application; import android.net.Uri; import android.os.Handler; @@ -7,6 +8,7 @@ import android.util.Log; import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; @@ -51,6 +53,7 @@ import com.instabug.library.visualusersteps.State; import com.instabug.reactlibrary.utils.ArrayUtil; +import com.instabug.reactlibrary.utils.ReportUtil; import com.instabug.reactlibrary.utils.InstabugUtil; import com.instabug.reactlibrary.utils.MapUtil; import com.instabug.survey.OnDismissCallback; @@ -212,6 +215,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { private Instabug mInstabug; private InstabugInvocationEvent invocationEvent; private InstabugCustomTextPlaceHolder placeHolders; + private Report currentReport; /** * Instantiates a new Rn instabug reactnative module. @@ -259,6 +263,7 @@ public void run() { * @param invocationMode the invocation mode * @param invocationOptions the array of invocation options */ + @SuppressLint("WrongConstant") @ReactMethod public void invokeWithInvocationModeAndOptions(String invocationMode, ReadableArray invocationOptions) { @@ -333,7 +338,7 @@ public void appendTags(ReadableArray tags) { @ReactMethod public void setAutoScreenRecordingEnabled(boolean autoScreenRecordingEnabled) { try { - Instabug.setAutoScreenRecordingEnabled(autoScreenRecordingEnabled); + BugReporting.setAutoScreenRecordingEnabled(autoScreenRecordingEnabled); } catch (Exception e) { e.printStackTrace(); } @@ -401,10 +406,9 @@ public void setExtendedBugReportMode(String extendedBugReportMode) { public void setViewHierarchyEnabled(boolean enabled) { try { if (enabled) { - Instabug.setViewHierarchyState(Feature.State.ENABLED); + BugReporting.setViewHierarchyState(Feature.State.ENABLED); } else { - - Instabug.setViewHierarchyState(Feature.State.DISABLED); + BugReporting.setViewHierarchyState(Feature.State.DISABLED); } } catch (Exception e) { e.printStackTrace(); @@ -452,7 +456,8 @@ public void setFileAttachment(String fileUri, String fileNameWithExtension) { @ReactMethod public void sendJSCrash(String exceptionObject) { try { - sendJSCrashByReflection(exceptionObject, false); + JSONObject jsonObject = new JSONObject(exceptionObject); + sendJSCrashByReflection(jsonObject, false, null); } catch (Exception e) { e.printStackTrace(); } @@ -466,7 +471,8 @@ public void sendJSCrash(String exceptionObject) { @ReactMethod public void sendHandledJSCrash(String exceptionObject) { try { - sendJSCrashByReflection(exceptionObject, true); + JSONObject jsonObject = new JSONObject(exceptionObject); + sendJSCrashByReflection(jsonObject, true, null); } catch (Exception e) { e.printStackTrace(); } @@ -490,23 +496,20 @@ public void setCrashReportingEnabled(boolean isEnabled) { } } - private void sendJSCrashByReflection(String exceptionObject, boolean isHandled) { + private void sendJSCrashByReflection(JSONObject exceptionObject, boolean isHandled, Report report) { try { - JSONObject newJSONObject = new JSONObject(exceptionObject); - Method method = getMethod(Class.forName("com.instabug.crash.CrashReporting"), "reportException", JSONObject.class, boolean.class); + Method method = getMethod(Class.forName("com.instabug.crash.CrashReporting"), "reportException", JSONObject.class, boolean.class, Report.class); if (method != null) { - method.invoke(null, newJSONObject, isHandled); + method.invoke(null, exceptionObject, isHandled, currentReport); + currentReport = null; } } catch (ClassNotFoundException e) { e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); - } catch (JSONException e) { + } catch (InvocationTargetException e) { e.printStackTrace(); } - } /** @@ -1185,25 +1188,144 @@ public void onInvoke() { */ @ReactMethod public void setPreSendingHandler(final Callback preSendingHandler) { + Report.OnReportCreatedListener listener = new Report.OnReportCreatedListener() { + @Override + public void onReportCreated(Report report) { + WritableMap reportParam = Arguments.createMap(); + reportParam.putArray("tagsArray", convertArrayListToWritableArray(report.getTags())); + reportParam.putArray("consoleLogs", convertArrayListToWritableArray(report.getConsoleLog())); + reportParam.putString("userData", report.getUserData()); + reportParam.putMap("userAttributes", convertFromHashMapToWriteableMap(report.getUserAttributes())); + reportParam.putMap("fileAttachments", convertFromHashMapToWriteableMap(report.getFileAttachments())); + sendEvent(getReactApplicationContext(), "IBGpreSendingHandler", reportParam); + currentReport = report; + } + }; + + Method method = getMethod(Instabug.class, "onReportSubmitHandler_Private", Report.OnReportCreatedListener.class); + if (method != null) { + try { + method.invoke(null, listener); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + } + } + + @ReactMethod + public void appendTagToReport(String tag) { + if (currentReport != null) { + currentReport.addTag(tag); + } + } + + @ReactMethod + public void appendConsoleLogToReport(String consoleLog) { + if (currentReport != null) { + currentReport.appendToConsoleLogs(consoleLog); + } + } + + @ReactMethod + public void setUserAttributeToReport(String key, String value) { + if (currentReport != null) { + currentReport.setUserAttribute(key, value); + } + } + + @ReactMethod + public void logDebugToReport(String log) { + if (currentReport != null) { + currentReport.logDebug(log); + } + } + + @ReactMethod + public void logVerboseToReport(String log) { + if (currentReport != null) { + currentReport.logVerbose(log); + } + } + + @ReactMethod + public void logWarnToReport(String log) { + if (currentReport != null) { + currentReport.logWarn(log); + } + } + + @ReactMethod + public void logErrorToReport(String log) { + if (currentReport != null) { + currentReport.logError(log); + } + } + + @ReactMethod + public void logInfoToReport(String log) { + if (currentReport != null) { + currentReport.logInfo(log); + } + } + + @ReactMethod + public void addFileAttachmentWithURLToReport(String urlString, String fileName) { + if (currentReport != null) { + Uri uri = Uri.parse(urlString); + currentReport.addFileAttachment(uri, fileName); + } + } + + @ReactMethod + public void addFileAttachmentWithDataToReport(String data, String fileName) { + if (currentReport != null) { + currentReport.addFileAttachment(data.getBytes(), fileName); + } + } + + @ReactMethod + public void submitReport() { + Method method = getMethod(Instabug.class, "setReport", Report.class); + if (method != null) { + try { + method.invoke(null, currentReport); + currentReport = null; + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + } + } + + @ReactMethod + public void getReport(Promise promise) { try { + Method method = getMethod(Class.forName("com.instabug.library.Instabug"), "getReport"); + if (method != null) { + Report report = (Report) method.invoke(null); + WritableMap reportParam = Arguments.createMap(); + reportParam.putArray("tagsArray", convertArrayListToWritableArray(report.getTags())); + reportParam.putArray("consoleLogs", ReportUtil.parseConsoleLogs(report.getConsoleLog())); + reportParam.putString("userData", report.getUserData()); + reportParam.putMap("userAttributes", convertFromHashMapToWriteableMap(report.getUserAttributes())); + reportParam.putMap("fileAttachments", convertFromHashMapToWriteableMap(report.getFileAttachments())); + promise.resolve(reportParam); + currentReport = report; + } - Instabug.onReportSubmitHandler(new Report.OnReportCreatedListener() { - @Override - public void onReportCreated(Report report) { - WritableMap reportParam = Arguments.createMap(); - reportParam.putArray("tagsArray", convertArrayListToWritableArray(report.getTags())); - reportParam.putArray("consoleLogs", convertArrayListToWritableArray(report.getConsoleLog())); - reportParam.putString("userData", report.getUserData()); - reportParam.putMap("userAttributes", convertFromHashMapToWriteableMap(report.getUserAttributes())); - reportParam.putMap("fileAttachments", convertFromHashMapToWriteableMap(report.getFileAttachments())); - sendEvent(getReactApplicationContext(), "IBGpreSendingHandler", reportParam); - } - }); - } catch (java.lang.Exception exception) { - exception.printStackTrace(); + } catch (ClassNotFoundException e) { + promise.reject(e); + } catch (IllegalAccessException e) { + promise.reject(e); + } catch (InvocationTargetException e) { + promise.reject(e); } } + private WritableMap convertFromHashMapToWriteableMap(HashMap hashMap) { WritableMap writableMap = new WritableNativeMap(); for(int i = 0; i < hashMap.size(); i++) { @@ -1427,14 +1549,11 @@ public void setReproStepsMode(String reproStepsMode) { case ENABLED_WITH_NO_SCREENSHOTS: Instabug.setReproStepsState(State.ENABLED_WITH_NO_SCREENSHOTS); break; - case ENABLED: - Instabug.setReproStepsState(State.ENABLED); - break; case DISABLED: Instabug.setReproStepsState(State.DISABLED); break; default: - Instabug.setReproStepsState(State.ENABLED); + Instabug.setReproStepsState(State.ENABLED_WITH_NO_SCREENSHOTS); } } catch (Exception e) { @@ -1602,6 +1721,7 @@ public void show() { Instabug.show(); } + @SuppressLint("WrongConstant") @ReactMethod public void setReportTypes(ReadableArray types) { Object[] objectArray = ArrayUtil.toArray(types); @@ -1861,6 +1981,7 @@ public void setShouldShowSurveysWelcomeScreen(boolean shouldShow) { * @param isEmailRequired set true to make email field required * @param actionTypes Bitwise-or of actions */ + @SuppressLint("WrongConstant") @ReactMethod public void setEmailFieldRequiredForFeatureRequests(boolean isEmailRequired, ReadableArray actionTypes) { try { @@ -1907,6 +2028,7 @@ public void networkLog(String jsonObject) throws JSONException { networkLog.setResponseCode(newJSONObject.getInt("responseCode")); networkLog.setRequestHeaders(newJSONObject.getString("requestHeaders")); networkLog.setResponseHeaders(newJSONObject.getString("responseHeaders")); + networkLog.setTotalDuration(newJSONObject.getLong("duration")); networkLog.insert(); } diff --git a/android/src/main/java/com/instabug/reactlibrary/utils/ArrayUtil.java b/android/src/main/java/com/instabug/reactlibrary/utils/ArrayUtil.java index b5f2c65e2..f528c8772 100644 --- a/android/src/main/java/com/instabug/reactlibrary/utils/ArrayUtil.java +++ b/android/src/main/java/com/instabug/reactlibrary/utils/ArrayUtil.java @@ -10,6 +10,7 @@ import com.facebook.react.bridge.ReadableType; import com.facebook.react.bridge.WritableArray; +import java.util.ArrayList; import java.util.Map; import org.json.JSONArray; @@ -130,4 +131,15 @@ public static WritableArray toWritableArray(Object[] array) { return writableArray; } -} \ No newline at end of file + + public static ArrayList parseReadableArrayOfStrings(ReadableArray readableArray) { + ArrayList array = new ArrayList<>(); + for (int i = 0; i < readableArray.size(); i++) { + ReadableType type = readableArray.getType(i); + if (type == ReadableType.String) { + array.add(readableArray.getString(i)); + } + } + return array; + } +} diff --git a/android/src/main/java/com/instabug/reactlibrary/utils/InstabugUtil.java b/android/src/main/java/com/instabug/reactlibrary/utils/InstabugUtil.java index df480f488..7106ee045 100644 --- a/android/src/main/java/com/instabug/reactlibrary/utils/InstabugUtil.java +++ b/android/src/main/java/com/instabug/reactlibrary/utils/InstabugUtil.java @@ -9,7 +9,11 @@ public static Method getMethod(Class clazz, String methodName, Class... paramete for (Method method : methods) { if (method.getName().equals(methodName) && method.getParameterTypes().length == parameterType.length) { - for (int i = 0; i < 2; i++) { + if (parameterType.length == 0) { + method.setAccessible(true); + return method; + } + for (int i = 0; i < parameterType.length; i++) { if (method.getParameterTypes()[i] == parameterType[i]) { if (i == method.getParameterTypes().length - 1) { method.setAccessible(true); diff --git a/android/src/main/java/com/instabug/reactlibrary/utils/ReportUtil.java b/android/src/main/java/com/instabug/reactlibrary/utils/ReportUtil.java new file mode 100644 index 000000000..8a5baa301 --- /dev/null +++ b/android/src/main/java/com/instabug/reactlibrary/utils/ReportUtil.java @@ -0,0 +1,83 @@ +package com.instabug.reactlibrary.utils; + +import android.net.Uri; + +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.ReadableMapKeySetIterator; +import com.facebook.react.bridge.ReadableType; +import com.facebook.react.bridge.WritableArray; +import com.facebook.react.bridge.WritableMap; +import com.facebook.react.bridge.WritableNativeArray; +import com.instabug.library.model.Report; +import com.instabug.library.model.a; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; + + +/** + * Created by salmaali on 8/29/18. + */ + +public class ReportUtil { + + public static Report createReport(ReadableArray tags, ReadableArray consoleLogs, String userData, ReadableMap userAttributes, ReadableMap fileAttachments) { + Report report = new Report(); + // map tags + report.addTag(ArrayUtil.parseReadableArrayOfStrings(tags).toArray(new String[0])); + + // map consoleLogs + for (int i = 0; i < consoleLogs.size(); i++) { + ReadableType type = consoleLogs.getType(i); + if (type == ReadableType.String) { + report.appendToConsoleLogs(consoleLogs.getString(i)); + } + } + + // map userData + report.setUserData(userData); + + // map userAttributes + ReadableMapKeySetIterator userAttrIterator = userAttributes.keySetIterator(); + while (userAttrIterator.hasNextKey()) { + String key = userAttrIterator.nextKey(); + ReadableType type = userAttributes.getType(key); + if (type == ReadableType.String) { + report.setUserAttribute(key, userAttributes.getString(key)); + } + + } + + // map fileAttachments + ReadableMapKeySetIterator fileAttachmentsIterator = userAttributes.keySetIterator(); + while (fileAttachmentsIterator.hasNextKey()) { + String key = fileAttachmentsIterator.nextKey(); + ReadableType type = fileAttachments.getType(key); + if (type == ReadableType.String) { + Uri uri = Uri.parse(key); + report.addFileAttachment(uri, fileAttachments.getString(key)); + } + + } + + return report; + } + + public static WritableArray parseConsoleLogs(ArrayList consoleLogs) { + WritableArray writableArray = new WritableNativeArray(); + + for(int i = 0; i < consoleLogs.size(); i++) { + try { + writableArray.pushString(consoleLogs.get(i).toJson()); + } catch (JSONException e) { + e.printStackTrace(); + } + + } + + return writableArray; + } +} diff --git a/index.d.ts b/index.d.ts index 3dc687d06..e5159d7bd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -14,7 +14,7 @@ export namespace BugReporting { ): void; function onInvokeHandler(preInvocationHandler: () => void): void; function onReportSubmitHandler(preSendingHandler: () => void): void; - function onSDKDismissedHandler(postInvocationHandler: () => void): void; + function onSDKDismissedHandler(postInvocationHandler: (dismiss: dismissType, report: reportType) => void): void; function setPromptOptionsEnabled( chat: boolean, bug: boolean, @@ -199,7 +199,7 @@ export function addFileAttachment( fileName: string ): void; export function show(): void; -export function onReportSubmitHandler(preSendingHandler: () => void): void; +export function onReportSubmitHandler(preSendingHandler: (presendingHandler: Report) => void): void; export function callPrivateApi( apiName: string, param: any @@ -344,3 +344,16 @@ export enum strings { welcomeMessageLiveWelcomeStepTitle, welcomeMessageLiveWelcomeStepContent } + + interface Report { + logDebug(log: string); + logVerbose(log: string); + logWarn(log: string); + logError(log: string); + logInfo(log: string); + appendTag(tag: string); + appendConsoleLog(consoleLog: string); + setUserAttribute(key: string, value: string); + addFileAttachmentWithUrl(url: string, filename: string); + addFileAttachmentWithData(data: string, filename: string); +} diff --git a/index.js b/index.js index 1cc88a1a7..bb629e344 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,10 @@ import { processColor } from 'react-native'; let { Instabug } = NativeModules; -import { parseErrorStack, captureJsErrors } from './utils/InstabugUtils'; +import IBGEventEmitter from './utils/IBGEventEmitter'; +import InstabugUtils from './utils/InstabugUtils'; +import InstabugConstants from './utils/InstabugConstants'; +import Report from './models/Report'; import BugReporting from './modules/BugReporting'; import Surveys from './modules/Surveys'; import FeatureRequests from './modules/FeatureRequests'; @@ -19,12 +22,16 @@ import NetworkLogger from './modules/NetworkLogger'; captureJsErrors(); NetworkLogger.setEnabled(true); +var _isOnReportHandlerSet = false; + + /** * Instabug * @exports Instabug */ const InstabugModule = { /** + * @deprecated use {@link Instabug.start} * Starts the SDK. * This is the main SDK method that does all the magic. This is the only * method that SHOULD be called. @@ -35,6 +42,20 @@ const InstabugModule = { * the SDK's UI. */ startWithToken: function(token, invocationEvent) { + this.start(token, invocationEvent); + }, + + /** + * Starts the SDK. + * This is the main SDK method that does all the magic. This is the only + * method that SHOULD be called. + * Should be called in constructor of the app registery component + * @param {string} token The token that identifies the app, you can find + * it on your dashboard. + * @param {invocationEvent} invocationEvent The event that invokes + * the SDK's UI. + */ + start: function(token, invocationEvent) { if (Platform.OS === 'ios') Instabug.startWithToken(token, invocationEvent); }, @@ -50,7 +71,7 @@ const InstabugModule = { }, /** - * @deprecated + * @deprecated use {@link BugReporting.setAutoScreenRecordingEnabled} * Enable/Disable screen recording * @param {boolean} autoScreenRecordingEnabled boolean for enable/disable * screen recording on crash feature @@ -60,7 +81,7 @@ const InstabugModule = { }, /** - * @deprecated + * @deprecated use {@link BugReporting.setAutoScreenRecordingMaxDuration} * Sets auto screen recording maximum duration * * @param autoScreenRecordingMaxDuration maximum duration of the screen recording video @@ -251,12 +272,23 @@ const InstabugModule = { }, /** + * @deprecated use {@link Instabug.setString} * Overrides any of the strings shown in the SDK with custom ones. * Allows you to customize any of the strings shown to users in the SDK. * @param {string} string String value to override the default one. * @param {strings} key Key of string to override. */ setStringToKey: function(string, key) { + this.setString(key, string); + }, + + /** + * Overrides any of the strings shown in the SDK with custom ones. + * Allows you to customize any of the strings shown to users in the SDK. + * @param {string} string String value to override the default one. + * @param {strings} key Key of string to override. + */ + setString: function(key, string) { Instabug.setString(string, key); }, @@ -285,6 +317,7 @@ const InstabugModule = { }, /** + * @deprecated use {@link Instabug.identifyUser} * Sets the default value of the user's email and hides the email field from the reporting UI * and set the user's name to be included with all reports. * It also reset the chats on device to that email and removes user attributes, @@ -293,6 +326,18 @@ const InstabugModule = { * @param {string} name Name of the user to be set. */ identifyUserWithEmail: function(email, name) { + this.identifyUser(email, name); + }, + + /** + * Sets the default value of the user's email and hides the email field from the reporting UI + * and set the user's name to be included with all reports. + * It also reset the chats on device to that email and removes user attributes, + * user data and completed surveys. + * @param {string} email Email address to be set as the user's email. + * @param {string} name Name of the user to be set. + */ + identifyUser: function(email, name) { if (Platform.OS == 'ios') { Instabug.identifyUserWithEmail(email, name); } else if ('android') { @@ -310,11 +355,21 @@ const InstabugModule = { }, /** - * @deprecated Logs a user event that happens through the lifecycle of the application. + * @deprecated use {@link Instabug.logUserEvent} + * Logs a user event that happens through the lifecycle of the application. * Logged user events are going to be sent with each report, as well as at the end of a session. * @param {string} name Event name. */ logUserEventWithName: function(name) { + this.logUserEvent(name); + }, + + /** + * Logs a user event that happens through the lifecycle of the application. + * Logged user events are going to be sent with each report, as well as at the end of a session. + * @param {string} name Event name. + */ + logUserEvent: function(name) { Instabug.logUserEventWithName(name); }, @@ -515,7 +570,6 @@ const InstabugModule = { * @param {function} onNewMessageHandler - A callback that gets * executed when a new message is received. */ - setOnNewMessageHandler: function(onNewMessageHandler) { if (Platform.OS === 'ios') { Instabug.addListener('IBGonNewMessageHandler'); @@ -534,6 +588,7 @@ const InstabugModule = { }, /** + * @deprecated use {@link BugReporting.setViewHierarchyEnabled} * @summary Enables/disables inspect view hierarchy when reporting a bug/feedback. * @param {boolean} viewHierarchyEnabled A boolean to set whether view hierarchy are enabled * or disabled. @@ -612,18 +667,7 @@ const InstabugModule = { */ reportJSException: function(errorObject) { - let jsStackTrace = parseErrorStack(errorObject); - var jsonObject = { - message: errorObject.name + ' - ' + errorObject.message, - os: Platform.OS, - platform: 'react_native', - exception: jsStackTrace - }; - if (Platform.OS === 'android') { - Instabug.sendHandledJSCrash(JSON.stringify(jsonObject)); - } else { - Instabug.sendHandledJSCrash(jsonObject); - } + CrashReporting.reportJSException(errorObject); }, /** @@ -715,7 +759,51 @@ const InstabugModule = { }, onReportSubmitHandler: function(preSendingHandler) { - BugReporting.onReportSubmitHandler(preSendingHandler); + if (preSendingHandler) { + _isOnReportHandlerSet = true; + } else { + _isOnReportHandlerSet = false; + } + + // send bug report + IBGEventEmitter.addListener(InstabugConstants.PRESENDING_HANDLER, (report) => { + const { tags, consoleLogs, instabugLogs, userAttributes, fileAttachments } = report; + const reportObj = new Report(tags, consoleLogs, instabugLogs, userAttributes, fileAttachments); + preSendingHandler(reportObj); + Instabug.submitReport(); + + }); + + // handled js crash + IBGEventEmitter.addListener(InstabugConstants.SEND_HANDLED_CRASH, async jsonObject => { + try { + let report = await Instabug.getReport(); + const { tags, consoleLogs, instabugLogs, userAttributes, fileAttachments } = report; + const reportObj = new Report(tags, consoleLogs, instabugLogs, userAttributes, fileAttachments); + preSendingHandler(reportObj); + if (Platform.OS === 'android') { + Instabug.sendHandledJSCrash( + JSON.stringify(jsonObject) + ); + } + } catch (e) { + console.error(e); + } + }); + + IBGEventEmitter.addListener(InstabugConstants.SEND_UNHANDLED_CRASH, async (jsonObject) => { + let report = await Instabug.getReport(); + const { tags, consoleLogs, instabugLogs, userAttributes, fileAttachments } = report; + const reportObj = new Report(tags, consoleLogs, instabugLogs, userAttributes, fileAttachments); + preSendingHandler(reportObj); + if (Platform.OS === 'android') { + Instabug.sendJSCrash( + JSON.stringify(jsonObject) + ); + } + }); + + Instabug.setPreSendingHandler(preSendingHandler); }, callPrivateApi: function(apiName, param) { @@ -741,7 +829,6 @@ const InstabugModule = { * @enum {number} */ reproStepsMode: { - enabled: Instabug.reproStepsEnabled, disabled: Instabug.reproStepsDisabled, enabledWithNoScreenshots: Instabug.reproStepsEnabledWithNoScreenshots }, @@ -966,9 +1053,15 @@ const InstabugModule = { surveysCustomThanksSubTitle: Instabug.surveysCustomThanksSubTitle, surveysStoreRatingThanksTitle: Instabug.surveysStoreRatingThanksTitle, surveysStoreRatingThanksSubtitle: Instabug.surveysStoreRatingThanksSubtitle + }, + + _isOnReportHandlerSet() { + return _isOnReportHandlerSet; } }; +export { _isOnReportHandlerSet }; + export { BugReporting, Surveys, diff --git a/ios/Instabug.framework/Headers/IBGBugReporting.h b/ios/Instabug.framework/Headers/IBGBugReporting.h index b86a30179..c587b9548 100644 --- a/ios/Instabug.framework/Headers/IBGBugReporting.h +++ b/ios/Instabug.framework/Headers/IBGBugReporting.h @@ -145,6 +145,27 @@ NS_SWIFT_NAME(BugReporting) */ + (void)dismiss; +/** + @brief Enables/disables inspect view hierarchy when reporting a bug/feedback. + */ +@property (class, atomic, assign) BOOL shouldCaptureViewHierarchy; + +/** + @brief Sets whether the SDK is recording the screen or not. + + @discussion Enabling auto screen recording would give you an insight on the scenario a user has performed before encountering a bug. screen recording is attached with each bug being sent. + + Auto screen recording is disabled by default. + */ +@property (class, atomic, assign) BOOL autoScreenRecordingEnabled; + +/** + @brief Sets maximum auto screen recording video duration. + + @discussion sets maximum auto screen recording video duration with max value 30 seconds and min value greater than 1 sec. + */ +@property (class, atomic, assign) CGFloat autoScreenRecordingDuration; + /* +------------------------------------------------------------------------+ | Deprecated APIs | diff --git a/ios/Instabug.framework/Headers/IBGLog.h b/ios/Instabug.framework/Headers/IBGLog.h index 7e6003e70..2a0db99f7 100644 --- a/ios/Instabug.framework/Headers/IBGLog.h +++ b/ios/Instabug.framework/Headers/IBGLog.h @@ -127,7 +127,7 @@ OBJC_EXTERN void IBGLogError(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2) ; /** @brief Used to reroute all your NSLogs to Instabug to be able to automatically include them with reports. - @discussion For details on how to reroute your NSLogs to Instabug, see http://docs.instabug.com/docs/logging + @discussion For details on how to reroute your NSLogs to Instabug, see https://docs.instabug.com/docs/ios-logging @param format Format string. @param args Arguments list. diff --git a/ios/Instabug.framework/Headers/IBGTypes.h b/ios/Instabug.framework/Headers/IBGTypes.h index 9b5856d6a..a2200c3e2 100644 --- a/ios/Instabug.framework/Headers/IBGTypes.h +++ b/ios/Instabug.framework/Headers/IBGTypes.h @@ -164,7 +164,11 @@ extern NSString * const kIBGDiscardAlertCancel; extern NSString * const kIBGVideoGalleryErrorMessageStringName; extern NSString * const kIBGVideoDurationErrorTitle; extern NSString * const kIBGVideoDurationErrorMessage; - +extern NSString * const kIBGAutoScreenRecordingAlertAllowText; +extern NSString * const kIBGAutoScreenRecordingAlertAlwaysAllowText; +extern NSString * const kIBGAutoScreenRecordingAlertDenyText; +extern NSString * const kIBGAutoScreenRecordingAlertTitleText; +extern NSString * const kIBGAutoScreenRecordingAlertBodyText; /// ----------- /// @name Enums @@ -332,7 +336,6 @@ typedef NS_ENUM(NSInteger, IBGLogLevel) { The user steps option. */ typedef NS_ENUM(NSInteger, IBGUserStepsMode) { - IBGUserStepsModeEnable __attribute__((deprecated)), IBGUserStepsModeEnabledWithNoScreenshots, IBGUserStepsModeDisable }; diff --git a/ios/Instabug.framework/Headers/Instabug.h b/ios/Instabug.framework/Headers/Instabug.h index 6c59e4718..ae9e4b8c6 100644 --- a/ios/Instabug.framework/Headers/Instabug.h +++ b/ios/Instabug.framework/Headers/Instabug.h @@ -31,15 +31,6 @@ NS_ASSUME_NONNULL_BEGIN @interface Instabug : NSObject -/** - @brief Sets whether the SDK is recording the screen or not. - - @discussion Enabling auto screen recording would give you an insight on the scenario a user has performed before encountering a bug or a crash. screen recording is attached with each report being sent. - - Auto screen recording is disabled by default. - */ -@property (class, atomic, assign) BOOL autoScreenRecordingEnabled DEPRECATED_MSG_ATTRIBUTE("AutoScreen recording is disabled please contact support for further details."); - /** @brief Sets whether the session profiler is enabled or disabled. @@ -59,12 +50,12 @@ NS_ASSUME_NONNULL_BEGIN @discussion sets maximum auto screen recording video duration with max value 30 seconds and min value greater than 1 sec. */ -@property (class, atomic, assign) CGFloat autoScreenRecordingDuration; +@property (class, atomic, assign) CGFloat autoScreenRecordingDuration DEPRECATED_MSG_ATTRIBUTE("'autoScreenRecordingDuration' is deprecated: first deprecated in SDK 8.2.3 - autoScreenRecordingDuration is deprecated. Use IBGBugReporting.autoScreenRecordingDuration instead."); /** @brief Enables/disables inspect view hierarchy when reporting a bug/feedback. */ -@property (class, atomic, assign) BOOL shouldCaptureViewHierarchy; +@property (class, atomic, assign) BOOL shouldCaptureViewHierarchy DEPRECATED_MSG_ATTRIBUTE("'shouldCaptureViewHierarchy' is deprecated: first deprecated in SDK 8.2.3 - shouldCaptureViewHierarchy is deprecated. Use IBGBugReporting.shouldCaptureViewHierarchy instead."); /** @brief Sets the primary color of the SDK's UI. @@ -335,7 +326,7 @@ NS_ASSUME_NONNULL_BEGIN | in a future release. | | | | To adopt the new changes, please refer to our migration guide at: | - | https://docs.instabug.com/docs/ios-sdk-8-1-migration-guide | + | https://docs.instabug.com/docs/ios-migration-guide | +------------------------------------------------------------------------+ */ diff --git a/ios/Instabug.framework/Info.plist b/ios/Instabug.framework/Info.plist index 8a2614a1c..aa1408746 100644 Binary files a/ios/Instabug.framework/Info.plist and b/ios/Instabug.framework/Info.plist differ diff --git a/ios/Instabug.framework/Instabug b/ios/Instabug.framework/Instabug index aa977b338..aa4b9b09f 100755 Binary files a/ios/Instabug.framework/Instabug and b/ios/Instabug.framework/Instabug differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/Assets.car b/ios/Instabug.framework/InstabugResources.bundle/Assets.car index b161e2458..bf72f9ed6 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/Assets.car and b/ios/Instabug.framework/InstabugResources.bundle/Assets.car differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/Config.plist b/ios/Instabug.framework/InstabugResources.bundle/Config.plist new file mode 100644 index 000000000..3967e063f Binary files /dev/null and b/ios/Instabug.framework/InstabugResources.bundle/Config.plist differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetCell.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetCell.nib index f7cf12f4f..c16b673fb 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetCell.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetCell.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/objects-11.0+.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/objects-11.0+.nib index 035f9c283..2a0e65516 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/objects-11.0+.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/objects-11.0+.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/runtime.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/runtime.nib index f24a2fb7f..7a7a1a4d9 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/runtime.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/runtime.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/objects-11.0+.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/objects-11.0+.nib index a5ce6f915..cad172bc9 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/objects-11.0+.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/objects-11.0+.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/runtime.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/runtime.nib index 4b4d76d12..70a7cc7d7 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/runtime.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGBugVC-iPhone.nib/runtime.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGChatCell.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGChatCell.nib index 2c6e6c5bf..0da855e80 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGChatCell.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGChatCell.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGChatListVC-iPhone.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGChatListVC-iPhone.nib index b5f8f58b1..c73d139c7 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGChatListVC-iPhone.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGChatListVC-iPhone.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib index f319df055..b60eda359 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/runtime.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/runtime.nib index 35b546b83..0703cd60f 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/runtime.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGChatVC-iPhone.nib/runtime.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGFullScreenImageViewController.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGFullScreenImageViewController.nib index 7311c0f71..ce776a960 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGFullScreenImageViewController.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGFullScreenImageViewController.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGPoweredByView.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGPoweredByView.nib index 2889b77ed..6389629e0 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGPoweredByView.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGPoweredByView.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGPromptCell.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGPromptCell.nib index 85b1ba328..b4e5d9dd5 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGPromptCell.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGPromptCell.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGPromptVC-iPhone.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGPromptVC-iPhone.nib index 8cfae4433..387b6977f 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGPromptVC-iPhone.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGPromptVC-iPhone.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGReplyView-iPhone.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGReplyView-iPhone.nib index 95c5d1edb..69056b617 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGReplyView-iPhone.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGReplyView-iPhone.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGReportCategoriesVC-iPhone.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGReportCategoriesVC-iPhone.nib index e7405cf73..50e482149 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGReportCategoriesVC-iPhone.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGReportCategoriesVC-iPhone.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGScreenshotVC-iPhone.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGScreenshotVC-iPhone.nib index 4b49f0a80..532c1fee3 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGScreenshotVC-iPhone.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGScreenshotVC-iPhone.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGVideoPlaybackViewController.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGVideoPlaybackViewController.nib index d43ee51a6..384216113 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGVideoPlaybackViewController.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGVideoPlaybackViewController.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/IBGVoiceNoteRecordingViewController-iPhone.nib b/ios/Instabug.framework/InstabugResources.bundle/IBGVoiceNoteRecordingViewController-iPhone.nib index 6d26ee040..733086b64 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/IBGVoiceNoteRecordingViewController-iPhone.nib and b/ios/Instabug.framework/InstabugResources.bundle/IBGVoiceNoteRecordingViewController-iPhone.nib differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/Info.plist b/ios/Instabug.framework/InstabugResources.bundle/Info.plist index 5c79bdffd..11ee3a063 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/Info.plist and b/ios/Instabug.framework/InstabugResources.bundle/Info.plist differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/InstabugDataModel.momd/VersionInfo.plist b/ios/Instabug.framework/InstabugResources.bundle/InstabugDataModel.momd/VersionInfo.plist index f93ecb2b6..4f63d7e73 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/InstabugDataModel.momd/VersionInfo.plist and b/ios/Instabug.framework/InstabugResources.bundle/InstabugDataModel.momd/VersionInfo.plist differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.mom b/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.mom new file mode 100644 index 000000000..d88fb20c9 Binary files /dev/null and b/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.mom differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.omo b/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.omo new file mode 100644 index 000000000..c1913aea2 Binary files /dev/null and b/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.omo differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/VersionInfo.plist b/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/VersionInfo.plist index a3e7debad..edd06d6b5 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/VersionInfo.plist and b/ios/Instabug.framework/InstabugResources.bundle/InstabugSurveysDataModel.momd/VersionInfo.plist differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/ar.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/ar.lproj/Localizable.strings index 1d915dbbe..4eefed434 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/ar.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/ar.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/cs.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/cs.lproj/Localizable.strings index c2843fe9b..c5dfaa966 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/cs.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/cs.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/da.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/da.lproj/Localizable.strings index 940e6b6ca..afb3369e1 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/da.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/da.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/de.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/de.lproj/Localizable.strings index b0e1830fd..9d050d086 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/de.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/de.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/en.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/en.lproj/Localizable.strings index 813e4e01c..bac209e6b 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/en.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/en.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/es.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/es.lproj/Localizable.strings index 8cd4a22d3..87c4c2757 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/es.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/es.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/fr.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/fr.lproj/Localizable.strings index 5fc2dda41..2512d4757 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/fr.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/fr.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/hu.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/hu.lproj/Localizable.strings index cee2e43fb..92fab1c57 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/hu.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/hu.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/it.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/it.lproj/Localizable.strings index 8cda28d35..57da7aaa7 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/it.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/it.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/ja.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/ja.lproj/Localizable.strings index a335d2d42..a72797d0d 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/ja.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/ja.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/ko.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/ko.lproj/Localizable.strings index e527e2c1d..0c6617cb8 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/ko.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/ko.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/nb.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/nb.lproj/Localizable.strings index 8229d0bf1..348b7c719 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/nb.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/nb.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/nl.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/nl.lproj/Localizable.strings index 067ee6957..9d5f7a5a6 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/nl.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/nl.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/pl.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/pl.lproj/Localizable.strings index 3824ce9da..ee3f73486 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/pl.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/pl.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/pt-BR.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/pt-BR.lproj/Localizable.strings index 38434537c..918db927f 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/pt-BR.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/pt-BR.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/pt-PT.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/pt-PT.lproj/Localizable.strings index 6847b3591..0c5faa496 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/pt-PT.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/pt-PT.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/ru.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/ru.lproj/Localizable.strings index 65d5ba4b1..0c2e8bf40 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/ru.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/ru.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/sk.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/sk.lproj/Localizable.strings index e31cc7a54..f7e0ed0fd 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/sk.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/sk.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/sv.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/sv.lproj/Localizable.strings index 1d00c9184..6696028b6 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/sv.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/sv.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/tr.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/tr.lproj/Localizable.strings index 004c9afc2..52a0df37e 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/tr.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/tr.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/zh-Hans.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/zh-Hans.lproj/Localizable.strings index 447efbced..436c81196 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/zh-Hans.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/zh-Hans.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/zh-Hant-TW.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/zh-Hant-TW.lproj/Localizable.strings index 0da33f699..b15531075 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/zh-Hant-TW.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/zh-Hant-TW.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/InstabugResources.bundle/zh-Hant.lproj/Localizable.strings b/ios/Instabug.framework/InstabugResources.bundle/zh-Hant.lproj/Localizable.strings index 758149109..993f3d71a 100644 Binary files a/ios/Instabug.framework/InstabugResources.bundle/zh-Hant.lproj/Localizable.strings and b/ios/Instabug.framework/InstabugResources.bundle/zh-Hant.lproj/Localizable.strings differ diff --git a/ios/Instabug.framework/_CodeSignature/CodeResources b/ios/Instabug.framework/_CodeSignature/CodeResources index 9b0a707c6..d38a0e792 100644 --- a/ios/Instabug.framework/_CodeSignature/CodeResources +++ b/ios/Instabug.framework/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Headers/IBGBugReporting.h - 7p2gSC+klAyonsctHE0fdFaO1uI= + YWPQAgj4K5sxqWckjrlKPR7bFY8= Headers/IBGChats.h @@ -22,7 +22,7 @@ Headers/IBGLog.h - isYKUJvDpea1uEFSUfxPxxj9vFU= + 200u3KsLqu4ZxJDTSeXWzLtZp7E= Headers/IBGNetworkLogger.h @@ -46,11 +46,11 @@ Headers/IBGTypes.h - EzJxK9tlSsbPGJPPhKIOct6zILw= + Un8QCWVSUebVqEGJARZJSY/Y+90= Headers/Instabug.h - UChI7RIUSTGShVQzB838DCHwMxo= + LfSWkk0lm865MA29rn5QVHNLWqM= Headers/InstabugCore.h @@ -62,87 +62,91 @@ Info.plist - rRRbPc0H3svksLdhff79mToboQY= + iwpikTuRZQvsLA5XOVF0O+X0Kh0= InstabugResources.bundle/Assets.car - XKT6+stgU59Ro+Z75cOV7R6x1oo= + 2V61Qol6ahwnrCeytKxiCOhXztM= + + InstabugResources.bundle/Config.plist + + zmV6UqBSo6r1NOz798vd5O4zTBA= InstabugResources.bundle/IBGActionSheetCell.nib - 1miPIlj7n0U/T4C6+VOTbtl+Zbw= + Xlx83ieP17qxqW3WMHRiZ9tQ4m4= InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/objects-11.0+.nib - YSNy985XO6I7m85XYf7zmoxFsB4= + UxUTTn1uV9GDjXEzghsD+jw7ENg= InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/runtime.nib - hrciSaSnTtQVllIAilXiE4ydHTg= + uvqDNhQ6rvDsfGaCqCegF/UGw7s= InstabugResources.bundle/IBGBugVC-iPhone.nib/objects-11.0+.nib - d9LmGiV+H3Zo+T8BbrmCYQYoQtc= + CDCU4riCokQYKSxiEKwCNFcQSsU= InstabugResources.bundle/IBGBugVC-iPhone.nib/runtime.nib - yLeT4my4tLCxTBbRNitodMx6bQA= + aWoU2vjPpvXpn6x9p8GrGQrDYtU= InstabugResources.bundle/IBGChatCell.nib - tnRUS8RuYZ0ginfSOSvHoad1aNk= + 3tcJoWMafh5E06liNN3Er/PhbOc= InstabugResources.bundle/IBGChatListVC-iPhone.nib - vHuLy1Kxec8ZmpeGm0zlW3pP4YA= + 8R3g84erkKhhYlSsJvoB2OpUmtQ= InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib - eCGVSnxpY8Lbgf3wVP+f2wdlqGM= + tiTnnseCERBdKdH9aC++rFlYD5A= InstabugResources.bundle/IBGChatVC-iPhone.nib/runtime.nib - a/ST8pxulAEQNZpity4yUDl2GHg= + mbEufHMCO8xKPdCd28MGdSj7I4Y= InstabugResources.bundle/IBGFullScreenImageViewController.nib - pbMTc2a9DbgXnG3+o8E9mjYp8i4= + K6Rh6o6+KgX75yjqGdnYXdkngNg= InstabugResources.bundle/IBGPoweredByView.nib - Ck4htgxEMjWui/xOExyuW59ugaI= + wKVEDzzHIEGysNTNJMG3rwoPnRQ= InstabugResources.bundle/IBGPromptCell.nib - ggT32TahR+vujXoxBQWHsDKhcHE= + EwKB825G5oiiEPPK/xxb/4J2VEw= InstabugResources.bundle/IBGPromptVC-iPhone.nib - ZCmrqaWVfrvb5iZcGpUS3edS7pQ= + 6Km1ELBWOu24UzqEJuEzfJZU94k= InstabugResources.bundle/IBGReplyView-iPhone.nib - SCPFWwaJdwLghbNM3u5sPy4LOm8= + tjTxEpl4OH2Y9o3C3Iy154JlM1w= InstabugResources.bundle/IBGReportCategoriesVC-iPhone.nib - qnJ81ypbSFPTW1g2a4wPyAZHUZs= + Fy7QDzoXkVuXRrXFnsIquiPfqyk= InstabugResources.bundle/IBGScreenshotVC-iPhone.nib - oCxV6/B0672ShkkoQ0Repuue05I= + qtH3hy1TfjYFY+yG1pj5OpQXfgQ= InstabugResources.bundle/IBGVideoPlaybackViewController.nib - bgEjzbzufwGjeMrZTTr8P4dT6Yw= + nFyV+q/nxzEra3oayiz9m5CnJLA= InstabugResources.bundle/IBGVoiceNoteRecordingViewController-iPhone.nib - eqHYIqZn4zEqRD1HFz3GRv0gWqU= + YvwaWHIrwVIq2E/BJ82WxyX1pxQ= InstabugResources.bundle/Info.plist - fKs6CxNe/btwZetPVPEdYSrVYu4= + ROQV/UnBi0rPUaeWi9aPJS1QTi8= InstabugResources.bundle/Inject_DSYM_Project-Archive.sh @@ -194,7 +198,15 @@ InstabugResources.bundle/InstabugDataModel.momd/VersionInfo.plist - YkbS5yZUZ934YIyR3DUr153RA4w= + zCGijhGlIbm/pkovrgz4BxbFJBA= + + InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.mom + + uPTeQx4GSXNzcCSGt6bnwNtf1MM= + + InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.omo + + yopIoGW4GGbd1D5VBw7PkdZ3FWs= InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel.mom @@ -202,7 +214,7 @@ InstabugResources.bundle/InstabugSurveysDataModel.momd/VersionInfo.plist - cNSlBZC0vTE0QC7vzP5aumVwKeM= + 8Tmdh44XKx/QiNDAjauXNzlBDos= InstabugResources.bundle/Instabug_dsym_upload.sh @@ -212,7 +224,7 @@ hash - cbVW9rJnBZTlMekW2ZcaDficlaw= + 9f1RDDUslf3DivwEO+VEch5/2dQ= optional @@ -221,7 +233,7 @@ hash - hiDyqbhXElpYnIiDoKLKhrGSqvw= + GVOx+qIz+wx1pMFZPKjZasKU0Go= optional @@ -230,7 +242,7 @@ hash - w3+BWTshzuVLmi4epkW6+BmWMOM= + 6aa/jEfB9aeUZTAZ4NVXaHHwHS0= optional @@ -239,7 +251,7 @@ hash - NNRbQmv71TvkotnQGlAWCHfurz4= + R3LIRZm4TrOiZb2JnuoSz2mE924= optional @@ -248,7 +260,7 @@ hash - rbeLyPmNdVJAs8hyDMDGjC/oCv4= + arg54KsNkDjj1DHLI1KYHbWxEBc= optional @@ -266,7 +278,7 @@ hash - BT2hUvr3TF8Pk5tihei1nME+Y5c= + Z7FFSCU+zbzqUktRmTTMhgh0Q4Q= optional @@ -275,7 +287,7 @@ hash - 8woQWr2PW9C5p91F6DDTprCTogo= + d81lB+jJRhn1k4kBQ7RmruBb8nE= optional @@ -284,7 +296,7 @@ hash - 36ikE9zaHboZ3ArGdxYNtB2jLdc= + qpYWjZz/lCFAeMJclKqVtXW9DTg= optional @@ -293,7 +305,7 @@ hash - FscKI1bUJDy4dKCfEaZ403erRmc= + hfh1Dd7V8+Do1p66Py7vUNXxgkM= optional @@ -302,7 +314,7 @@ hash - mShkBFvZqT4fWv0IA3oWUwqmFE0= + Xn+fZEeLyrw/alRw8TD7whEwiQQ= optional @@ -311,7 +323,7 @@ hash - jL0/ZVnz1XFlGs0Vc8VAdg2PkU0= + Z6YlCWAkuW2WBNtctqLUuFMK0u8= optional @@ -320,7 +332,7 @@ hash - yRRqNO813DQ8u7BQrE97O27NZR4= + HmDNHqEDi2NWjOZFEyhUzAOojXY= optional @@ -329,7 +341,7 @@ hash - s5HIpeutBAa8joLRQKrLqH7oEo4= + YogEC7bBv0lpF6f/gxS4gNNKd1E= optional @@ -338,7 +350,7 @@ hash - n1gdqiIsmrTzMHTKnTUp6ZsO/5E= + z7PsQa1h4wCPHmkxbrcH/XzetV0= optional @@ -347,7 +359,7 @@ hash - K97yeoTK/AcJsuCFJEFllspG81c= + RO2AexTD3RcK5eZqSa53cTn9+Pc= optional @@ -356,7 +368,7 @@ hash - I74nS5RUgoTZirXTba2JtYr71Ck= + Zp01digilcGwOwNVOFx4mnnVsa8= optional @@ -365,7 +377,7 @@ hash - ZAi1mxIiFFU0OnHn+mv6SlaLchM= + s3K5psXnR61A7jaMEt5lb1sS9j4= optional @@ -374,7 +386,7 @@ hash - 5h/xJ5u1WXu/XLYN4jRTxVivibg= + dFK2Z16xpoqNFgfUewwImnI78lA= optional @@ -383,7 +395,7 @@ hash - vOieu0zucwhktkfa+OgF4yNEA1o= + 8dJOopp5YC0/ZWheZHjNUln+144= optional @@ -392,7 +404,7 @@ hash - xyPa3CaxNgNS51z6b4eCSmvd9M0= + d6kPb87T9vsdo4PpzMfZ3naQkcU= optional @@ -401,7 +413,7 @@ hash - 5QR7MHanhAJA+9fgGXwZMNYojsQ= + TV9EBp6Ak0TzquOHJxigSWeyKWk= optional @@ -410,7 +422,7 @@ hash - PuO9qEwYQSKzAsiHDD8E0GG7erw= + vGhZIpb+zjAUlIOybl3x0/kH70o= optional @@ -419,7 +431,7 @@ hash - y2G+PGK8/ahRbArgsL19mv4yIi0= + anlUg094wk3nIlC9Q9xhIva14cs= optional @@ -439,11 +451,11 @@ hash - 7p2gSC+klAyonsctHE0fdFaO1uI= + YWPQAgj4K5sxqWckjrlKPR7bFY8= hash2 - lxIrUHGD4NRMfgKSe4jTAlB9fsWCwJm0JxKfQLvtbw8= + ag4AdqOKNzW3OyqcJKHK8iNiLTDNtZ+hjKXfHxZeo8o= Headers/IBGChats.h @@ -483,11 +495,11 @@ hash - isYKUJvDpea1uEFSUfxPxxj9vFU= + 200u3KsLqu4ZxJDTSeXWzLtZp7E= hash2 - 9khGHPUJlMT/eCXAopoFaSOvRnBFvaLhK4HsbVi66n0= + g7fJdEqurzQJt8/9p4MtDRTK3K+vcMpbla7AJib3ys4= Headers/IBGNetworkLogger.h @@ -549,22 +561,22 @@ hash - EzJxK9tlSsbPGJPPhKIOct6zILw= + Un8QCWVSUebVqEGJARZJSY/Y+90= hash2 - cfGMuKQzC7eE+QivfYWlGpTP8ctHw24eW6Lil90EZr0= + YmHtgG8EVaWXwIbm6PVpj1uJ5jqjOgJJ41hnJyvcR/I= Headers/Instabug.h hash - UChI7RIUSTGShVQzB838DCHwMxo= + LfSWkk0lm865MA29rn5QVHNLWqM= hash2 - fEfk9M3eac3omwBquJk25q+ZyXmsbZ1h0vXU8bbsXHQ= + nP9LLhZvLJ8Z/g0W+gsax45LYqOEes0rl6wqfjoam2M= Headers/InstabugCore.h @@ -593,220 +605,231 @@ hash - XKT6+stgU59Ro+Z75cOV7R6x1oo= + 2V61Qol6ahwnrCeytKxiCOhXztM= + + hash2 + + ldxFKb3SL4K60qJStDAhFnRwplfdvgG3KMPVevWpGko= + + + InstabugResources.bundle/Config.plist + + hash + + zmV6UqBSo6r1NOz798vd5O4zTBA= hash2 - jXAqNjo/xNtzrg+hD3r/QUn90FQDy+2ZCii6iVQKtmE= + kmHsztpgjvF0JW5f3HdMHm49z1M0CcG8OT1JDQHHE/E= InstabugResources.bundle/IBGActionSheetCell.nib hash - 1miPIlj7n0U/T4C6+VOTbtl+Zbw= + Xlx83ieP17qxqW3WMHRiZ9tQ4m4= hash2 - IhXVmywIS+lIpJ46lBVNbaGKrqQ0UXAuRglTbfbbV4s= + HYFfCVSuKiK6HmUMD0xeYxEprD/+I8tANMWYUezwATc= InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/objects-11.0+.nib hash - YSNy985XO6I7m85XYf7zmoxFsB4= + UxUTTn1uV9GDjXEzghsD+jw7ENg= hash2 - HezkBuu8IIMzv1C03Ji/6ga0+5MiBI/J2QajOLmaaIs= + ls3pz1/JHFX3QBj30B/3aSJwHlln/tNV4A/Q+77vAKs= InstabugResources.bundle/IBGActionSheetVC-iPhone.nib/runtime.nib hash - hrciSaSnTtQVllIAilXiE4ydHTg= + uvqDNhQ6rvDsfGaCqCegF/UGw7s= hash2 - umXwSqsOb//JHP4nHolKeRHi1jOArNYe9EEfe7HVLpk= + +EtS1WpcKFfRzqnSsACNGrefWP1UktO+d0NCDYAZkNs= InstabugResources.bundle/IBGBugVC-iPhone.nib/objects-11.0+.nib hash - d9LmGiV+H3Zo+T8BbrmCYQYoQtc= + CDCU4riCokQYKSxiEKwCNFcQSsU= hash2 - 6Bp2vvMRJM6dO+nLT2P9LYbkIK0ypxrbuo44nnLy9aQ= + 696PPcUEqnmw8pbA0h2qoJiJxks0QwO7VwGhp8ejuzo= InstabugResources.bundle/IBGBugVC-iPhone.nib/runtime.nib hash - yLeT4my4tLCxTBbRNitodMx6bQA= + aWoU2vjPpvXpn6x9p8GrGQrDYtU= hash2 - ANblSBBMAdeZZXsJOIDjRZfDzVTqbJIhEfJCbnTbzII= + z7GrjTaci6lFnszD3QbfqM6XJ7pRWEv7/NpLVYOJeLU= InstabugResources.bundle/IBGChatCell.nib hash - tnRUS8RuYZ0ginfSOSvHoad1aNk= + 3tcJoWMafh5E06liNN3Er/PhbOc= hash2 - UAo6AEgpg3hknHhM2I/aUKZYIKo0+4AjtM0dIyJ21cU= + 76vfcYe0DoJSvLQGAbQrYXPZGFRzdrwlng1i7wENXXg= InstabugResources.bundle/IBGChatListVC-iPhone.nib hash - vHuLy1Kxec8ZmpeGm0zlW3pP4YA= + 8R3g84erkKhhYlSsJvoB2OpUmtQ= hash2 - 8wLN8nTxZcobEgqfa4xOx30ergjOd9iAADZW96V796E= + YjP62KPFCDCBe3B97gPxID3DjXTvS66NgiVRQy9tduU= InstabugResources.bundle/IBGChatVC-iPhone.nib/objects-11.0+.nib hash - eCGVSnxpY8Lbgf3wVP+f2wdlqGM= + tiTnnseCERBdKdH9aC++rFlYD5A= hash2 - +5Sos+kH2wc/gn6qFw8yT1n9LW5KndON8HqPfS7ZDx4= + dNduL+GEUHQNJ/QhEEs7+IBhbaOHsIoggxQzfi8XtKo= InstabugResources.bundle/IBGChatVC-iPhone.nib/runtime.nib hash - a/ST8pxulAEQNZpity4yUDl2GHg= + mbEufHMCO8xKPdCd28MGdSj7I4Y= hash2 - uMlkdkx9QrQEa5fi0gJWdKFIef1eKjQBVrDjydsU9ik= + TYT9qq4YHo/4JfSjllV3sn6eOfEchKtWm+uIt2bKPYQ= InstabugResources.bundle/IBGFullScreenImageViewController.nib hash - pbMTc2a9DbgXnG3+o8E9mjYp8i4= + K6Rh6o6+KgX75yjqGdnYXdkngNg= hash2 - PZwbEYJi7aa+rt4mpBvmVN5NxDklYpVTokrwY+fmwP4= + 2mPO7j7mrEa5M0XRfvIUvMqfflYsL69R5+Dxi+RXWow= InstabugResources.bundle/IBGPoweredByView.nib hash - Ck4htgxEMjWui/xOExyuW59ugaI= + wKVEDzzHIEGysNTNJMG3rwoPnRQ= hash2 - gDHhhrWDV16B4EcfHVJd47pelwQEajj27I/x7l470Xo= + Tjzl+2fOFkJcyHjZGQP6OpQ96fR1BWRbvSMKCrxJoyY= InstabugResources.bundle/IBGPromptCell.nib hash - ggT32TahR+vujXoxBQWHsDKhcHE= + EwKB825G5oiiEPPK/xxb/4J2VEw= hash2 - LF510uPBera+C7q4kRyJ3ZdFAT/vGfhVW6F9oi/B2Z0= + P+8sjWcb6QepUIaTYmolyxnWCfkRGRr6Urbh6BHquz4= InstabugResources.bundle/IBGPromptVC-iPhone.nib hash - ZCmrqaWVfrvb5iZcGpUS3edS7pQ= + 6Km1ELBWOu24UzqEJuEzfJZU94k= hash2 - v3j1pOeUPmHvT+DtAPIAgSzM77bna5FGZLwZSjfMN/0= + yUkIY1oJ0BlIUhqKygQDX/C+DZehuU2cCMV3rkaszqw= InstabugResources.bundle/IBGReplyView-iPhone.nib hash - SCPFWwaJdwLghbNM3u5sPy4LOm8= + tjTxEpl4OH2Y9o3C3Iy154JlM1w= hash2 - 5QYmVaKwSl5YrqUUjaE58bmmYs4ErdVys+tEXUrMgCQ= + weXGA2zR3xC5Pm2I7r51UT+3MAWprfsaYbt/mDc8NVg= InstabugResources.bundle/IBGReportCategoriesVC-iPhone.nib hash - qnJ81ypbSFPTW1g2a4wPyAZHUZs= + Fy7QDzoXkVuXRrXFnsIquiPfqyk= hash2 - gJtwuEOugcxUNv6qOYU8hgNrCGh7/USn5doyHyNjvlk= + vEdbsBKr+/gTEr2oFzfMnYaS2jeBQUETRNwKcrJsHh8= InstabugResources.bundle/IBGScreenshotVC-iPhone.nib hash - oCxV6/B0672ShkkoQ0Repuue05I= + qtH3hy1TfjYFY+yG1pj5OpQXfgQ= hash2 - 5PQSaGk43S9JryNryMiVQp8kropoWomPeWxunP5fzfs= + J6Yv6FnVkC/+s1M51FTBmeCU5hlONIwJzDYL9gf9Ckw= InstabugResources.bundle/IBGVideoPlaybackViewController.nib hash - bgEjzbzufwGjeMrZTTr8P4dT6Yw= + nFyV+q/nxzEra3oayiz9m5CnJLA= hash2 - yZlXMQaWFbqVrVk3n9CRPOwFnV5p/httLaHpenRb6MM= + M112EfkSEFR6FxoOCpiZ1KtLXtJ4bqIbFU2woqEavRE= InstabugResources.bundle/IBGVoiceNoteRecordingViewController-iPhone.nib hash - eqHYIqZn4zEqRD1HFz3GRv0gWqU= + YvwaWHIrwVIq2E/BJ82WxyX1pxQ= hash2 - 1wxSuLPKMm0OtKlndA7qBNjxQzGUOeLqgrVQ0FNxIfY= + dOLX1ySfUrfrCcdV0WNyos4333phOY+lBNWnBKMFNeg= InstabugResources.bundle/Info.plist hash - fKs6CxNe/btwZetPVPEdYSrVYu4= + ROQV/UnBi0rPUaeWi9aPJS1QTi8= hash2 - QlT4dPmfrRdEfnTbGs6bHf3fngUOsvTCvqTIg9zt7q8= + 3VTT54xsZWKWq8ZASntrE0ReBXOu098FDrph8NQRxLE= InstabugResources.bundle/Inject_DSYM_Project-Archive.sh @@ -945,11 +968,33 @@ hash - YkbS5yZUZ934YIyR3DUr153RA4w= + zCGijhGlIbm/pkovrgz4BxbFJBA= + + hash2 + + 0AGg41xsTwNwp2PHsQ/P+o5Blgxg17iZOVLcwDbdaZk= + + + InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.mom + + hash + + uPTeQx4GSXNzcCSGt6bnwNtf1MM= hash2 - 0Dp86Ca9InWTUzfhPDnfC7pIdPU38VOLjh8H9hRodEc= + Y4WNm//imxCh2r+OO+NSPN9SwAFJeQ3wg8HCVCtVKyQ= + + + InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel 2.omo + + hash + + yopIoGW4GGbd1D5VBw7PkdZ3FWs= + + hash2 + + yom9VxhtBsoSG4VyQn1jnyNWqMz7PqWjc9gSH32GydE= InstabugResources.bundle/InstabugSurveysDataModel.momd/InstabugSurveysDataModel.mom @@ -967,11 +1012,11 @@ hash - cNSlBZC0vTE0QC7vzP5aumVwKeM= + 8Tmdh44XKx/QiNDAjauXNzlBDos= hash2 - iriTHmuvVgrF24OfJV7xFsSJ0EpNvFoFucrl+nRYH48= + urqi3bfkzG1tyM47g1DhReAL3+imHl1tiAnR0IpljBU= InstabugResources.bundle/Instabug_dsym_upload.sh @@ -989,11 +1034,11 @@ hash - cbVW9rJnBZTlMekW2ZcaDficlaw= + 9f1RDDUslf3DivwEO+VEch5/2dQ= hash2 - 5E7ZVyNksnqQvvIcoA71krkxzn8/5K4gasXdyH5PzUM= + FBPI2rq69HDn2p7cHp8MJJgdb+MxD1GM/62H/ZXJz8g= optional @@ -1002,11 +1047,11 @@ hash - hiDyqbhXElpYnIiDoKLKhrGSqvw= + GVOx+qIz+wx1pMFZPKjZasKU0Go= hash2 - OnV9XNOmZIJZW/iGU6KABs/HWOhn31JYbegbiAD6Nlo= + NTifLdfWl/njaUXNyFhG7m88TaqikgmhYe9RgC6szIc= optional @@ -1015,11 +1060,11 @@ hash - w3+BWTshzuVLmi4epkW6+BmWMOM= + 6aa/jEfB9aeUZTAZ4NVXaHHwHS0= hash2 - Taa4UtkXz8t5hap/LBRDDvdk3r1vOeZgO5NHV+R1U4M= + 9CHh1zHwGbsa7sjufZw3DqgM1abPKLwJMHLRfPWWSf4= optional @@ -1028,11 +1073,11 @@ hash - NNRbQmv71TvkotnQGlAWCHfurz4= + R3LIRZm4TrOiZb2JnuoSz2mE924= hash2 - dalpyDaDxfNRl8uB0i9meOylOQGEp5KRIzK7Bil82Lg= + UULryqdcdekV5V8dRzAGV08VpC6oFI3ZKAyfu6O7qkA= optional @@ -1041,11 +1086,11 @@ hash - rbeLyPmNdVJAs8hyDMDGjC/oCv4= + arg54KsNkDjj1DHLI1KYHbWxEBc= hash2 - cGnQPbt9Zr5KcZ19MM/IpuYsZd8n7k0OLwHTsjyUPNI= + lN7O45lXKNLZ0X+ctLb6qTpg3P7bTKuoMxSO2XbBklo= optional @@ -1067,11 +1112,11 @@ hash - BT2hUvr3TF8Pk5tihei1nME+Y5c= + Z7FFSCU+zbzqUktRmTTMhgh0Q4Q= hash2 - /q7WLV0dJTHgFm4nmDujxRfuv9AAawRMvsNtjDRriBA= + 8XEMAwxWH0t9zQwiUGM4omvM0espUUUMuMJ5xN+48nM= optional @@ -1080,11 +1125,11 @@ hash - 8woQWr2PW9C5p91F6DDTprCTogo= + d81lB+jJRhn1k4kBQ7RmruBb8nE= hash2 - hItCSH0ent3G8iFnnfW+H10RdafpoHUeo1ffkavWqQM= + augldkYJMJbw+IDNu1TVCAmauFzYpBqGjgmpKK4Rl/c= optional @@ -1093,11 +1138,11 @@ hash - 36ikE9zaHboZ3ArGdxYNtB2jLdc= + qpYWjZz/lCFAeMJclKqVtXW9DTg= hash2 - pvPNozWdXezbuFbvxMnlQOaKz4Vvcd6CVAJHkMdT4to= + XB6gD5uuSbFPaZug4JeWn73nVUHOnsMMyzeEy4yGEcI= optional @@ -1106,11 +1151,11 @@ hash - FscKI1bUJDy4dKCfEaZ403erRmc= + hfh1Dd7V8+Do1p66Py7vUNXxgkM= hash2 - Wg8BmE8SrV48+XgMYqRNDDliuAu7fhg+g/G++sJ6Bk8= + 0Ivc6a2QiGBcpr62tv/4JFPKaPvGrL0bTHLLHRx6buw= optional @@ -1119,11 +1164,11 @@ hash - mShkBFvZqT4fWv0IA3oWUwqmFE0= + Xn+fZEeLyrw/alRw8TD7whEwiQQ= hash2 - apgi2J6DABjlTQbJcLqjBfvRyr+kas1ZlPej93bD+Gw= + W2O4BV0KekFfs3esigEQh7blLevQ2dSI/z8/S1fFfss= optional @@ -1132,11 +1177,11 @@ hash - jL0/ZVnz1XFlGs0Vc8VAdg2PkU0= + Z6YlCWAkuW2WBNtctqLUuFMK0u8= hash2 - 72FlWz1mdJ8X6nxwTtGa2HEaKBgZSo7JsWQiCEs1VzM= + BW32/dPcfbwUp56+hMRxfY/Y/JEYppETzSyD3sAW92s= optional @@ -1145,11 +1190,11 @@ hash - yRRqNO813DQ8u7BQrE97O27NZR4= + HmDNHqEDi2NWjOZFEyhUzAOojXY= hash2 - bVq+txu1X2FJNV/SBhMAMiiquEFZS4JyPxX+LLNNquU= + KCn+QSetmfoQkTOXzvfl9tKZH9Hs8Y0WmW4gYjXwf7o= optional @@ -1158,11 +1203,11 @@ hash - s5HIpeutBAa8joLRQKrLqH7oEo4= + YogEC7bBv0lpF6f/gxS4gNNKd1E= hash2 - l+6Kxp3OuL2e7xU7UIIA3vKzqtLTXtF+STelaF8DYaM= + SGCTLRKawt0/KN86H5NxS4Oolzo6SGslcm5+IVZJsV0= optional @@ -1171,11 +1216,11 @@ hash - n1gdqiIsmrTzMHTKnTUp6ZsO/5E= + z7PsQa1h4wCPHmkxbrcH/XzetV0= hash2 - 9hragMpDevCmQywcRPlL8YqZxtom/NiW2kTE5rW6ZIs= + M2hvrIBdIa1P0wEsJy8GCmkeXrXBVcUmJARdrZn8Boc= optional @@ -1184,11 +1229,11 @@ hash - K97yeoTK/AcJsuCFJEFllspG81c= + RO2AexTD3RcK5eZqSa53cTn9+Pc= hash2 - 1ifpkGfMXgbc1uKZqg9XQqJiuidQiMOeduzqmu/Jwo4= + rN5PJoUUeH4hdF5cKVRdC9pfX0LfnNQ1aRh7sq2MMOs= optional @@ -1197,11 +1242,11 @@ hash - I74nS5RUgoTZirXTba2JtYr71Ck= + Zp01digilcGwOwNVOFx4mnnVsa8= hash2 - kQhsKa57mslqzBsS+ErYJNPbCk8zfiRCuqvKchFVuuI= + 0w9A9+ZLubwOKBrHu5DtmofoogYzaYaYKixESyGu2Vo= optional @@ -1210,11 +1255,11 @@ hash - ZAi1mxIiFFU0OnHn+mv6SlaLchM= + s3K5psXnR61A7jaMEt5lb1sS9j4= hash2 - OSJ6+PqvX0WQP+cuMyPa2lRBmG/h3xjpL7m1jerMlX8= + Qxs0SYHS3sFl4QVAAPa3tSzRW4XIOjBiPW0l60zjGtQ= optional @@ -1223,11 +1268,11 @@ hash - 5h/xJ5u1WXu/XLYN4jRTxVivibg= + dFK2Z16xpoqNFgfUewwImnI78lA= hash2 - lL5JZisbJOZeiKGASeWE2x9kqBaherjENqTSC9u3Bpo= + 1RObdlaT1ubXSaXfPd6f7PQSFgL9XYtGvNXf15UUcrY= optional @@ -1236,11 +1281,11 @@ hash - vOieu0zucwhktkfa+OgF4yNEA1o= + 8dJOopp5YC0/ZWheZHjNUln+144= hash2 - NAmrpTCNFG5Ya+hMPaej/aUrXsaVh5F4QnM9E6M8vnE= + PmTvoWj0j/0+N4sw1zXfhCWn6DUVDE181S6eq0EPzCI= optional @@ -1249,11 +1294,11 @@ hash - xyPa3CaxNgNS51z6b4eCSmvd9M0= + d6kPb87T9vsdo4PpzMfZ3naQkcU= hash2 - 9LLrVTcLJRLuEwwG95j44dIf2SP4kEhXBI+JvN/NS3c= + Ox1JUsaOm3tl5XL4LTpmL4r1vgqA3AW+9ldyK0MOv+o= optional @@ -1262,11 +1307,11 @@ hash - 5QR7MHanhAJA+9fgGXwZMNYojsQ= + TV9EBp6Ak0TzquOHJxigSWeyKWk= hash2 - pZG58Ht2KPcmw3RsKwZO8WhZLDImo5iOukAF0q6TQzU= + RmA/jMOsRNy3sHmKUmaLOzsY6suCMtrFFEkFpfHUbaE= optional @@ -1275,11 +1320,11 @@ hash - PuO9qEwYQSKzAsiHDD8E0GG7erw= + vGhZIpb+zjAUlIOybl3x0/kH70o= hash2 - AP+UyZBL9MWsXA5NWWDNAyGBkiF/59Z3t7GkHdfTAo8= + VQgaaM8YINovAHow3pWrFMF0Ijdag1eDgK//O6q8Uow= optional @@ -1288,11 +1333,11 @@ hash - y2G+PGK8/ahRbArgsL19mv4yIi0= + anlUg094wk3nIlC9Q9xhIva14cs= hash2 - 4EhJ/JcYtLlfH/QBHDU5g6RVezd/DJzpvgC7wMrrWe4= + DgaPhn+ZQSoGz/v5dgkG/az/7GYCcSzeFoEn6d9H3ao= optional @@ -1322,7 +1367,7 @@ rules - ^ + ^.* ^.*\.lproj/ @@ -1353,11 +1398,6 @@ weight 11 - ^ - - weight - 20 - ^(.*/)?\.DS_Store$ omit @@ -1365,13 +1405,6 @@ weight 2000 - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - ^.* ^.*\.lproj/ @@ -1407,13 +1440,6 @@ weight 20 - ^[^/]+$ - - nested - - weight - 10 - ^embedded\.provisionprofile$ weight diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index 11e57b92c..30a355840 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -16,6 +16,10 @@ #import #import +@interface Instabug (PrivateWillSendAPI) ++ (void)setWillSendReportHandler_private:(void(^)(IBGReport *report, void(^reportCompletionHandler)(IBGReport *)))willSendReportHandler_private; +@end + @implementation InstabugReactBridge - (NSArray *)supportedEvents { @@ -27,6 +31,8 @@ @implementation InstabugReactBridge @"IBGWillShowSurvey", @"IBGDidDismissSurvey", @"IBGDidSelectPromptOptionHandler", + @"IBGSendHandledJSCrash", + @"IBGSendUnhandledJSCrash", @"IBGSetNetworkDataObfuscationHandler", @"IBGOnNewReplyReceivedCallback" ]; @@ -92,17 +98,23 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(sendJSCrash:(NSDictionary *)stackTrace) { - SEL reportCrashWithStackTraceSEL = NSSelectorFromString(@"reportCrashWithStackTrace:handled:"); - if ([[Instabug class] respondsToSelector:reportCrashWithStackTraceSEL]) { - [[Instabug class] performSelector:reportCrashWithStackTraceSEL withObject:stackTrace withObject:@(false)]; - } + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); + dispatch_async(queue, ^{ + SEL reportCrashWithStackTraceSEL = NSSelectorFromString(@"reportCrashWithStackTrace:handled:"); + if ([[Instabug class] respondsToSelector:reportCrashWithStackTraceSEL]) { + [[Instabug class] performSelector:reportCrashWithStackTraceSEL withObject:stackTrace withObject:@(NO)]; + } + }); } RCT_EXPORT_METHOD(sendHandledJSCrash:(NSDictionary *)stackTrace) { - SEL reportCrashWithStackTraceSEL = NSSelectorFromString(@"reportCrashWithStackTrace:handled:"); - if ([[Instabug class] respondsToSelector:reportCrashWithStackTraceSEL]) { - [[Instabug class] performSelector:reportCrashWithStackTraceSEL withObject:stackTrace withObject:@(true)]; - } + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); + dispatch_async(queue, ^{ + SEL reportCrashWithStackTraceSEL = NSSelectorFromString(@"reportCrashWithStackTrace:handled:"); + if ([[Instabug class] respondsToSelector:reportCrashWithStackTraceSEL]) { + [[Instabug class] performSelector:reportCrashWithStackTraceSEL withObject:stackTrace withObject:@(YES)]; + } + }); } RCT_EXPORT_METHOD(setUserData:(NSString *)userData) { @@ -130,16 +142,17 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(setAutoScreenRecordingEnabled:(BOOL)enabled) { - Instabug.autoScreenRecordingEnabled = enabled; + IBGBugReporting.autoScreenRecordingEnabled = enabled; } RCT_EXPORT_METHOD(setAutoScreenRecordingMaxDuration:(CGFloat)duration) { - Instabug.autoScreenRecordingDuration = duration; + IBGBugReporting.autoScreenRecordingDuration = duration; } - +void (^globalReportCompletionHandler)(IBGReport *); +IBGReport *currentReport = nil; RCT_EXPORT_METHOD(setPreSendingHandler:(RCTResponseSenderBlock)callBack) { if (callBack != nil) { - Instabug.willSendReportHandler = ^(IBGReport* report){ + [Instabug setWillSendReportHandler_private:^(IBGReport *report, void (^reportCompletionHandler)(IBGReport *)) { NSArray *tagsArray = report.tags; NSArray *instabugLogs= report.instabugLogs; NSArray *consoleLogs= report.consoleLogs; @@ -147,13 +160,81 @@ - (dispatch_queue_t)methodQueue { NSArray *fileAttachments= report.fileLocations; NSDictionary *dict = @{ @"tagsArray" : tagsArray, @"instabugLogs" : instabugLogs, @"consoleLogs" : consoleLogs, @"userAttributes" : userAttributes, @"fileAttachments" : fileAttachments}; [self sendEventWithName:@"IBGpreSendingHandler" body:dict]; - return report; - }; + currentReport = report; + globalReportCompletionHandler = reportCompletionHandler; + }]; } else { Instabug.willSendReportHandler = nil; } } +RCT_EXPORT_METHOD(appendTagToReport:(NSString*) tag) { + if (currentReport != nil) { + [currentReport appendTag:tag]; + } +} + +RCT_EXPORT_METHOD(appendConsoleLogToReport:(NSString*) consoleLog) { + if (currentReport != nil) { + [currentReport appendToConsoleLogs:consoleLog]; + } +} + +RCT_EXPORT_METHOD(setUserAttributeToReport:(NSString*) key:(NSString*) value) { + if (currentReport != nil) { + [currentReport setUserAttribute:value withKey:key]; + } +} + +RCT_EXPORT_METHOD(logDebugToReport:(NSString*) log) { + if (currentReport != nil) { + [currentReport logDebug:log]; + } +} + +RCT_EXPORT_METHOD(logVerboseToReport:(NSString*) log) { + if (currentReport != nil) { + [currentReport logVerbose:log]; + } +} + +RCT_EXPORT_METHOD(logWarnToReport:(NSString*) log) { + if (currentReport != nil) { + [currentReport logWarn:log]; + } +} + +RCT_EXPORT_METHOD(logErrorToReport:(NSString*) log) { + if (currentReport != nil) { + [currentReport logError:log]; + } +} + +RCT_EXPORT_METHOD(logInfoToReport:(NSString*) log) { + if (currentReport != nil) { + [currentReport logInfo:log]; + } +} + +RCT_EXPORT_METHOD(addFileAttachmentWithURLToReport:(NSString*) urlString) { + if (currentReport != nil) { + NSURL *url = [NSURL URLWithString:urlString]; + [currentReport addFileAttachmentWithURL:url]; + } +} + +RCT_EXPORT_METHOD(addFileAttachmentWithDataToReport:(NSString*) dataString) { + if (currentReport != nil) { + NSData* data = [dataString dataUsingEncoding:NSUTF8StringEncoding]; + [currentReport addFileAttachmentWithData:data]; + } +} + +RCT_EXPORT_METHOD(submitReport) { + globalReportCompletionHandler(currentReport); + currentReport = nil; +} + RCT_EXPORT_METHOD(setPreInvocationHandler:(RCTResponseSenderBlock)callBack) { if (callBack != nil) { IBGBugReporting.willInvokeHandler = ^{ @@ -167,8 +248,6 @@ - (dispatch_queue_t)methodQueue { RCT_EXPORT_METHOD(setPostInvocationHandler:(RCTResponseSenderBlock)callBack) { if (callBack != nil) { IBGBugReporting.didDismissHandler = ^(IBGDismissType dismissType, IBGReportType reportType) { - NSLog(@"Dismiss Type: %ld",(long)dismissType); - NSLog(@"Report Type: %ld",(long)reportType); //parse dismiss type enum NSString* dismissTypeString; @@ -458,7 +537,7 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(setViewHirearchyEnabled:(BOOL)viewHirearchyEnabled) { - Instabug.shouldCaptureViewHierarchy = viewHirearchyEnabled; + IBGBugReporting.shouldCaptureViewHierarchy = viewHirearchyEnabled; } RCT_EXPORT_METHOD(setAutoShowingSurveysEnabled:(BOOL)autoShowingSurveysEnabled) { @@ -647,7 +726,6 @@ - (NSDictionary *)constantsToExport @"dismissTypeCancel": @(IBGDismissTypeCancel), @"dismissTypeAddAtttachment": @(IBGDismissTypeAddAttachment), - @"reproStepsEnabled": @(IBGUserStepsModeEnable), @"reproStepsDisabled": @(IBGUserStepsModeDisable), @"reproStepsEnabledWithNoScreenshots": @(IBGUserStepsModeEnabledWithNoScreenshots), diff --git a/ios/RNInstabug/RCTConvert+InstabugEnums.m b/ios/RNInstabug/RCTConvert+InstabugEnums.m index 095e1077e..8b8b15de2 100644 --- a/ios/RNInstabug/RCTConvert+InstabugEnums.m +++ b/ios/RNInstabug/RCTConvert+InstabugEnums.m @@ -48,10 +48,9 @@ @implementation RCTConvert (InstabugEnums) }), IBGPromptOptionChat, integerValue) RCT_ENUM_CONVERTER(IBGUserStepsMode, (@{ - @"reproStepsEnabled": @(IBGUserStepsModeEnable), @"reproStepsDisabled": @(IBGUserStepsModeDisable), @"reproStepsEnabledWithNoScreenshots": @(IBGUserStepsModeEnabledWithNoScreenshots) - }), IBGUserStepsModeEnable, integerValue) + }), IBGUserStepsModeEnabledWithNoScreenshots, integerValue) RCT_ENUM_CONVERTER(IBGExtendedBugReportMode, (@{ @"enabledWithRequiredFields": @(IBGExtendedBugReportModeEnabledWithRequiredFields), diff --git a/link_gradle.js b/link_gradle.js index e503aa283..7e3b3ef29 100644 --- a/link_gradle.js +++ b/link_gradle.js @@ -68,8 +68,7 @@ function finish(logLevel, message) { } else { console.warn(message); } - - process.exit(0); + // process.exit(0); } function generateNewGradleFile(data) { diff --git a/models/Report.js b/models/Report.js new file mode 100644 index 000000000..1434640fa --- /dev/null +++ b/models/Report.js @@ -0,0 +1,120 @@ +import { NativeModules, Platform } from 'react-native'; +let { Instabug } = NativeModules; + +export default class Report { + + constructor( + tags, + consoleLogs, + instabugLogs, + userAttributes, + fileAttachments + ) { + this.tags = tags ? tags : []; + this.consoleLogs = consoleLogs ? consoleLogs : []; + this.instabugLogs = instabugLogs ? instabugLogs : []; + this.userAttributes = userAttributes ? userAttributes : {}; + this.fileAttachments = fileAttachments ? fileAttachments : []; + } + + /** + * Append a tag to the report to be sent. + * @param {string} tag + */ + appendTag(tag) { + Instabug.appendTagToReport(tag); + this.tags = [...this.tags, tag]; + } + + /** + * Append a console log to the report to be sent. + * @param {string} consoleLog + */ + appendConsoleLog(consoleLog) { + Instabug.appendConsoleLogToReport(consoleLog); + this.consoleLogs = [...this.consoleLogs, consoleLog]; + } + + /** + * Add a user attribute with key and value to the report to be sent. + * @param {string} key + * @param {string} value + */ + setUserAttribute(key, value) { + Instabug.setUserAttributeToReport(key, value); + this.userAttributes[key] = value; + } + + /** + * Attach debug log to the report to be sent. + * @param {string} log + */ + logDebug(log) { + Instabug.logDebugToReport(log); + this.instabugLogs = [...this.instabugLogs, {log: log, type: 'debug'}]; + } + + /** + * Attach verbose log to the report to be sent. + * @param {string} log + */ + logVerbose(log) { + Instabug.logVerboseToReport(log); + this.instabugLogs = [...this.instabugLogs, {log: log, type: 'verbose'}]; + } + + /** + * Attach warn log to the report to be sent. + * @param {string} log + */ + logWarn(log) { + Instabug.logWarnToReport(log); + this.instabugLogs = [...this.instabugLogs, {log: log, type: 'warn'}]; + } + + /** + * Attach error log to the report to be sent. + * @param {string} log + */ + logError(log) { + Instabug.logErrorToReport(log); + this.instabugLogs = [...this.instabugLogs, {log: log, type: 'error'}]; + } + + /** + * Attach info log to the report to be sent. + * @param {string} log + */ + logInfo(log) { + Instabug.logInfoToReport(log); + this.instabugLogs = [...this.instabugLogs, {log: log, type: 'info'}]; + } + + /** + * Attach a file to the report to be sent. + * @param {string} url + * @param {string} fileName + */ + addFileAttachmentWithUrl(url, fileName) { + if (Platform.OS === 'ios') { + Instabug.addFileAttachmentWithURLToReport(url); + } else { + Instabug.addFileAttachmentWithURLToReport(url, fileName); + } + this.fileAttachments = [...this.fileAttachments, {file: url, type: 'url'}]; + } + + /** + * Attach a file to the report to be sent. + * @param {string} data + * @param {string} fileName + */ + addFileAttachmentWithData(data, fileName) { + if (Platform.OS === 'ios') { + Instabug.addFileAttachmentWithDataToReport(data); + } else { + Instabug.addFileAttachmentWithDataToReport(data, fileName); + } + this.fileAttachments = [...this.fileAttachments, {file: url, type: 'data'}]; + } +} diff --git a/modules/BugReporting.js b/modules/BugReporting.js index 1f277884c..a3e28203a 100644 --- a/modules/BugReporting.js +++ b/modules/BugReporting.js @@ -5,6 +5,7 @@ import { Platform } from 'react-native'; let { Instabug } = NativeModules; +import InstabugModule from '../index'; /** * BugReporting @@ -103,24 +104,7 @@ export default { * report. */ onReportSubmitHandler: function(preSendingHandler) { - if (Platform.OS === 'ios') { - Instabug.addListener('IBGpreSendingHandler'); - NativeAppEventEmitter.addListener( - 'IBGpreSendingHandler', - preSendingHandler - ); - } else { - DeviceEventEmitter.addListener('IBGpreSendingHandler', function(payload) { - preSendingHandler( - payload.tagsArray, - payload.consoleLogs, - payload.userData, - payload.userAttributes, - payload.fileAttachments - ); - }); - } - Instabug.setPreSendingHandler(preSendingHandler); + InstabugModule.onReportSubmitHandler(preSendingHandler); }, /** @@ -217,17 +201,56 @@ export default { }, /** + * @deprecated use {@link BugReporting.show} * Invoke bug reporting with report type and options. * @param {reportType} type * @param {option} options */ showWithOptions(type, options) { + this.show(type, options); + }, + + /** + * Invoke bug reporting with report type and options. + * @param {reportType} type + * @param {option} options + */ + show(type, options) { if (!options) { options = []; } Instabug.showBugReportingWithReportTypeAndOptions(type, options); }, + /** + * Enable/Disable screen recording + * @param {boolean} autoScreenRecordingEnabled boolean for enable/disable + * screen recording on crash feature + */ + setAutoScreenRecordingEnabled: function(autoScreenRecordingEnabled) { + Instabug.setAutoScreenRecordingEnabled(autoScreenRecordingEnabled); + }, + + /** + * Sets auto screen recording maximum duration + * + * @param autoScreenRecordingMaxDuration maximum duration of the screen recording video + * in seconds + * The maximum duration is 30 seconds + */ + setAutoScreenRecordingMaxDuration: function(autoScreenRecordingMaxDuration) { + Instabug.setAutoScreenRecordingMaxDuration(autoScreenRecordingMaxDuration); + }, + + /** + * @summary Enables/disables inspect view hierarchy when reporting a bug/feedback. + * @param {boolean} viewHierarchyEnabled A boolean to set whether view hierarchy are enabled + * or disabled. + */ + setViewHierarchyEnabled: function(viewHierarchyEnabled) { + Instabug.setViewHierarchyEnabled(viewHierarchyEnabled); + }, + /** * The event used to invoke the feedback form * @readonly diff --git a/modules/CrashReporting.js b/modules/CrashReporting.js index 171fdc3ac..73ab76133 100644 --- a/modules/CrashReporting.js +++ b/modules/CrashReporting.js @@ -1,6 +1,9 @@ import { NativeModules, Platform } from 'react-native'; -import { parseErrorStack } from '../utils/InstabugUtils'; +import InstabugUtils from '../utils/InstabugUtils'; +import InstabugConstants from '../utils/InstabugConstants'; +import IBGEventEmitter from '../utils/IBGEventEmitter'; let { Instabug } = NativeModules; +import IBG from '../index'; /** * CrashReporting @@ -29,10 +32,14 @@ export default { platform: 'react_native', exception: jsStackTrace }; - if (Platform.OS === 'android') { - Instabug.sendHandledJSCrash(JSON.stringify(jsonObject)); + if (IBG._isOnReportHandlerSet() && Platform.OS === 'android') { + IBGEventEmitter.emit(InstabugConstants.SEND_HANDLED_CRASH, jsonObject); } else { - Instabug.sendHandledJSCrash(jsonObject); + if (Platform.OS === 'android') { + Instabug.sendHandledJSCrash(JSON.stringify(jsonObject)); + } else { + Instabug.sendHandledJSCrash(jsonObject); + } } } }; diff --git a/modules/Replies.js b/modules/Replies.js index 0fc82075e..494e7ea9f 100644 --- a/modules/Replies.js +++ b/modules/Replies.js @@ -31,16 +31,26 @@ export default { }, /** + * @deprecated use {@link Replies.setOnNewReplyReceivedHandler} * Sets a block of code that gets executed when a new message is received. * @param {function} onNewReplyReceivedCallback - A callback that gets * executed when a new message is received. */ setOnNewReplyReceivedCallback(onNewReplyReceivedCallback) { + this.setOnNewReplyReceivedHandler(onNewReplyReceivedCallback); + }, + + /** + * Sets a block of code that gets executed when a new message is received. + * @param {function} onNewReplyReceivedHandler - A callback that gets + * executed when a new message is received. + */ + setOnNewReplyReceivedHandler(onNewReplyReceivedHandler) { IBGEventEmitter.addListener( 'IBGOnNewReplyReceivedCallback', - onNewReplyReceivedCallback + onNewReplyReceivedHandler ); - Instabug.setOnNewReplyReceivedCallback(onNewReplyReceivedCallback); + Instabug.setOnNewReplyReceivedCallback(onNewReplyReceivedHandler); }, /** diff --git a/modules/Surveys.js b/modules/Surveys.js index a62792668..42bff976d 100644 --- a/modules/Surveys.js +++ b/modules/Surveys.js @@ -73,6 +73,7 @@ export default { }, /** + * @deprecated use {@link Surveys.setOnShowHandler} * @summary Sets a block of code to be executed just before the survey's UI is presented. * This block is executed on the UI thread. Could be used for performing any UI changes before * the survey's UI is shown. @@ -80,23 +81,35 @@ export default { * presenting the survey's UI. */ onShowCallback: function(willShowSurveyHandler) { + this.setOnShowHandler(willShowSurveyHandler); + }, + + /** + * @summary Sets a block of code to be executed just before the survey's UI is presented. + * This block is executed on the UI thread. Could be used for performing any UI changes before + * the survey's UI is shown. + * @param {function} onShowHandler - A block of code that gets executed before + * presenting the survey's UI. + */ + setOnShowHandler: function(onShowHandler) { if (Platform.OS === 'ios') { Instabug.addListener('IBGWillShowSurvey'); NativeAppEventEmitter.addListener( 'IBGWillShowSurvey', - willShowSurveyHandler + onShowHandler ); } else { DeviceEventEmitter.addListener( 'IBGWillShowSurvey', - willShowSurveyHandler + onShowHandler ); } - Instabug.setWillShowSurveyHandler(willShowSurveyHandler); + Instabug.setWillShowSurveyHandler(onShowHandler); }, /** + * @deprecated use {@link Surveys.setOnDismissHandler} * @summary Sets a block of code to be executed right after the survey's UI is dismissed. * This block is executed on the UI thread. Could be used for performing any UI * changes after the survey's UI is dismissed. @@ -104,20 +117,31 @@ export default { * the survey's UI is dismissed. */ onDismissCallback: function(didDismissSurveyHandler) { + this.setOnDismissHandler(didDismissSurveyHandler); + }, + + /** + * @summary Sets a block of code to be executed right after the survey's UI is dismissed. + * This block is executed on the UI thread. Could be used for performing any UI + * changes after the survey's UI is dismissed. + * @param {function} onDismissHandler - A block of code that gets executed after + * the survey's UI is dismissed. + */ + setOnDismissHandler: function(onDismissHandler) { if (Platform.OS === 'ios') { Instabug.addListener('IBGDidDismissSurvey'); NativeAppEventEmitter.addListener( 'IBGDidDismissSurvey', - didDismissSurveyHandler + onDismissHandler ); } else { DeviceEventEmitter.addListener( 'IBGDidDismissSurvey', - didDismissSurveyHandler + onDismissHandler ); } - Instabug.setDidDismissSurveyHandler(didDismissSurveyHandler); + Instabug.setDidDismissSurveyHandler(onDismissHandler); }, /** diff --git a/unlink_gradle.js b/unlink_gradle.js index 1d1aac5aa..f3208df72 100644 --- a/unlink_gradle.js +++ b/unlink_gradle.js @@ -87,8 +87,6 @@ function finish(logLevel, message) { } else { console.warn(message); } - - process.exit(0); } readFile(GRADLE_FILE_PATH, function(data) { diff --git a/utils/InstabugConstants.js b/utils/InstabugConstants.js index f19ffb317..7095b7582 100644 --- a/utils/InstabugConstants.js +++ b/utils/InstabugConstants.js @@ -1,3 +1,6 @@ export default { NETWORK_DATA_OBFUSCATION_HANDLER_EVENT: 'IBGSetNetworkDataObfuscationHandler', -}; \ No newline at end of file + PRESENDING_HANDLER: 'IBGpreSendingHandler', + SEND_HANDLED_CRASH: 'IBGSendHandledJSCrash', + SEND_UNHANDLED_CRASH: 'IBGSendUnhandledJSCrash' +}; diff --git a/utils/InstabugUtils.js b/utils/InstabugUtils.js index 0179831c9..a9985f403 100644 --- a/utils/InstabugUtils.js +++ b/utils/InstabugUtils.js @@ -1,7 +1,10 @@ 'use strict'; import {NativeModules, Platform} from 'react-native'; let {Instabug} = NativeModules; +import IBGEventEmitter from './IBGEventEmitter'; +import InstabugConstants from './InstabugConstants'; import parseErrorStackLib from '../../react-native/Libraries/Core/Devtools/parseErrorStack.js'; +import IBG from '../index'; export const parseErrorStack = (error) => { return parseErrorStackLib(error); @@ -24,11 +27,17 @@ export const captureJsErrors = () => { platform: 'react_native', exception: jsStackTrace } + if(Platform.OS === 'android') { - Instabug.sendJSCrash(JSON.stringify(jsonObject)); + if (IBG._isOnReportHandlerSet()) { + IBGEventEmitter.emit( InstabugConstants.SEND_UNHANDLED_CRASH, jsonObject); + } else { + Instabug.sendJSCrash(JSON.stringify(jsonObject)); + } } else { Instabug.sendJSCrash(jsonObject); } + if (originalHandler) { if (Platform.OS === 'ios') { originalHandler(e, isFatal); diff --git a/utils/XhrNetworkInterceptor.js b/utils/XhrNetworkInterceptor.js index 41a02091d..0fe8174ff 100644 --- a/utils/XhrNetworkInterceptor.js +++ b/utils/XhrNetworkInterceptor.js @@ -9,8 +9,6 @@ var onProgressCallback; var onDoneCallback; var isInterceptorEnabled = false; var network; -var duration = 0; - const _reset = () => { network = { @@ -19,10 +17,11 @@ const _reset = () => { requestHeaders: '', method: '', responseBody: '', - responseCode: undefined, + responseCode: 0, responseHeaders: '', contentType: '', - duration: 0 + duration: 0, + start: 0 }; } @@ -50,7 +49,8 @@ const XHRInterceptor = { }; XMLHttpRequest.prototype.send = function(data) { - network.requestBody = data ? data : ''; + var cloneNetwork = JSON.parse(JSON.stringify(network)); + cloneNetwork.requestBody = data ? data : ''; if (this.addEventListener) { this.addEventListener( @@ -62,7 +62,7 @@ const XHRInterceptor = { if (this.readyState === this.HEADERS_RECEIVED) { const contentTypeString = this.getResponseHeader('Content-Type'); if (contentTypeString) { - network.contentType = contentTypeString.split(';')[0]; + cloneNetwork.contentType = contentTypeString.split(';')[0]; } @@ -74,34 +74,33 @@ const XHRInterceptor = { const value = element.split(':')[1]; responseHeadersDictionary[key] = value; }); - network.responseHeaders = responseHeadersDictionary; + cloneNetwork.responseHeaders = responseHeadersDictionary; } } if (this.readyState === this.DONE) { - duration = (Date.now() - duration); + cloneNetwork.duration = (Date.now() - cloneNetwork.start); if (this.status == null) { - network.responseCode = 0; + cloneNetwork.responseCode = 0; } else { - network.responseCode = this.status; + cloneNetwork.responseCode = this.status; } - network.duration = duration; - + if (this.response) { if (this.responseType === 'blob') { var responseText = await (new Response(this.response)).text(); - network.responseBody = responseText; + cloneNetwork.responseBody = responseText; } else if (this.responseType === 'text') { - network.responseBody = this.response; + cloneNetwork.responseBody = this.response; } } if (this._hasError) { - network.requestBody = this._response; + cloneNetwork.requestBody = this._response; } if (onDoneCallback) { - onDoneCallback(network); + onDoneCallback(cloneNetwork); } } }, @@ -123,7 +122,7 @@ const XHRInterceptor = { this.upload.addEventListener('progress', downloadUploadProgressCallback); } - duration = Date.now(); + cloneNetwork.start = Date.now(); originalXHRSend.apply(this, arguments); }; isInterceptorEnabled = true;