简体   繁体   English

Facebook iOS应用程序请求不启动本地构建的应用程序

[英]Facebook iOS app requests not launching locally built app

We have a live game on the iOS app store, and I'm currently adding some Facebook integration. 我们在iOS应用商店上提供了一个现场游戏,我目前正在添加一些Facebook集成。 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? 为了使此功能生效,我需要更改什么(FB应用程序设置?Xcode构建设置?)? I can only assume it's possible... 我只能认为这是可能的...

EDIT : should mention I'm using the latest SDK (3.7.1), building against iOS 6.1. 编辑 :应该提到我正在使用最新的SDK(3.7.1),针对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: 编辑2 :除了拍摄屏幕快照并涂黑一堆东西之外,我将介绍如何设置FB应用程序配置:

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. Settings -> Basic ,我仅填写了Native iOS App ,其中包括Bundle ID (与用于构建应用程序的Xcode Bundle ID匹配), iPhone/iPad App Store ID (与iPhone/iPad App Store ID中的实时应用程序匹配) ,同时启用了Facebook LoginDeep Linking ,并且URL Scheme Suffix为空。 The app is also in Sandbox Mode . 该应用程序也处于Sandbox Mode In Settings -> Permissions , I have publish_actions (in User & Friend Permissions ) and publish_stream (in Extended Permissions ). Settings -> Permissions ,我有publish_actions (在“ User & Friend Permissions )和publish_stream (在“ 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. 在项目plist中, Bundle identifier与FB应用程序设置中所述的Bundle identifier相同。 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. 唯一可能的差异是FacebookAppID在plist中不匹配,我与......我不认为应该的问题,该工作实特别测试应用程序,但它是值得一提。

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: 我还将在前面进行此操作,以确定要连接到哪个FB应用程序:

    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; 同样,该请求确实得到正确发送(尽管我看到的是与弹出对话框时在这里看到的相同的问题),并且可以在收件人的Facebook帐户上看到该请求; 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). 我已经在设备上安装了该应用程序(尽管它是使用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. 我需要调整Info.plist文件中的URL types -> Item 0 -> URL Schemes ,以包括我要连接的新测试应用程序的FB方案(以fb<Facebook App ID> 。已经有一个用于实时FB应用程序的应用程序;我只是不知道存在配置步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM