代码:
void _createLink() async {
final DynamicLinkParameters parameters = DynamicLinkParameters(
uriPrefix: 'https://example.page.link',
link: Uri.parse('https://www.example.com'),
androidParameters: AndroidParameters(packageName: 'com.example.packageid', minimumVersion: 1),
);
final Uri dynamicUrl = await parameters.buildUrl();
print("$dynamicUrl"); // prints on console
final ShortDynamicLink shortDynamicLink = await parameters.buildShortLink(); // never finishes
final Uri shortUrl = shortDynamicLink.shortUrl;
print("$shortUrl"); // never prints
}
问题:
buildShortLink()
永远不会完成,它将永远存在。我不确定自己在做什么错。