简体   繁体   English

Flutter iOS 定制URL方案

[英]Flutter iOS custom URL scheme

I'm using uni_links for deep linking in android and custom url scheme for iOS, i can't configure info.plist to do what i want, it's mentioned in Readme of the package that i need to paste this in info.plist我在 android 中使用uni_links进行深度链接,并为 iOS 使用自定义 url 方案,我无法配置info.plist来做我想做的事情,在 package 的自述文件中提到我需要将其粘贴到info.plist

<?xml ...>
<!-- ... other tags -->
<plist>
<dict>
  <!-- ... other tags -->
  <key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleTypeRole</key>
      <string>Editor</string>
      <key>CFBundleURLName</key>
      <string>[ANY_URL_NAME]</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>[YOUR_SCHEME]</string>
      </array>
    </dict>
  </array>
  <!-- ... other tags -->
</dict>
</plist>

for example my url is https://myurl.com/vs/match/1111例如我的 url 是https://myurl.com/vs/match/1111

the last segment in my url is a match id and it changes so how can implement this in info.plist?我的 url 中的最后一段是一个匹配 ID,它发生了变化,所以如何在 info.plist 中实现它?

You can configure the iOS project's Associated Domains and URL Schemes through the Info.plist editor on Xcode, similar to how it's demonstrated on this guide .您可以通过 Xcode 上的 Info.plist 编辑器配置 iOS 项目的关联域和 URL 方案,类似于本指南中的演示方式。 Then to match the URL you've provided, the root domain needs to be configured as an Associated Domain for the app to handle it as a Universal Link.然后,为了匹配您提供的 URL,需要将根域配置为关联域,以便应用程序将其作为通用链接处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM