Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] AppLinkUtility.fetchDeferredAppLink returns nil url in completion #2368

Open
4 of 5 tasks
pongloongyeat opened this issue Apr 2, 2024 · 4 comments
Open
4 of 5 tasks

Comments

@pongloongyeat
Copy link

pongloongyeat commented Apr 2, 2024

Checklist before submitting a bug report

Xcode version

15.2

Facebook iOS SDK version

main branch

Dependency Manager

Building from Source

SDK Framework

Core

Goals

I'm trying to retrieve deferred deep link

Expected results

When calling AppLinkUtility.fetchDeferredDeepLink after a deferred deeplink has been sent using the App Ads Helper tool, I expect the url in the completion block to not be nil and should match the deeplink I sent.

Actual results

The url in the completion was nil. This was the network call the SDK made ("1043792656902611/activities" via the Graph API) when fetching the deferred deeplink:

POST https://ep1.facebook.com/v17.0/1043792656902611/activities
iOS 17.1.2

# Request
{
  "advertiser_id": "9ABB1466-XXXX-XXXX-XXXX-XXXXXXXXXX",
  "advertiser_id_collection_enabled": 1,
  "advertiser_tracking_enabled": 1,
  "anon_id": "XZ7E0AB6C1-XXXX-XXXX-XXXX-XXXXXXXXXX",
  "application_tracking_enabled": 1,
  "event": "DEFERRED_APP_LINK",
  "extinfo": ...
}

# Response
{
  "success": 1
}

Steps to reproduce

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
        return true
    }

    override func applicationDidBecomeActive(_ application: UIApplication) {
        if #available(iOS 14, *) {
            ATTrackingManager.requestTrackingAuthorization { [weak self] status in
                switch status {
                case .authorized:
                    Settings.shared.isAdvertiserTrackingEnabled = true
                    Settings.shared.isAdvertiserIDCollectionEnabled = true
                    
                    self?.fetchDeferredAppLink()
                default:
                    Settings.shared.isAdvertiserTrackingEnabled = false
                    Settings.shared.isAdvertiserIDCollectionEnabled = false
                }
            }
        } else {
            Settings.shared.isAdvertiserTrackingEnabled = true
            Settings.shared.isAdvertiserIDCollectionEnabled = true
            self.fetchDeferredAppLink()
        }
        
        return super.applicationDidBecomeActive(application)
    }

    func fetchDeferredAppLink() {
        let idfa = ASIdentifierManager.shared().advertisingIdentifier
        print("IDFA: \(idfa)")
        
        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: {
            AppLinkUtility.fetchDeferredAppLink { [weak self] uri, err in
                if let err = err {
                    print("FBSDK_Custom (error): \(err)") // <-- nil
                }
                
                if let uri = uri {
                    print("FBSDK_Custom (uri): \(uri)") // <-- nil
                }
            }
        })
    }
}
  1. Uninstall app
  2. Send deferred deeplink via App Ads Helper.
  3. Install app
  4. Launch app

Code samples & details

No response

@mug1s
Copy link

mug1s commented Jul 3, 2024

Same issue here, error and url is nil always.

@sulizhan
Copy link

sulizhan commented Jan 9, 2025

Same issue, any new information?

@sulizhan
Copy link

Same issue here, error and url is nil always.

I have the same problem, how did you solve it?

@dian00
Copy link

dian00 commented Jan 15, 2025

Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants