Unable to override invalid comment string
JC-Dev100 opened this issue · 6 comments
- I am trying to override the string for the error prompt that shows when the user tries to send a report without having a description filled out (In the green box in the image below). However, so far, I have been unable to do so.
- I am able to override similar strings such as the error prompt that shows when the user tries to send a report without a valid email address.
-
I am not 100% sure what the correct string to override here is but I assume it would be
InstabugCustomTextPlaceHolder.Key.INVALID_COMMENT_MESSAGE
. -
I have tried override many other strings/keys, but so far everything I have tried to override does not change the string in question. I was wondering if someone can help me figure out what I am doing wrong here or if this is a bug within Instabug.
Steps to Reproduce the Problem
- Create new Android project and setup instabug
- Add the code block from the section "Instabug integration code" to the onCreate method
- Start app
- Tap on the floating action button
- Try to report a bug
- Try to send report with an empty email and Description fields
- Observe the error prompt of invalid email is overridden to shown "CUSTOM INVALID EMAIL"
- Observer the error prompt of invalid description still shows "Please enter at least 2 characters"
Expected Behavior
- Able to override the string in the first image. The error prompt that shows when the user tries to send a report without having a description filled out. "Please enter at least 2 characters"
Actual Behavior
- Unable to override the string in the first image. The error prompt that shows when the user tries to send a report without having a description filled out. "Please enter at least 2 characters"
Instabug integration code
Add this code block to a new Android project in the onCreate method
Instabug.Builder(this.application, MY_TOKEN)
.setInvocationEvents(InstabugInvocationEvent.SHAKE, InstabugInvocationEvent.FLOATING_BUTTON)
.build()
BugReporting.setOptions(Option.COMMENT_FIELD_REQUIRED)
val placeHolder = InstabugCustomTextPlaceHolder()
placeHolder.set(InstabugCustomTextPlaceHolder.Key.INVALID_EMAIL_MESSAGE, "CUSTOM INVALID EMAIL")
placeHolder.set(InstabugCustomTextPlaceHolder.Key.INVALID_COMMENT_MESSAGE, "CUSTOM INVALID COMMENT")
Instabug.setCustomTextPlaceHolders(placeHolder)
SDK Version
11.6.0
Android Version
- Tried on Android version 28, 30, 31
Device Model
- Tried on Pixel XL, and Pixel 3a
Hi @JC-Dev100,
Thanks for reaching out. To be able to change the error message highlighted in green in the first screenshot, You need to add a placeholder with the key COMMENT_FIELD_INSUFFICIENT_CONTENT
Hi @IslamMohamady ,
Thank you for your quick reply. Using that key works. Thanks so much for your help with this.
I also have a follow up question. I have attached an image to this comment.
- In the green boxes for the new image below, I was having the same issue and I was wondering what the key to override the "Email" and "Description" strings are?
Hi @JC-Dev100 ,
I am afraid that these fields are not configurable.
Hi @IslamMohamady ,
Thanks for letting me know. I guess I can close this issue then. However, before I do, I wanted to ask if there is any chance those fields will be in the future? Or can I make a feature request, so they could be overridden in the future?
@JC-Dev100 ,
Please make a feature request. You can communicate the change needed through our dashboard chat 🙏🏻
Ok will do, thanks again @IslamMohamady. Closing this issue.