Skip to content

Commit 23f8ae1

Browse files
committed
✨ Android - Add api for showSurvey
1 parent f55cc4d commit 23f8ae1

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,22 @@ public void clearLogs() {
672672
}
673673
}
674674

675+
/**
676+
* Shows survey with a specific token.
677+
* Does nothing if there are no available surveys with that specific token.
678+
* Answered and cancelled surveys won't show up again.
679+
*
680+
* @param surveyToken A String with a survey token.
681+
*/
682+
@ReactMethod
683+
public void showSurveyWithToken(String surveyToken) {
684+
try {
685+
Instabug.showSurvey(surveyToken);
686+
} catch (Exception e) {
687+
e.printStackTrace();
688+
}
689+
}
690+
675691
/**
676692
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
677693
*

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ module.exports = {
104104
},
105105

106106
/**
107-
* Shows Survey with a specific token.
107+
* Shows survey with a specific token.
108108
* Does nothing if there are no available surveys with that specific token.
109-
* Answered and canceled surveys won't show up again.
109+
* Answered and cancelled surveys won't show up again.
110110
* @param {string} surveyToken - A String with a survey token.
111111
*
112112
*/

0 commit comments

Comments
 (0)