diff --git a/Example/Buglife Example/AppDelegate.swift b/Example/Buglife Example/AppDelegate.swift index 74a1530..0129db5 100644 --- a/Example/Buglife Example/AppDelegate.swift +++ b/Example/Buglife Example/AppDelegate.swift @@ -29,6 +29,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, BuglifeDelegate { Buglife.shared().start(withEmail: "dave+test@buglife.com") Buglife.shared().invocationOptions = [.shake, .screenshot, .floatingButton] Buglife.shared().delegate = self + Buglife.shared().inputFields = LIFETextInputField.bugDetailInputFields() return true } diff --git a/Source/Buglife+LocalizedStrings.h b/Source/Buglife+LocalizedStrings.h index 2d44d87..ed7ef2c 100644 --- a/Source/Buglife+LocalizedStrings.h +++ b/Source/Buglife+LocalizedStrings.h @@ -26,8 +26,11 @@ LIFEStringKey LIFEStringKey_Report = @"Feedback"; LIFEStringKey LIFEStringKey_UserEmailInputFieldTitle = @"Your email"; LIFEStringKey LIFEStringKey_UserEmailInputFieldPlaceholder = @"name@example.com"; LIFEStringKey LIFEStringKey_SummaryInputFieldTitle = @"Feedback"; +LIFEStringKey LIFEStringKey_SummaryInputFieldDetailedTitle = @"What Happened?"; LIFEStringKey LIFEStringKey_SummaryInputFieldPlaceholder = @"Give us some feedback."; +LIFEStringKey LIFEStringKey_SummaryInputFieldDetailedPlaceholder = @"Provide a summary of your report."; LIFEStringKey LIFEStringKey_SummaryInputFieldAccessibilityHint = @"Text entered here is submitted with your feedback."; +LIFEStringKey LIFEStringKey_SummaryInputFieldAccessibilityDetailedHint = @"Text entered here is submitted with the bug report."; LIFEStringKey LIFEStringKey_StepsToReproduce = @"Steps to Reproduce"; LIFEStringKey LIFEStringKey_ExpectedResults = @"Expected Results"; LIFEStringKey LIFEStringKey_ExpectedResultsPlaceholder = @"Describe what you expected to happen."; diff --git a/Source/Buglife.h b/Source/Buglife.h index 1ff2f2c..3fa82bb 100644 --- a/Source/Buglife.h +++ b/Source/Buglife.h @@ -202,6 +202,8 @@ extern NSString * __nonnull const LIFENotificationUserSubmittedReport; * constructors, and include them in your array of custom input fields. * * Set this property to null if you'd like to simply use the default field(s). + * Set this property to `LIFEInputField.bugDetailInputFields()` if you want a Summary, + * Steps to Reproduce, Expected Resutls, and Actual Results fields. */ @property (nonatomic, nullable) NSArray *inputFields; diff --git a/Source/LIFEInputField.h b/Source/LIFEInputField.h index 855a60d..ebeb3c6 100644 --- a/Source/LIFEInputField.h +++ b/Source/LIFEInputField.h @@ -33,6 +33,15 @@ - (null_unspecified instancetype)init NS_UNAVAILABLE; +/** + * Returns an array of fields for more detailed bug reports, to aid in reproducing the bug. + * These include Summary, Steps to Reproduce, Expected Results, and Actual Results + * Note that even without using detailed input fields, button taps (and other events) + * will be logged to the Buglife dashboard to aid in reproducing the bug. + * + */ ++ (nonnull NSArray *)bugDetailInputFields; + /** * The bug report attribute name for this input field. * diff --git a/Source/LIFEInputField.m b/Source/LIFEInputField.m index fe98dc6..0928e03 100644 --- a/Source/LIFEInputField.m +++ b/Source/LIFEInputField.m @@ -99,6 +99,30 @@ - (BOOL)isSummaryField return [self.attributeName isEqualToString:LIFEInputFieldSummaryAttributeName]; } ++ (NSArray *)bugDetailInputFields +{ + LIFETextInputField *summaryInputField = [LIFETextInputField summaryInputField]; + summaryInputField.title = LIFELocalizedString(LIFEStringKey_SummaryInputFieldDetailedTitle); + summaryInputField.placeholder = LIFELocalizedString(LIFEStringKey_SummaryInputFieldDetailedPlaceholder); + summaryInputField.accessibilityHint = LIFELocalizedString(LIFEStringKey_SummaryInputFieldAccessibilityDetailedHint); + + LIFETextInputField *stepsToReproduce = [[LIFETextInputField alloc] initWithAttributeName:@"Steps to Reproduce"]; + stepsToReproduce.multiline = YES; + stepsToReproduce.title = LIFELocalizedString(LIFEStringKey_StepsToReproduce); + + LIFETextInputField *expectedResults = [[LIFETextInputField alloc] initWithAttributeName:@"Expected Results"]; + expectedResults.multiline = YES; + expectedResults.title = LIFELocalizedString(LIFEStringKey_ExpectedResults); + expectedResults.placeholder = LIFELocalizedString(LIFEStringKey_ExpectedResultsPlaceholder); + + LIFETextInputField *actualResults = [[LIFETextInputField alloc] initWithAttributeName:@"Actual Results"]; + actualResults.multiline = YES; + actualResults.title = LIFELocalizedString(LIFEStringKey_ActualResults); + actualResults.placeholder = LIFELocalizedString(LIFEStringKey_ActualResultsPlaceholder); + + return @[summaryInputField, stepsToReproduce, expectedResults, actualResults]; +} + #pragma mark - Debug description - (NSString *)debugDescription diff --git a/Source/Services/LIFENetworkManager.m b/Source/Services/LIFENetworkManager.m index eea4111..65984a8 100644 --- a/Source/Services/LIFENetworkManager.m +++ b/Source/Services/LIFENetworkManager.m @@ -122,6 +122,7 @@ + (NSURL *)_baseURL NSDictionary *environment = [[NSProcessInfo processInfo] environment]; NSString *overrideURL = environment[@"com.buglife.base_url"]; if (overrideURL) { + NSLog(@"Running with overridden base url: %@", overrideURL); return [NSURL URLWithString:overrideURL]; } diff --git a/Source/Views/LIFELocalizedStringProvider.m b/Source/Views/LIFELocalizedStringProvider.m index aa128a2..5c6f895 100644 --- a/Source/Views/LIFELocalizedStringProvider.m +++ b/Source/Views/LIFELocalizedStringProvider.m @@ -176,7 +176,9 @@ - (NSString *)_frenchStringForKey:(NSString *)key LIFEStringKey_Report : @"Avis", LIFEStringKey_UserEmailInputFieldTitle : @"Votre e-mail", LIFEStringKey_SummaryInputFieldTitle : @"Avis", - LIFEStringKey_SummaryInputFieldAccessibilityHint : @"Le texte saisi ici est envoyé avec votre avis.", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Qu'est-il arrivé?", + LIFEStringKey_SummaryInputFieldAccessibilityHint : @"Le texte saisi ici est présenté avec le rapport de bogue.", + LIFEStringKey_SummaryInputFieldAccessibilityDetailedHint : @"Le texte saisi ici est envoyé avec votre avis.", LIFEStringKey_StepsToReproduce : @"Procédure pour reproduire", LIFEStringKey_ExpectedResults : @"Résultats attendus", LIFEStringKey_ExpectedResultsPlaceholder : @"Décrivez ce que vous vous attendiez à arriver.", @@ -187,7 +189,7 @@ - (NSString *)_frenchStringForKey:(NSString *)key LIFEStringKey_DontAskUntilNextLaunch : @"Ne demandez pas jusqu'au prochain lancement", LIFEStringKey_HelpUsMakeXYZBetter : @"Aidez-nous à %@ mieux!", LIFEStringKey_HelpUsMakeThisAppBetter : @"Aidez-nous à améliorer cette application!", - LIFEStringKey_ThanksForFilingABug : @"Merci d'avoir envoyé votre avis !", + LIFEStringKey_ThanksForFilingABug : @"Merci d'avoir envoyé votre avis!", LIFEStringKey_AttachPhoto : @"Joindre une photo", LIFEStringKey_Arrow : @"Flèche", LIFEStringKey_ArrowAccessibilityValue : @"Tête pointe de %.0f pixels de haut et %.0f pixels de la gauche", @@ -195,13 +197,14 @@ - (NSString *)_frenchStringForKey:(NSString *)key LIFEStringKey_Loupe : @"Loupe", LIFEStringKey_LoupeAccessibilityValue : @"Centré au pixel de coordonnées %.0f par %.0f, et est de %.0f pixels de large par %.0f pixels de haut", LIFEStringKey_Component : @"Composant", - LIFEStringKey_DiscardReportAlertTitle : @"Supprimer cet avis ?", + LIFEStringKey_DiscardReportAlertTitle : @"Supprimer cet avis?", LIFEStringKey_DiscardReportAlertMessage : @"Toutes les données de ce rapport seront supprimées... Mais vous pourrez toujours envoyer un autre avis plus tard.", LIFEStringKey_DiscardReportAlertConfirm : @"Jeter", LIFEStringKey_DiscardReportAlertCancel : @"Annuler", LIFEStringKey_SummaryInputFieldPlaceholder : @"Avis", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Veuillez fournir un résumé de votre rapport.", LIFEStringKey_Attachments : @"Pièces jointes", - LIFEStringKey_GenericAlertTitle : @"Oups !", + LIFEStringKey_GenericAlertTitle : @"Oups!", LIFEStringKey_InvalidEmailAlertMessage : @"%@ n'est pas une adresse e-mail valide.", LIFEStringKey_ReportSubmissionErrorAlertTitle : @"Échec de l'envoi de votre avis", LIFEStringKey_ReportSubmissionErrorAlertMessage : @"Ceci peut être dû à une mauvaise qualité de la connexion réseau. Veuillez réessayer.", @@ -209,7 +212,7 @@ - (NSString *)_frenchStringForKey:(NSString *)key LIFEStringKey_ArrowToolLabel : @"Flèche", LIFEStringKey_LoupeToolLabel : @"Zoomer", LIFEStringKey_BlurToolLabel : @"Flou", - LIFEStringKey_ReportABugWithScreenRecording : @"Envoyer un avis avec cette capture vidéo ?", + LIFEStringKey_ReportABugWithScreenRecording : @"Envoyer un avis avec cette capture vidéo?", }; }); @@ -238,7 +241,9 @@ - (NSString *)_dutchStringForKey:(NSString *)key LIFEStringKey_Report : @"Feedback", LIFEStringKey_UserEmailInputFieldTitle : @"Jouw email", LIFEStringKey_SummaryInputFieldTitle : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Wat is er gebeurd?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Bij het bug rapport", LIFEStringKey_StepsToReproduce : @"Stappen om te reproduceren", LIFEStringKey_ExpectedResults : @"Verwachte resultaten", LIFEStringKey_ExpectedResultsPlaceholder : @"Beschrijf wat je dacht dat er zou gebeuren", @@ -375,7 +380,9 @@ - (NSString *)_germanStringForKey:(NSString *)key LIFEStringKey_Report : @"Feedback", LIFEStringKey_UserEmailInputFieldTitle : @"Ihre E-Mail-Adresse", LIFEStringKey_SummaryInputFieldTitle : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Was ist passiert?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Den Text, den Sie hier eingeben, wird zusammen mit dem Fehlerbericht übermittelt.", LIFEStringKey_StepsToReproduce : @"Schritte zum nachvollziehen", LIFEStringKey_ExpectedResults : @"Erwartete Ergebnisse", LIFEStringKey_ExpectedResultsPlaceholder : @"Beschreiben Sie was hätte passieren sollen.", @@ -453,7 +460,9 @@ - (NSString *)_chineseSimplifiedStringForKey:(NSString *)key LIFEStringKey_Report : @"反馈", LIFEStringKey_UserEmailInputFieldTitle : @"您的电子邮件地址", LIFEStringKey_SummaryInputFieldTitle : @"反馈", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"发生了什么情况?", LIFEStringKey_SummaryInputFieldPlaceholder : @"反馈", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"在此处输入的文字将随 Bug 报告一同提交。", LIFEStringKey_SummaryInputFieldAccessibilityHint : @"在此处输入的文字将随您的反馈一起提交。", LIFEStringKey_StepsToReproduce : @"重现步骤", LIFEStringKey_ExpectedResults : @"期待的结果", @@ -523,7 +532,9 @@ - (NSString *)_japaneseStringForKey:(NSString *)key LIFEStringKey_Report : @"フィードバック", LIFEStringKey_UserEmailInputFieldTitle : @"メールアドレス", LIFEStringKey_SummaryInputFieldTitle : @"フィードバック", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"どうしましたか?", LIFEStringKey_SummaryInputFieldPlaceholder : @"フィードバック", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"こちらに入力したテキストはバグ報告と一緒に送信されます。", LIFEStringKey_StepsToReproduce : @"再現ステップ", LIFEStringKey_ExpectedResults : @"予想していた結果", LIFEStringKey_ExpectedResultsPlaceholder : @"どうなると予測していたのか説明してください。", @@ -591,7 +602,9 @@ - (NSString *)_koreanStringForKey:(NSString *)key LIFEStringKey_Report : @"의견", LIFEStringKey_UserEmailInputFieldTitle : @"이메일 주소", LIFEStringKey_SummaryInputFieldTitle : @"의견", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"어떤 상황인가요?", LIFEStringKey_SummaryInputFieldPlaceholder : @"의견", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"여기에 입력한 내용은 버그 보고서와 함께 전송됩니다.", LIFEStringKey_StepsToReproduce : @"버그 재현 방법", LIFEStringKey_ExpectedResults : @"예상 결과", LIFEStringKey_ExpectedResultsPlaceholder : @"예상한 결과가 무엇인지 설명해주세요.", @@ -659,7 +672,9 @@ - (NSString *)_russianStringForKey:(NSString *)key LIFEStringKey_Report : @"Отзыв", LIFEStringKey_UserEmailInputFieldTitle : @"Ваш эл. адрес", LIFEStringKey_SummaryInputFieldTitle : @"Отзыв", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Что случилось?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Отзыв", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Введите текст, который войдет в отчет об ошибках.", LIFEStringKey_StepsToReproduce : @"Как воспроизвести", LIFEStringKey_ExpectedResults : @"Ожидаемый результат", LIFEStringKey_ExpectedResultsPlaceholder : @"Опишите, что должно было произойти.", @@ -727,7 +742,9 @@ - (NSString *)_vietnameseStringForKey:(NSString *)key LIFEStringKey_Report : @"Phản hồi", LIFEStringKey_UserEmailInputFieldTitle : @"Email của bạn", LIFEStringKey_SummaryInputFieldTitle : @"Phản hồi", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Chuyện gì đã xảy ra?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Phản hồi", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Nội dung được nhập vào đây sẽ được gửi cùng với báo cáo lỗi.", LIFEStringKey_StepsToReproduce : @"Các bước để Tái hiện lỗi", LIFEStringKey_ExpectedResults : @"Kết quả Mong đợi", LIFEStringKey_ExpectedResultsPlaceholder : @"Mô tả những gì bạn mong đợi sẽ xảy ra.", @@ -793,7 +810,9 @@ - (NSString *)_hebrewStringForKey:(NSString *)key LIFEStringKey_Report : @"משוב", LIFEStringKey_UserEmailInputFieldTitle : @"האימייל שלך", LIFEStringKey_SummaryInputFieldTitle : @"משוב", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"מה קרה?", LIFEStringKey_SummaryInputFieldPlaceholder : @"משוב", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"טקסט שתכתבו כאן יכלל בדיווח", LIFEStringKey_StepsToReproduce : @"צעדים לשחזור", LIFEStringKey_ExpectedResults : @"תוצאות מצופות", LIFEStringKey_ExpectedResultsPlaceholder : @"תארו מה ציפיתם שיקרה", @@ -859,7 +878,9 @@ - (NSString *)_polishStringForKey:(NSString *)key LIFEStringKey_Report : @"Opinia", LIFEStringKey_UserEmailInputFieldTitle : @"Twój adres e-mail", LIFEStringKey_SummaryInputFieldTitle : @"Opinia", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Co się stało?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Opinia", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Wpisana tutaj treść zostanie przekazana razem z raportem o błędzie.", LIFEStringKey_StepsToReproduce : @"Kroki potrzebne do odtworzenia", LIFEStringKey_ExpectedResults : @"Oczekiwane wyniki", LIFEStringKey_ExpectedResultsPlaceholder : @"Opisz, co według Ciebie powinno się stać.", @@ -925,7 +946,9 @@ - (NSString *)_swedishStringForKey:(NSString *)key LIFEStringKey_Report : @"Feedback", LIFEStringKey_UserEmailInputFieldTitle : @"Din e-postadress", LIFEStringKey_SummaryInputFieldTitle : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Vad hände?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Den text som skrivs här skickas som en del av buggrapporten.", LIFEStringKey_StepsToReproduce : @"Steg för att återskapa", LIFEStringKey_ExpectedResults : @"Förväntat resultat", LIFEStringKey_ExpectedResultsPlaceholder : @"Beskriv vad du trodde skulle hända.", @@ -991,7 +1014,9 @@ - (NSString *)_italianStringForKey:(NSString *)key LIFEStringKey_Report : @"Feedback", LIFEStringKey_UserEmailInputFieldTitle : @"Il tuo indirizzo e-mail", LIFEStringKey_SummaryInputFieldTitle : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"Cosa è successo?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Il testo inserito qui viene inviato insieme alla segnalazione di bug.", LIFEStringKey_StepsToReproduce : @"Passaggi da riprodurre", LIFEStringKey_ExpectedResults : @"Risultati previsti", LIFEStringKey_ExpectedResultsPlaceholder : @"Descrivi il risultato previsto.", @@ -1057,7 +1082,9 @@ - (NSString *)_portugueseStringForKey:(NSString *)key LIFEStringKey_Report : @"Comentários", LIFEStringKey_UserEmailInputFieldTitle : @"O seu e-mail", LIFEStringKey_SummaryInputFieldTitle : @"Comentários", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"O que aconteceu?", LIFEStringKey_SummaryInputFieldPlaceholder : @"Comentários", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"O texto aqui introduzido é submetido com o relatório de erro.", LIFEStringKey_StepsToReproduce : @"Passos de Reprodução", LIFEStringKey_ExpectedResults : @"Resultados Esperados", LIFEStringKey_ExpectedResultsPlaceholder : @"Descreva o que esperava que acontecesse.", @@ -1133,7 +1160,9 @@ - (NSString *)_arabicStringForKey:(NSString *)key LIFEStringKey_Report : @"التعليقات", LIFEStringKey_UserEmailInputFieldTitle : @"بريدك الإلكتروني", LIFEStringKey_SummaryInputFieldTitle : @"التعليقات", + LIFEStringKey_SummaryInputFieldDetailedTitle : @"ماذا حدث؟", LIFEStringKey_SummaryInputFieldPlaceholder : @"التعليقات", + LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"النص الذي تم إدخاله هنا مُرسل مع تقرير الخطأ في البرمجة.", LIFEStringKey_SummaryInputFieldAccessibilityHint : @"النص الذي يُدخَل هنا يُرسل مع تعليقاتك.", LIFEStringKey_StepsToReproduce : @"خطوات إعادة توليد الخطأ", LIFEStringKey_ExpectedResults : @"النتائج المتوقعة",