I have done some exploration and have found the following things, this is what I have done so far:
Implemented custom URL, like myApp://
Added FacebookAppID, display name to my info.plist file
Included the Facebook SDK
Created Facebook app link through Facebook mobile hosting API and got the URL something like: https://fb.me/1601524146753610
Used the above URL as deep link while creating app-install Ads.
Implemented the below function in my AppDelegate.m
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
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.
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:
Visit https://developers.facebook.com/tools/app-ads-helper
Select your app and hit 'Submit'.
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.
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.
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.
app already install in your device with deferred link implementation
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
Uninstall your app and Connect your device to xcode
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
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
}
}];
...........
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With