最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

expo - How to open a deeplink from react native with Native Siri ShortCut - Stack Overflow

programmeradmin16浏览0评论

I've already managed to create the voice shortcut with Siri. It opens the app, but I can't direct it to a specific route like a deeplink or at least identify that it was requested through Siri.

func criarAtalho() {
      let activity = NSUserActivity(activityType: "com.rnf.heyofficer://startTransmission")
      activity.title = "Estou sendo abordado"
      activity.userInfo = ["action": "transmission"]
      activity.isEligibleForSearch = true
      activity.isEligibleForPrediction = true

      let shortcut = INShortcut(userActivity: activity)

      // Exibe a interface para adicionar o atalho de voz
      DispatchQueue.main.async {
          if let rootVC = UIApplication.shared.windows.first?.rootViewController {
              let vc = INUIAddVoiceShortcutViewController(shortcut: shortcut)
              vc.delegate = self
              rootVC.present(vc, animated: true, completion: nil)
          }
      }
  }

I am using React Native with Expo but with prebuild. How can I identify that it was called through Siri or get the deeplink to adjust a route?

I have tried several ways as suggested by ias but nothing helps.

发布评论

评论列表(0)

  1. 暂无评论