我如何在我的flutter应用程序中为另一个应用程序启动深层链接URL

发布于 2025-01-25 10:00:16 字数 229 浏览 1 评论 0原文

我的Flutter应用程序允许用户在个人资料中链接其其他社交媒体平台。当另一个用户在应用中查看其配置文件并单击其中一个链接时,我希望该应用显示一个警报,说“在 app name 中打开?”然后使用DeepLink直接打开应用程序,而不是首先启动Safari。一个例子是Tiktok,您可以在其中转到个人资料并单击他们的Instagram,它将直接进入Instagram个人资料。使用用户提供的深层链接,如何在颤抖中进行此操作?

My flutter app allows users to link their other social media platforms in their profile. When another user views their profile in the app and clicks one of those links, I want the app to show an alert saying “open in app name?” and then use the deeplink to open the app directly instead of launching safari first. An example of this is tiktok where you can go to a profile and click their instagram and it will take you straight to the instagram profile. How can I do this in flutter using the deep links provided by users?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷迭香的记忆 2025-02-01 10:00:16

您可以使用 https://pub.dev/packages/external_app_app_launcher
您的代码必须这样

await LaunchApp.openApp(
    androidPackageName: 'net.pulsesecure.pulsesecure',
    iosUrlScheme: 'pulsesecure://',
    appStoreLink: 'itms-apps://itunes.apple.com/us/app/pulse- 
    secure/id945832041',
);

you can use https://pub.dev/packages/external_app_launcher
your code has to be like this

await LaunchApp.openApp(
    androidPackageName: 'net.pulsesecure.pulsesecure',
    iosUrlScheme: 'pulsesecure://',
    appStoreLink: 'itms-apps://itunes.apple.com/us/app/pulse- 
    secure/id945832041',
);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文