-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[android_intent] add flags option #2000
[android_intent] add flags option #2000
Conversation
ened
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding a test, I think this is a great addition.
Did you increase the version in pubspec.yaml?
| }); | ||
| group('AndroidIntent', () { | ||
| test('pass right params', () async { | ||
| if (Platform.isIOS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to split this into two tests
tests invalid platform (you need to supply a MockPlatform for iOS)
and
pass right params (just with mock platform for Android) and remove the if/else.
MockPlatform details can be seen in the accompanying test to https://github.com/flutter/plugins/blob/master/packages/firebase_messaging/lib/firebase_messaging.dart.
| } | ||
| }); | ||
| test('pass wrong params', () async { | ||
| if (Platform.isIOS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if/else could be omitted if implemented as noted above
b08f38f to
f083a21
Compare
|
Hi @ened , sorry to make you wait. I have:
|
|
I think this is a great PR! @collinjackson, @mklim WDYT - ready to merge? |
mklim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@datvt9312 thank you for the contribution and for adding tests!
@ened thanks for reviewing this! It was really important to help land this.
Here's the LGTM you need from a Flutter team member. :)
Added "flags" option to call intent.addFlags(int) in native.
Added "flags" option to call intent.addFlags(int) in native.
Description
we are launching to a different package we need to set the FLAG_ACTIVITY_NEW_TASK flag
Similar to react native Link.openUrl() : https://github.com/facebook/react-native/blob/3b6f6ca4d5fcee6f1bc6d6242e3e2ef136e4d546/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L97
Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?