收藏
回答

iOS 从App拉起微信小程序失败?

Failed to open URL weixin://app/xxxxx/jumpWxa/?xxxxxxx: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.tencent.xin" failed." UserInfo={BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x283d64990 {Error Domain=FBSOpenApplicationErrorDomain Code=3 "Application xxx is neither visible nor entitled, so may not perform un-trusted user actions." UserInfo={BSErrorCodeDescription=Security, NSLocalizedFailureReason=Application com.xxx.xxx is neither visible nor entitled, so may not perform un-trusted user actions.}}, NSLocalizedDescription=The request to open "com.tencent.xin" failed., FBSOpenApplicationRequestID=0x7374, NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace) for reason: Security ("Application com.xxx.xxx is neither visible nor entitled, so may not perform un-trusted user actions").}

手机型号:iPhone 11 Pro max

版本:16.6

现象:

每次跳转 都是正在连接后 回到App。


最后一次编辑于  2023-08-18
回答关注问题邀请回答
收藏

3 个回答

  • 社区技术运营专员--阳光
    社区技术运营专员--阳光
    2023-08-21

    1.  微信唤起App,App一定会收到系统回调。请确认系统回调是Scheme回调还是Universal Links回调。

    2. 如果是Scheme回调,请检查是否走了UISceneDelegate(XCode11构建的项目),或是UIApplicationDelegate。它们的回调方法分别是:

    - (void)scene:(UIScene *)scene openURLContexts:(NSSetUIOpenURLContext *> *)URLContexts;

    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionaryUIApplicationOpenURLOptionsKey, id> *)options;

    3. 如果是Universal Links回调,同样也检查是否走了UISceneDelegate(XCode11构建的项目),或是UIApplicationDelegate。它们的回调方法分别是

    - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity

    - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArrayidUIUserActivityRest oring>> * __nullable restorableObjects))restorationHandler

    4.因为考虑兼容旧版本微信,因此无论Scheme或Universal Links回调都必须处理。 在重写回调方法后,需要分别调用WXApi的handleOpenUrl和handleOpenUniversalLink方法

    2023-08-21
    有用
    回复 3
    • Alexander William G
      Alexander William G
      发表于移动端
      2023-08-21
      多谢
      2023-08-21
      回复
    • atom.huจุ๊บ
      atom.huจุ๊บ
      2023-08-23
      //
      // AppDelegate.swift
      // QuickMiNI
      //
      //


      import Foundation
      import UIKit


      class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
          
          var window: UIWindow?
          
          func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
              print("WX Api init")
              WXApi.registerApp("111", universalLink: "/")
              return true
          }
          
          func application(_application:UIApplication, handleOpen url:URL) ->Bool{
              return WXApi.handleOpen(url, delegate:self)
          }
          
          
          func application(_ _app:UIApplication, open url:URL, options: [UIApplication.OpenURLOptionsKey:Any] = [:]) ->Bool{
              let urlKey: String = options[UIApplication.OpenURLOptionsKey.sourceApplication] as! String
              if urlKey == "com.tencent.xin" {
                  // 微信 的回调
                  return WXApi.handleOpen(url, delegate: self)
              }
              return true
          }
          
          func application(_application:UIApplication, continue userActivity:NSUserActivity, restorationHandler:@escaping([UIUserActivityRestoring]?) ->Void) ->Bool{
              return WXApi.handleOpenUniversalLink(userActivity, delegate:self)
          }
      }

      我已经这样实现了,为什么还是有问题呢
      2023-08-23
      回复
    • atom.huจุ๊บ
      atom.huจุ๊บ
      2023-08-23
      2023-08-23
      回复
  • ℳ๓王ζั℘
    ℳ๓王ζั℘
    03-08

    2个代理方法都实现了 ,还是有这个问题,打开微信后,显示正在连接,然后就又回到APP了

    03-08
    有用
    回复
  • atom.huจุ๊บ
    atom.huจุ๊บ
    2023-08-19

    蹲一下,我也有这个问题

    2023-08-19
    有用
    回复 2
    • Alexander William G
      Alexander William G
      发表于移动端
      2023-08-21
      上面回复我的能解决,两个handle方法都实现下
      2023-08-21
      回复
    • atom.huจุ๊บ
      atom.huจุ๊บ
      2023-08-23回复Alexander William G
      2023-08-23
      回复
登录 后发表内容