From 20a74cd05cc32e2c87bd7f41d1eb870275377bde Mon Sep 17 00:00:00 2001 From: Hossam Hassan Date: Fri, 3 Feb 2017 18:28:14 +0200 Subject: [PATCH] Add mapping for clearLogs API --- .../reactlibrary/RNInstabugReactnativeModule.java | 12 ++++++++++++ index.js | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index e4003f5..1d1dee6 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -521,6 +521,18 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { } } + /** + * Clears Instabug internal log + */ + @ReactMethod + public void clearLogs() { + try { + InstabugLog.clearLogs(); + } catch (Exception e) { + e.printStackTrace(); + } + } + private Locale getLocaleByKey(String instabugLocale) { String localeInLowerCase = instabugLocale.toLowerCase(); switch (localeInLowerCase) { diff --git a/index.js b/index.js index 4744b90..8e0cf52 100644 --- a/index.js +++ b/index.js @@ -612,6 +612,16 @@ module.exports = { } }, + /** + * Clears Instabug internal log + * + */ + clearLogs(){ + if (Platform.OS === 'android') { + Instabug.clearLogs(); + } + }, + /** * The event used to invoke the feedback form * @readonly