Skip to content
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

GetNavigation deep link bug on android devices #2981

Open
keremkabiloglu opened this issue Dec 6, 2023 · 4 comments
Open

GetNavigation deep link bug on android devices #2981

keremkabiloglu opened this issue Dec 6, 2023 · 4 comments
Assignees

Comments

@keremkabiloglu
Copy link

When I click on a deep link about my app iOS devices works properly. They can opens the given page in the link with parameters. But android devices cannot open links which are includes parameters. It throws error.

I/flutter (22040): Null check operator used on a null value
I/flutter (22040): #0      ParseRouteTree._parseParams (package:get/get_navigation/src/root/parse_route.dart:173)
I/flutter (22040): #1      ParseRouteTree.matchRoute (package:get/get_navigation/src/root/parse_route.dart:64)
I/flutter (22040): #2      PageRedirect.needRecheck (package:get/get_navigation/src/routes/route_middleware.dart:258)
I/flutter (22040): #3      PageRedirect.page (package:get/get_navigation/src/routes/route_middleware.dart:199)
I/flutter (22040): #4      GetMaterialApp.initialRoutesGenerate (package:get/get_navigation/src/root/get_material_app.dart:348)
I/flutter (22040): #5      _WidgetsAppState.build.<anonymous closure> (package:flutter/src/widgets/app.dart:1682)
I/flutter (22040): #6      NavigatorState.restoreState (package:flutter/src/widgets/navigator.dart:3609)
Map<String, String> _parseParams(String path, PathDecoded routePath) {
    final params = <String, String>{};
    var idx = path.indexOf('?');
    if (idx > -1) {
      path = path.substring(0, idx);
      final uri = Uri.tryParse(path);
      if (uri != null) {
        params.addAll(uri.queryParameters);
      }
    }
    var paramsMatch = routePath.regex.firstMatch(path);

    for (var i = 0; i < routePath.keys.length; i++) {
      var param = Uri.decodeQueryComponent(paramsMatch![i + 1]!);
      params[routePath.keys[i]!] = param; // Throws error.
    }
    return params;
  }
}

Flutter Version: 3.16.0
GetX Version: 4.6.6

@moo-kesh
Copy link

moo-kesh commented Dec 8, 2023

I have faced a similar issue like yours. You can try these two solutions:

  1. check your initial route name, which should be '/'.
  2. downgrade get to 4.6.5.

@udhaya3200
Copy link

Is issue resolved for me also same error

@LidiiaPl
Copy link

I have the same issue. The initial route name in my project is already '/' and I've downgraded get to 4.6.5. Didn't work.
Any other ideas?

@korutx
Copy link
Contributor

korutx commented Mar 29, 2024

I've submitted a PR (#3067) that aims to address the problem you've encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants