Branch.io 链接Facebook问题



我实现了 branch.io 链接,它适用于WhatsApp和Notes,但不适用于Facebook Messenger或任何其他带有应用内浏览器的地方。

根据文档:

要解决此限制,您的链接必须启用深度视图或类似功能,并带有一个号召性用语链接/按钮,该链接/按钮后面有一个通用链接。这样,单击应用源中的链接将打开包含 deepview 页面的 Web 视图,然后用户可以单击链接/按钮来启动您的应用。

例如,Facebook Messenger 应该打开应用程序内浏览器,并深入查看我的链接,如果用户点击按钮 - 我的应用程序应该打开,这对我来说很好,但不能像这样工作。

就我而言,facebook 正在使用我的 deepview 打开应用内浏览器并自动(我没有点击按钮(将我重定向到......应用商店:(。但是,如果我手动打开我的应用程序,我会收到回调,并且应用程序正在将我重定向到正确的位置。

建议对在Facebook上共享的链接使用强制重定向,因为通用链接有条件地工作。您可以通过将$uri_redirect_mode=2作为查询参数附加到您的 Branch 链接来强制 Facebook 打开您的应用。

例如:https://example.app.link/83jlowd0?$uri_redirect_mode=2

您可以在此处了解有关强制重定向的更多信息- https://docs.branch.io/pages/links/integrate/#forced-redirections

如果您仍然遇到问题,请写信给 support@branch.io,分公司团队的人员将能够为您提供帮助。

我有同样的问题。 从 SDK 返回 Branch.io 分支对象返回一个没有所有参数的对象。 我所做的只是遵循 Branch.io 提供的伟大文档 文件由 Branch.io 提供

因此,当我在我的应用程序中使用场景时,在我的场景中调用这些方法委托解决了这个问题。

import UIKit
import Branch
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
// workaround for SceneDelegate continueUserActivity not getting called on cold start
if let userActivity = connectionOptions.userActivities.first {

BranchScene.shared().scene(scene, continue: userActivity)
}
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
BranchScene.shared().scene(scene, continue: userActivity)
}
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
BranchScene.shared().scene(scene, openURLContexts: URLContexts)
}
}

最新更新