mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-01 13:40:42 +00:00
✨ iOS - Add new api for hasRespondedToSurveyWithToken
This commit is contained in:
parent
bc1b5bdb23
commit
f55cc4d582
12
index.js
12
index.js
@ -114,6 +114,18 @@ module.exports = {
|
||||
Instabug.showSurveyWithToken(surveyToken);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if the survey with a specific token was answered before.
|
||||
* Will return false if the token does not exist or if the survey was not answered before.
|
||||
* @param {string} surveyToken - A String with a survey token.
|
||||
* @param {function} surveyTokenCallback callback with argument as the desired value of the whether
|
||||
* the survey has been responded to or not.
|
||||
*
|
||||
*/
|
||||
hasRespondedToSurveyWithToken: function (surveyToken, surveyTokenCallback) {
|
||||
Instabug.hasRespondedToSurveyWithToken(surveyToken, surveyTokenCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets a block of code to be executed just before the SDK's UI is presented.
|
||||
* This block is executed on the UI thread. Could be used for performing any
|
||||
|
@ -65,6 +65,10 @@ RCT_EXPORT_METHOD(showSurveyWithToken:(NSString *)surveyToken) {
|
||||
[Instabug showSurveyWithToken:surveyToken];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(hasRespondedToSurveyWithToken:(NSString *)surveyToken callback:(RCTResponseSenderBlock)callback) {
|
||||
callback(@[@([Instabug hasRespondedToSurveyWithToken:surveyToken])]);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(setUserStepsEnabled:(BOOL)isUserStepsEnabled) {
|
||||
[Instabug setUserStepsEnabled:isUserStepsEnabled];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user