ios-branch-deep-linking-attribution icon indicating copy to clipboard operation
ios-branch-deep-linking-attribution copied to clipboard

Branch io is not giving the values if we open the link from Instagram or messenger when my app is in killed state

Open MandeepSingh1 opened this issue 3 years ago • 2 comments

I have check all the issues which is already reported. But its not helping at my end.

I share the link of Branch io with my friend on Instagram, Facebook Messenger. When I tap on that link its open my app. But am not able to get any value from initSession.

here is my didFinishLaunchingWithOptions code.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    FirebaseApp.configure()
    self.registerForPushNotifications()
    UIApplication.shared.applicationIconBadgeNumber = 0

    // Override point for customization after application launch.
    self.initMediaForSilentMode()
    
    BranchScene.shared().initSession(launchOptions: launchOptions, registerDeepLinkHandler: { (params, error, scene) in
        
        if error == nil {
            self.branchSessionHandling(params)
        } else {
            SwiftAlert.show(Shared.scene?.window?.rootViewController, title: "error", message: error?.localizedDescription ?? "")
        }
    })

    return true
}

Same Link I Share through Whatsapp, iMessage, Signal.

When my application is in Killed State, Still branch io is giving me the values so am not able to understand what's the issue if my code isn't working or I have done something wrong. Then it shouldn't work for other Apps like whatsapp, signal, iMessage.

Am not sure what am doing wrong. Can Anybody help me.

func generateLink(model: FeedData) {

    let buo = BranchUniversalObject.init(canonicalIdentifier: "content/12345")
    buo.title = model.title
    buo.contentDescription = model.description
    buo.imageUrl = model.fullImage ?? model.thumbnail
    buo.publiclyIndex = true
    buo.locallyIndex = true
    buo.contentMetadata.customMetadata[Keys.postId] = model.id
    buo.contentMetadata.customMetadata[Keys.shareType] = "Post"

    let linkProperties: BranchLinkProperties = BranchLinkProperties()
    linkProperties.feature = "share"
    linkProperties.channel = "facebook"
    linkProperties.addControlParam("$email_subject", withValue: "My New Art")
    let message = "Check out this Art."
    
    buo.showShareSheet(withShareText: message) { (response, status) in
        //            print(response, status)
    }
}

Above is the function to generate the link.

MandeepSingh1 avatar Jul 29 '21 06:07 MandeepSingh1

I met the same problem like yours, have you fixed this?

GuoYongming avatar Jul 28 '22 04:07 GuoYongming

Hi all,

Depending on the platform, FB Messenger, IG, etc, Branch's smart link systems uses different methods to open the app given certain platforms have preventative measures to prevent users from leaving their app. I would ensure you have the proper relays on openURL and continueUserActivity

jf-branch avatar Aug 04 '22 14:08 jf-branch