We have a live game on the iOS app store, and I'm currently adding some Facebook integration. I'm trying to test deep linking with app requests, but the recipient side won't launch my locally built app; instead, it goes to the app's page on the app store. What do I need to change (FB app settings? Xcode build settings?) to get this to work? I can only assume it's possible...
EDIT: should mention I'm using the latest SDK (3.7.1), building against iOS 6.1.
EDIT 2: short of taking a screenshot and blacking a bunch of stuff out, I'll describe how my FB app config is set up:
In Settings -> Basic
, I only have data filled out of Native iOS App
, which includes the Bundle ID
(that matches the ID Xcode is building the app with), iPhone/iPad App Store ID
(matches the live app in the store), Facebook Login
and Deep Linking
are both enabled, and URL Scheme Suffix
is empty. The app is also in Sandbox Mode
. In Settings -> Permissions
, I have publish_actions
(in User & Friend Permissions
) and publish_stream
(in Extended Permissions
). I think everything else is vanilla.
In the project plist, the Bundle identifier
is the same as described in the FB app settings. The only possible discrepancy is the FacebookAppID
in the plist does not match this particular Facebook test app that I'm working with... I don't think that should matter but it's worth mentioning.
As far as actually sending the request, code is as follows:
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:message
title:nil
parameters:nil
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
// handle response
}];
I do this earlier on also, to decide which FB app to connect to:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
#if GO_TO_TEST_APP
NSString *fbAppId = [dict objectForKey:@"TestFacebookAppID"];
#else
NSString *fbAppId = [dict objectForKey:@"FacebookAppID"];
#endif
NSAssert(fbAppId, @"Failed to get Facebook app id from plist file!");
[FBSettings setDefaultAppID:fbAppId];
Again, the request does get sent correctly (although I am seeing the same problem as is being seen here when the dialog pops up), and I can see the request on the recipient's Facebook acct; it's just the redirect doesn't pick up on the fact that I have the app already installed on the device (albeit built locally with Xcode).
Tommy above is right; I needed to adjust URL types -> Item 0 -> URL Schemes
in my Info.plist
file to include the FB scheme for the new test app I'm trying to connect to (in the form of fb<Facebook App ID>
. I already have the one for the live FB app; I just didn't realize that configuration step existed.