I am using the url_launcher package to open a login URL in an external browser. I need to listen to URL changes that occur in the browser after the initial launch. While I have tried using the app_links package to listen for URL changes, it only triggers when the redirect URL is hit, not for intermediate URL changes.
Current Behavior:
The url_launcher package opens the URL in an external browser but does not provide any mechanism to listen to URL changes.
The app_links package only listens for the final redirect URL and does not capture intermediate URL changes.
Expected Behavior: I would like to have a way to listen to all URL changes in the browser launched by url_launcher, not just the final redirect URL.
final appLinks = AppLinks();
_uriSubscription = appLinks.uriLinkStream.listen((uri) async {
if (uri != null) {
print("Received URL: ${uri.toString()}");
if (uri.toString().startsWith(redirectUrl)) {
// My redirect logic.
}
}
});
Is there any way to achieve this or please suggest alternative approaches that allow listening to URL changes while maintaining a native browser experience.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745248594a4618536.html
评论列表(0条)