This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Migrate iOS and Android to use pushRouteInformation #39372
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
|
@@ -726,7 +726,7 @@ public void itSendsdefaultInitialRouteOnStartIfNotDeepLinkingFromIntent() { | |
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntent() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntent() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -742,11 +742,11 @@ public void itSendsPushRouteMessageWhenOnNewIntent() { | |
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRoute("/custom/route?query=test"); | ||
.pushRouteInformation("/custom/route?query=test"); | ||
} | ||
|
||
@Test | ||
public void itDoesNotSendPushRouteMessageWhenOnNewIntentIsNonHierarchicalUri() { | ||
public void itDoesNotSendPushRouteInformationMessageWhenOnNewIntentIsNonHierarchicalUri() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -764,11 +764,12 @@ public void itDoesNotSendPushRouteMessageWhenOnNewIntentIsNonHierarchicalUri() { | |
delegate.onNewIntent(mockIntent); | ||
|
||
// Verify that the navigation channel was not given a push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(0)).pushRoute("mailto:[email protected]"); | ||
verify(mockFlutterEngine.getNavigationChannel(), times(0)) | ||
.pushRouteInformation("mailto:[email protected]"); | ||
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntentWithQueryParameterAndFragment() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntentWithQueryParameterAndFragment() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -785,11 +786,11 @@ public void itSendsPushRouteMessageWhenOnNewIntentWithQueryParameterAndFragment( | |
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRoute("/custom/route?query=test#fragment"); | ||
.pushRouteInformation("/custom/route?query=test#fragment"); | ||
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntentWithFragmentNoQueryParameter() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntentWithFragmentNoQueryParameter() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -804,11 +805,12 @@ public void itSendsPushRouteMessageWhenOnNewIntentWithFragmentNoQueryParameter() | |
delegate.onNewIntent(mockIntent); | ||
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route#fragment"); | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRouteInformation("/custom/route#fragment"); | ||
} | ||
|
||
@Test | ||
public void itSendsPushRouteMessageWhenOnNewIntentNoQueryParameter() { | ||
public void itSendsPushRouteInformationMessageWhenOnNewIntentNoQueryParameter() { | ||
when(mockHost.shouldHandleDeeplinking()).thenReturn(true); | ||
// Create the real object that we're testing. | ||
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost); | ||
|
@@ -823,7 +825,8 @@ public void itSendsPushRouteMessageWhenOnNewIntentNoQueryParameter() { | |
delegate.onNewIntent(mockIntent); | ||
|
||
// Verify that the navigation channel was given the push route message. | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route"); | ||
verify(mockFlutterEngine.getNavigationChannel(), times(1)) | ||
.pushRouteInformation("/custom/route"); | ||
} | ||
|
||
@Test | ||
|
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
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.
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 am not sure if we can remove this or not. is this a public API? @reidbaker
This is still used by FlutterView, I am not sure if we can change the API or not.
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 think this needs to stay for now. I am not following why you want it removed.
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.
oh sorry, i highlighted the wrong one, I meant the pushRoute method in line 43
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.
Can you replace the usages in flutterView with your new method? If so then maybe the right pattern is to modify the existing one to have the new behavior.
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.
yes If i am free to change this API, I can do that. I assume there is no public access to this class from third party plugin then?
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 dont know how I would know that. I think it would be unusual for us to expose the internals of a plugin but I guess it is possible. @bparrishMines any advice you can share for how to know if this is used by a third party. I checked google3 and did not find any direct references.
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 will go ahead and merge this pr for now, we can spawn another pr to remove the push route api if we are sure we can remove it
Uh oh!
There was an error while loading. Please reload this page.
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 don't know if this is used by a plugin, but it looks like something that could be used by Add to App.