diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index a7d0635..e8869f0 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -672,6 +672,22 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { } } + /** + * Shows survey with a specific token. + * Does nothing if there are no available surveys with that specific token. + * Answered and cancelled surveys won't show up again. + * + * @param surveyToken A String with a survey token. + */ + @ReactMethod + public void showSurveyWithToken(String surveyToken) { + try { + Instabug.showSurvey(surveyToken); + } catch (Exception e) { + e.printStackTrace(); + } + } + /** * Sets user attribute to overwrite it's value or create a new one if it doesn't exist. * diff --git a/index.js b/index.js index b45e737..dd05ed5 100644 --- a/index.js +++ b/index.js @@ -104,9 +104,9 @@ module.exports = { }, /** - * Shows Survey with a specific token. + * Shows survey with a specific token. * Does nothing if there are no available surveys with that specific token. - * Answered and canceled surveys won't show up again. + * Answered and cancelled surveys won't show up again. * @param {string} surveyToken - A String with a survey token. * */