Skip to content

Commit bc1b5bd

Browse files
committed
✨ iOS - Add new api for showSurveyWithToken
1 parent 1333c4c commit bc1b5bd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ module.exports = {
103103

104104
},
105105

106+
/**
107+
* Shows Survey with a specific token.
108+
* Does nothing if there are no available surveys with that specific token.
109+
* Answered and canceled surveys won't show up again.
110+
* @param {string} surveyToken - A String with a survey token.
111+
*
112+
*/
113+
showSurveyWithToken: function (surveyToken) {
114+
Instabug.showSurveyWithToken(surveyToken);
115+
},
116+
106117
/**
107118
* Sets a block of code to be executed just before the SDK's UI is presented.
108119
* This block is executed on the UI thread. Could be used for performing any

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ - (dispatch_queue_t)methodQueue {
6161
[Instabug IBGLog:log];
6262
}
6363

64+
RCT_EXPORT_METHOD(showSurveyWithToken:(NSString *)surveyToken) {
65+
[Instabug showSurveyWithToken:surveyToken];
66+
}
67+
6468
RCT_EXPORT_METHOD(setUserStepsEnabled:(BOOL)isUserStepsEnabled) {
6569
[Instabug setUserStepsEnabled:isUserStepsEnabled];
6670
}

0 commit comments

Comments
 (0)