diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 163d0d0..6ac310a 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -589,6 +589,18 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { return mInstabug.getAllUserAttributes(); } + /** + * Clears all user attributes if exists. + */ + @ReactMethod + public void clearAllUserAttributes() { + try { + mInstabug.clearAllUserAttributes(); + } 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 713b9b7..e52419f 100644 --- a/index.js +++ b/index.js @@ -675,6 +675,15 @@ module.exports = { } }, + /** + * Clears all user attributes if exists. + */ + clearAllUserAttributes(){ + if (Platform.OS === 'android') { + Instabug.clearAllUserAttributes(); + } + }, + /** * The event used to invoke the feedback form * @readonly @@ -686,7 +695,8 @@ module.exports = { screenshot: Instabug.invocationEventScreenshot, twoFingersSwipe: Instabug.invocationEventTwoFingersSwipe, floatingButton: Instabug.invocationEventFloatingButton - }, + } + , /** * Type of SDK dismiss * @readonly @@ -696,7 +706,8 @@ module.exports = { submit: Instabug.dismissTypeSubmit, cancel: Instabug.dismissTypeCancel, addAttachment: Instabug.dismissTypeAddAttachment - }, + } + , /** * Type of report to be submit * @readonly @@ -705,7 +716,8 @@ module.exports = { reportType: { bug: Instabug.reportTypeBug, feedback: Instabug.reportTypeFeedback - }, + } + , /** * The mode used upon invocating the SDK * @readonly @@ -717,7 +729,8 @@ module.exports = { newFeedback: Instabug.invocationModeNewFeedback, newChat: Instabug.invocationModeNewChat, chatsList: Instabug.invocationModeChatsList - }, + } + , /** * The supported locales * @readonly @@ -740,7 +753,8 @@ module.exports = { spanish: Instabug.localeSpanish, swedish: Instabug.localeSwedish, turkish: Instabug.localeTurkish - }, + } + , /** * The color theme of the different UI elements * @readonly @@ -749,7 +763,8 @@ module.exports = { colorTheme: { light: Instabug.colorThemeLight, dark: Instabug.colorThemeDark - }, + } + , /** * Rectangle edges * @readonly @@ -760,7 +775,8 @@ module.exports = { minY: Instabug.rectMinYEdge, maxX: Instabug.rectMaxXEdge, maxY: Instabug.rectMaxYEdge - }, + } + , /** * Instabug strings * @readonly @@ -806,4 +822,5 @@ module.exports = { messageNotification: Instabug.messageNotification, messagesNotificationAndOthers: Instabug.messagesNotificationAndOthers } -}; \ No newline at end of file +} +; \ No newline at end of file