Skip to content

Commit

Permalink
✨ Add new keys and update native sdks to include custom surveys and s…
Browse files Browse the repository at this point in the history
…tore rating surveys (#52)
  • Loading branch information
salmamali authored Mar 27, 2019
1 parent 7c0d2c0 commit ee5f2a9
Show file tree
Hide file tree
Showing 54 changed files with 209 additions and 142 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
api ('com.instabug.library:instabug:8.1.2'){
api ('com.instabug.library:instabug:8.2.0'){
exclude group: 'com.android.support:appcompat-v7'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
private final String WELCOME_MESSAGE_LIVE_WELCOME_STEP_TITLE = "welcomeMessageLiveWelcomeStepTitle";
private final String WELCOME_MESSAGE_LIVE_WELCOME_STEP_CONTENT = "welcomeMessageLiveWelcomeStepContent";

private final String CUSTOM_SURVEY_THANKS_TITLE = "surveysCustomThanksTitle";
private final String CUSTOM_SURVEY_THANKS_SUBTITLE = "surveysCustomThanksSubTitle";

private final String STORE_RATING_THANKS_TITLE = "surveysStoreRatingThanksTitle";
private final String STORE_RATING_THANKS_SUBTITLE = "surveysStoreRatingThanksSubtitle";

private final String VIDEO_PLAYER_TITLE = "video";

private final String CONVERSATION_TEXT_FIELD_HINT = "conversationTextFieldHint";
Expand Down Expand Up @@ -1962,6 +1968,14 @@ private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
return InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_TITLE;
case WELCOME_MESSAGE_LIVE_WELCOME_STEP_CONTENT:
return InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_CONTENT;
case CUSTOM_SURVEY_THANKS_TITLE:
return InstabugCustomTextPlaceHolder.Key.SURVEYS_CUSTOM_THANKS_TITLE;
case CUSTOM_SURVEY_THANKS_SUBTITLE:
return InstabugCustomTextPlaceHolder.Key.SURVEYS_CUSTOM_THANKS_SUBTITLE;
case STORE_RATING_THANKS_TITLE:
return InstabugCustomTextPlaceHolder.Key.SURVEYS_STORE_RATING_THANKS_TITLE;
case STORE_RATING_THANKS_SUBTITLE:
return InstabugCustomTextPlaceHolder.Key.SURVEYS_STORE_RATING_THANKS_SUBTITLE;
default:
return null;
}
Expand Down Expand Up @@ -2168,6 +2182,12 @@ public Map<String, Object> getConstants() {
constants.put("welcomeMessageLiveWelcomeStepTitle", WELCOME_MESSAGE_LIVE_WELCOME_STEP_TITLE);
constants.put("welcomeMessageLiveWelcomeStepContent", WELCOME_MESSAGE_LIVE_WELCOME_STEP_CONTENT);

constants.put(CUSTOM_SURVEY_THANKS_TITLE, CUSTOM_SURVEY_THANKS_TITLE);
constants.put(CUSTOM_SURVEY_THANKS_SUBTITLE, CUSTOM_SURVEY_THANKS_SUBTITLE);

constants.put(STORE_RATING_THANKS_TITLE, STORE_RATING_THANKS_TITLE);
constants.put(STORE_RATING_THANKS_SUBTITLE, STORE_RATING_THANKS_SUBTITLE);

return constants;
}
}
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,11 @@ const InstabugModule = {
welcomeMessageLiveWelcomeStepTitle:
Instabug.welcomeMessageLiveWelcomeStepTitle,
welcomeMessageLiveWelcomeStepContent:
Instabug.welcomeMessageLiveWelcomeStepContent
Instabug.welcomeMessageLiveWelcomeStepContent,
surveysCustomThanksTitle: Instabug.surveysCustomThanksTitle,
surveysCustomThanksSubTitle: Instabug.surveysCustomThanksSubTitle,
surveysStoreRatingThanksTitle: Instabug.surveysStoreRatingThanksTitle,
surveysStoreRatingThanksSubtitle: Instabug.surveysStoreRatingThanksSubtitle
}
};

Expand Down
4 changes: 3 additions & 1 deletion ios/Instabug.framework/Headers/IBGSurveys.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ NS_SWIFT_NAME(Surveys)
@brief Sets a threshold for numbers of sessions and another for number of days required before a survey, that has been dismissed once, would show again.
@discussion When a survey that has been shown to the user gets dismissed once, it will not reappear to the user unless a certain number of sessions have started AND a certain number of days have passed since the user first dismissed the survey. Note that if a survey is dismissed for a second time, it will not show again, in other words, it will be set to `canceled`. This applies to both surveys with and without tokens.
Please note that this overrides the dashboard configuration for reshowing if called.
@param sessionCount : Number of sessions required to be initialized before a dismissed survey can be shown again.
@param daysCount : Number of days required to pass before a dismissed survey can be shown again.
*/
+ (void)setThresholdForReshowingSurveyAfterDismiss:(NSInteger)sessionCount daysCount:(NSInteger)daysCount;
+ (void)setThresholdForReshowingSurveyAfterDismiss:(NSInteger)sessionCount daysCount:(NSInteger)daysCount DEPRECATED_MSG_ATTRIBUTE("Reshowing the survey can now be controlled from the dashboard for any new survey you create.");

/**
@brief Returns true if the survey with a specific token was answered before .
Expand Down
8 changes: 6 additions & 2 deletions ios/Instabug.framework/Headers/IBGTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ extern NSString * const kIBGSurveyIntroTitleText;
extern NSString * const kIBGSurveyIntroDescriptionText;
extern NSString * const kIBGSurveyIntroTakeSurveyButtonText;
extern NSString * const kIBGSurveyIntroDismissButtonText;
extern NSString * const kIBGSurveyThankYouTitleText;
extern NSString * const kIBGSurveyThankYouDescriptionText;
extern NSString * const kIBGSurveyThankYouTitleText DEPRECATED_MSG_ATTRIBUTE("kIBGSurveyThankYouTitleText is deprecated. You can edit this string from the dashboard, and use kIBGCustomSurveyThankYouTitleText for Custom surveys.");
extern NSString * const kIBGSurveyThankYouDescriptionText DEPRECATED_MSG_ATTRIBUTE("kIBGSurveyThankYouDescriptionText is deprecated. You can edit this string from the dashboard, and use kIBGCustomSurveyThankYouDescriptionText for Custom surveys.");
extern NSString * const kIBGStoreRatingThankYouTitleText;
extern NSString * const kIBGStoreRatingThankYouDescriptionText;
extern NSString * const kIBGCustomSurveyThankYouTitleText;
extern NSString * const kIBGCustomSurveyThankYouDescriptionText;
extern NSString * const kIBGSurveysNPSLeastLikelyStringName;
extern NSString * const kIBGSurveysNPSMostLikelyStringName;
extern NSString * const kIBGSurveyNextButtonTitle;
Expand Down
Binary file modified ios/Instabug.framework/Info.plist
Binary file not shown.
Binary file modified ios/Instabug.framework/Instabug
Binary file not shown.
Binary file modified ios/Instabug.framework/InstabugResources.bundle/Assets.car
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ios/Instabug.framework/InstabugResources.bundle/IBGChatCell.nib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ios/Instabug.framework/InstabugResources.bundle/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit ee5f2a9

Please sign in to comment.