18

I have done some exploration and have found the following things, this is what I have done so far:

  1. Implemented custom URL, like myApp://

  2. Added FacebookAppID, display name to my info.plist file

  3. Included the Facebook SDK

  4. Created Facebook app link through Facebook mobile hosting API and got the URL something like: https://fb.me/1601524146753610

  5. Used the above URL as deep link while creating app-install Ads.

  6. Implemented the below function in my AppDelegate.m

     - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    
  7. Added the below code in my AppDelegate.m

    //Initialization
    [FBAppEvents activateApp];
    [FBSettings setClientToken:@"ca45a3a2133ae2f37ebd4d90408816e6"];
    
    //Function to check for deferred deep link and call the method with recieved url
    [FBSDKAppLinkUtility fetchDeferredAppLink:^(NSURL *url,NSError *error){
    if(url)
    [self application:nil openURL:url sourceApplication:nil annotation:nil];
    }];
    

    Please let me know if i have missed something in fetching deferred deep link.
    Also, how can I test the same before publishing my iOS APP to appStore.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Shobhit Srivastava
  • 501
  • 1
  • 6
  • 16

3 Answers3

13

I had reported the same facebook support and they said that above mentioned steps were correct in order to implement the deferred deep link functionality.

Also, the same can be tested as follows:

  1. Visit https://developers.facebook.com/tools/app-ads-helper

  2. Select your app and hit 'Submit'.

  3. At the bottom you will find 'Deep Link Tester' under Developer Tools. Hit 'Test Deep Link' and in the dialog you can enter your deep link to test.

  4. If you want to verify deferred links then check 'Send Deferred' in the dialog.

So, after doing this you need to uninstall the app(if already present) and then install again from the app store. The device in which you will be testing this should have facebook app installed and logged in with the account from which you had sent the "deferred deep link request" from app-ads helper.

Now when you open your app, you should bee able to see your deferred deep link functionality working.

The above steps worked for me.

Shobhit Srivastava
  • 501
  • 1
  • 6
  • 16
  • So you need to deploy the app to the store? – locoboy Aug 07 '15 at 16:38
  • @locoboy no, you just need to integrate your app with your Facebook account. – Shobhit Srivastava Aug 12 '15 at 04:09
  • A couple additional notes from the team at https://branch.io: 1. Deferred deep linking from App Invites on iOS do not work. 2. Test install ads in the ad builder do not trigger deferred deep links 3. Live ads from your account will not trigger deferred deep links. 4. Make sure you are testing with the phone logged into Facebook with the account associated with the app – Alex Austin Sep 06 '15 at 02:32
  • 1
    Another note -- while ads may work, clicks on regular news feed posts do not result in data being retrieved in the deferred scenario. So ads deep link through install, but your users' organic shares do not :( – st.derrick Mar 10 '16 at 02:22
  • 1
    So far, Test Deep Link tool in app-ads-helper will always work, but not with real process for me. (entering app install from invite in notification bar, lauch app, etc) I have setup another thread on this. http://stackoverflow.com/questions/38238491/ – Wappenull Jul 07 '16 at 06:10
  • 4
    'So you need to deploy the app to the store?' Actually, in Test Deep Link tool, you dont have to do real publish on store, just click on notification it sends you, then switch out and install the app somehow (xcode or APK). And deferred applink will be on your first app launch somehow. – Wappenull Jul 07 '16 at 06:10
  • August 2016 and this is still the case. Deep link tester seems to work as expected for unreleased apps, but the test install ads from ad manager done. – Keab42 Aug 26 '16 at 09:09
  • @AlexAustin You said `3. Live ads from your account will not trigger deferred deep links`. How can we test deferred deep links then? – Vadim Kotov Nov 26 '19 at 14:29
  • @ShobhitSrivastava: How to integrate your app to facebook account – Abhi Aug 09 '23 at 06:27
  • @wappenull : what does this statement means and what are the steps to achieve this statement: "install the app some how" – Abhi Aug 09 '23 at 06:30
  • @Abhi I'm not sure I can help on very old issue, that was 7y ago, API on both FB and iOS might already drastically changed and I'm not working on project related to them anymore. From what I can remembered, my objective back then was to get the mobile app install report of the user who clicked from Facebook ads of your and actually installed the app, to appear on FB analytic backend by help of deep link. The statement which I replied the comment back then asked if "Do I need to actually submit the app to actual store?" I said no and you can install the app by any method, like via xcode or APK. – Wappenull Aug 19 '23 at 10:23
9
  1. Login to your facebook
  2. Then Click https://developers.facebook.com/tools/app-ads-helper
  3. Select an app you want to test from drop down
  4. Hit submit
  5. At the bottom you will find 'Deep Link Tester' under Developer Tools.
  6. Hit 'Test Deep Link' and in the dialog you can enter your deep link.
  7. Select both 'Send Notification' and 'Send Deferred' check marks.

    Then you will get a notification to your facebook app.

8.Add bellow keys to your info.plist

<key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>**Your URL Scheme** </string>
                    <string>**Your FB app id** </string>
                </array>
            </dict>
        </array>

URL scheme Like "testScheme://......."

FB app id Like "fb........."

Now we can test 2 cases.

  1. app already install in your device with deferred link implementation

  2. New install

for 1st case, install your app and then click facebook notification, it is redirected to your app.

for 2nd case, For new installs

  1. Uninstall your app and Connect your device to xcode

  2. Then click deeplink facebook notification, it is redirected to appstore, don't install from appstore because your published app doesn't have app deep link implementation

  3. Then you can run app from xcode, once it is installed, it is open your deeplink as 1st case.

Thats it....

Note: don't forgot to implement

- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppLinkUtility fetchDeferredAppLink:^(NSURL *url,NSError *error){
            if(url)
            {
                // redirect to where you want 
            }
        }];
      ...........
}
PVCS
  • 3,831
  • 1
  • 16
  • 10
2

Additional info:

So you need to deploy the app to the store? – locoboy Aug 7 '15 at 16:38

For testing Deep Link or Deferred Deep Link as they said before me:

  • deploy to store not required, use FB Ads panel for testing
  • check just in case statistic for app installs (not equal zero) - may be AppEvents (automatically logged) doesn't work correct (keep in mind, in the calculation of statistics, there may also be a delay)
  • Install Facebook application for your device, auth in using the same profile that you use to send notifications (run FB app in background)
  • Select both 'Send Notification' and 'Send Deferred' check marks (or check only 'Send Deferred' - results will available after manual app reinstall, and don't forgot trigger FBSDKAppEvents activateApp)
  • Example after successful sending
  • The main objective - after sending the message you will see it in Facebook! app notifications, with logo + text "Tap to launch your deep link"
  • Tap on notification
av-k
  • 142
  • 1
  • 5