5

Everything is ok when I'm using Facebook App Ads Helper – Deep Link Tester. Application will be downloaded from the App Store, URL will be fetched and handled correctly.

But if I try to test it from my real Facebook Ad, application will be also downloaded from the App Store, but the fetched URL is always nil.

In situation when application is already installed on the device, URL will be correctly passed to my app and handled.

In the application delegate method I am fetching deferred deep link like that:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    //Another code
    FBSDKAppLinkUtility.fetchDeferredAppLink({ (URL, error) -> Void in
        if error != nil {
            //Handle error
        }
        if URL != nil {
            application.openURL(URL)
        }
    })
    return true
}

func application(application: UIApplication, openURL URL: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
    let result = self.handleURL(URL)
    return result
}

I checked all installation guidelines several times, it seems that everything is ok.

is there any idea?

Aist Marabu
  • 169
  • 2
  • 9

1 Answers1

3

It seems that's everything is ok and it is my mistake in testing of the deep links. I tested it via Ad Preview, that didn't track user footprint. So Facebook deep links are working correctly now, we confirmed it by Mixpanel analytics.

Aist Marabu
  • 169
  • 2
  • 9
  • I'm facing the exact same issue. How did you solve this? And what exactly do you mean with 'Ad Preview, that didn't track user footprint.'? – roelvogel Jan 11 '16 at 14:07
  • @user1819347 I didn't change anything in code, everything was ok. The problem was in testing of deep links. When you create new ad in Facebook there is an option to see how an ad will look on your device (Ad Preview). So, I tested deep links via Ad Preview and unfortunately deep links don't work that way, Facebook doesn't track device footprint when user tap on your "Install" button, that's why URL was always nil. So deep links will work properly in production mode when user will see your real ad in Facebook app. – Aist Marabu Jan 12 '16 at 08:56