I am creating a flutter application. I am using Deeplink. It is creating success but the clicking part of the app not working well. The app is retrieving the url but not retrieving the params. I don't know what is the reason? My codes are shown below.
final DynamicLinkParameters parameters = DynamicLinkParameters(
uriPrefix: 'https://mydomain.page.link',
link: Uri.parse(
// 'https://pachiradev.page.link/circleinvite?token=' + uid1.toString()
'https://pachiradev.page.link/circleinvite?token=' + '1234'),
androidParameters: AndroidParameters(
packageName: 'io.flutter.plugins.firebasedynamiclinksexample',
minimumVersion: 0,
),
dynamicLinkParametersOptions: DynamicLinkParametersOptions(
shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short,
),
iosParameters: IosParameters(
bundleId: 'com.google.FirebaseCppDynamicLinksTestApp.dev',
minimumVersion: '0',
),
);
Uri url;
final ShortDynamicLink shortLink = await parameters.buildShortLink();
url = shortLink.shortUrl;
print(url)
//https://mydomain.page.link/circleinvite?token=1234
//https://mydomain.page.link/ARTu
Here I printing the url with params. But in retrieving code I am not getting params
FirebaseDynamicLinks.instance.onLink(
onSuccess: (PendingDynamicLinkData dynamicLink) async {
final Uri deepLink = dynamicLink?.link;
print(deepLink);
//https://mydomain.page.link/circleinvite
//not showing params
if (deepLink != null) {
// Navigator.pushNamed(context, deepLink.path);
final queryParams = deepLink.queryParameters;
if (queryParams.length > 0) {
String token = queryParams["token"];
}
}
}, onError: (OnLinkErrorException e) async {
print('onLinkError');
print(e.message);
});
I tried several way but no results. If anyone know the reason please help me.