mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-02 14:10:40 +00:00
✨ Android - Add api for hasRespondedToSurvey
This commit is contained in:
parent
23f8ae15d3
commit
cccb8d3557
@ -672,6 +672,26 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 surveyToken the attribute key as string
|
||||||
|
* @param hasRespondedCallback A callback that gets invoked with the returned value of whether
|
||||||
|
* the user has responded to the survey or not.
|
||||||
|
* @return the desired value of whether the user has responded to the survey or not.
|
||||||
|
*/
|
||||||
|
@ReactMethod
|
||||||
|
public void hasRespondedToSurveyWithToken(String surveyToken, Callback hasRespondedCallback) {
|
||||||
|
boolean hasResponded;
|
||||||
|
try {
|
||||||
|
hasResponded = Instabug.hasRespondToSurvey(surveyToken);
|
||||||
|
hasRespondedCallback.invoke(hasResponded);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows survey with a specific token.
|
* Shows survey with a specific token.
|
||||||
* Does nothing if there are no available surveys with that specific token.
|
* Does nothing if there are no available surveys with that specific token.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user