-
Notifications
You must be signed in to change notification settings - Fork 48
[MOB 2943] Flutter API: setValueForStringWithKey #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4574592
✨ Add tests for mapped android enums for InstabugCustomTextPlaceHolde…
salmamali 2770f85
✨ Add android enums for IBGCustomTextPlaceHolderKey
salmamali 15ced3f
✨ add ios enums for IBGCustomTextPlaceHolderKey
salmamali 27f7d44
✨ add dart enums for IBGCustomTextPlaceHolderKey
salmamali 32cd738
✨ add android map for setValueForStringWithKey
salmamali 287233a
✨ add ios map for setValueForStringWithKey
salmamali 53b8447
✨ add dart API for setValueForStringWithKey
salmamali 1589b9f
✨ Add setValueForStringWithKey to the example app
salmamali 3b7c8c9
✨ add setValueForStringWithKey test
salmamali 28438f5
📝 change the module name from InstabugFlutter to Instabug
salmamali 4b8d4ed
🎨 some changes to remove some lint warnings
salmamali 5036224
📚 update doc
salmamali c4981d7
📝 add duplicate test to include all keys for future use
salmamali 3c3a089
Merge master into branch
salmamali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
import com.instabug.chat.Replies; | ||
import com.instabug.library.Instabug; | ||
import com.instabug.library.InstabugColorTheme; | ||
import com.instabug.library.InstabugCustomTextPlaceHolder; | ||
import com.instabug.library.invocation.InstabugInvocationEvent; | ||
import com.instabug.library.logging.InstabugLog; | ||
import com.instabug.library.ui.onboarding.WelcomeMessage; | ||
|
@@ -40,6 +41,8 @@ public class InstabugFlutterPlugin implements MethodCallHandler { | |
final public static String INVOCATION_EVENT_FLOATING_BUTTON = "InvocationEvent.floatingButton"; | ||
final public static String INVOCATION_EVENT_SHAKE = "InvocationEvent.shake"; | ||
|
||
private InstabugCustomTextPlaceHolder placeHolder = new InstabugCustomTextPlaceHolder(); | ||
|
||
/** | ||
* Plugin registration. | ||
*/ | ||
|
@@ -323,5 +326,17 @@ public void invokeWithMode(String invocationMode, List<String> invocationOptions | |
*/ | ||
public void logUserEventWithName(String name) { | ||
Instabug.logUserEvent(name); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Overrides any of the strings shown in the SDK with custom ones. | ||
* @param value String value to override the default one. | ||
* @param forStringWithKey Key of string to override. | ||
*/ | ||
public void setValue(String value, String forStringWithKey) { | ||
InstabugCustomTextPlaceHolder.Key key = ArgsRegistry.getDeserializedValue(forStringWithKey, InstabugCustomTextPlaceHolder.Key.class); | ||
placeHolder.set(key, value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice hack 👏 I like it 😄 |
||
Instabug.setCustomTextPlaceHolders(placeHolder); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.