简体   繁体   English

如何使用Facebook推迟深度链接功能进行新安装,并在将iOS App发布到appStore之前测试相同的功能?

[英]How to use Facebook deferred deep linking feature for new installs and to test the same before publishing iOS App to appStore?

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:// 实现自定义URL,例如myApp://

  2. Added FacebookAppID, display name to my info.plist file 添加了FacebookAppID,显示我的info.plist文件的名称

  3. Included the Facebook SDK 包含Facebook SDK

  4. Created Facebook app link through Facebook mobile hosting API and got the URL something like: https://fb.me/1601524146753610 通过Facebook移动主机API创建Facebook应用程序链接,并获得如下URL: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 在我的AppDelegate.m中实现了以下功能

      - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 
  7. Added the below code in my AppDelegate.m 在我的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 . 另外, 在将iOS APP发布到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. 我已经报告了相同的facebook支持,他们说上面提到的步骤是正确的,以实现延迟深层链接功能。

Also, the same can be tested as follows: 此外,可以测试如下:

  1. Visit https://developers.facebook.com/tools/app-ads-helper 访问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. 在底部,您将在Developer Tools下找到“Deep Link Tester”。 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. 您将在其中测试此设备的设备应安装Facebook应用程序并使用您从app-ads帮助程序发送“延迟深层链接请求”的帐户登录。

Now when you open your app, you should bee able to see your deferred deep link functionality working. 现在,当您打开应用程序时,您应该能够看到延迟的深层链接功能正常工作。

The above steps worked for me. 以上步骤对我有用。

  1. Login to your facebook 登录你的Facebook
  2. Then Click https://developers.facebook.com/tools/app-ads-helper 然后单击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. 在底部,您将在Developer Tools下找到“Deep Link Tester”。
  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. 然后你会收到你的Facebook应用程序的通知。

8.Add bellow keys to your info.plist 8.将波纹管键添加到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 ://......." URL方案像“ testScheme :// .......”

FB app id Like " fb......... " FB app id喜欢“ fb .........

Now we can test 2 cases. 现在我们可以测试2个案例。

  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. 对于第一种情况,安装您的应用程序,然后单击Facebook通知,它被重定向到您的应用程序。

for 2nd case, For new installs 对于第二种情况, 对于新安装

  1. Uninstall your app and Connect your device to xcode 卸载您的应用并将您的设备连接到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 然后点击deeplink facebook通知,它被重定向到appstore,不要从appstore安装,因为你发布的应用没有app深层链接实现

  3. Then you can run app from xcode, once it is installed, it is open your deeplink as 1st case. 然后你可以从xcode运行应用程序,一旦安装它,它将打开你的深层链接作为第一种情况。

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 
            }
        }];
      ...........
}

Additional info: 附加信息:

So you need to deploy the app to the store? 那么你需要将应用程序部署到商店吗? – locoboy Aug 7 '15 at 16:38 - locoboy 2015年8月7日16:38

For testing Deep Link or Deferred Deep Link as they said before me: 用于测试Deep Link或Deferred Deep Link,正如他们在我之前所说:

  • deploy to store not required, use FB Ads panel for testing 部署到不需要的商店,使用FB Ads面板进行测试
  • 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) 检查app安装的统计数据 (不等于零) - 可能是AppEvents (自动记录)不正确(请记住,在统计计算中,可能还有延迟)
  • Install Facebook application for your device, auth in using the same profile that you use to send notifications (run FB app in background) 为您的设备安装Facebook应用程序,使用您用于发送通知的相同配置文件进行身份验证(在后台运行FB应用程序)
  • 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 ) 选择“发送通知”和“发送延迟”复选标记(或仅选中“发送延迟” - 手动应用程序重新安装后结果将可用,并且不要忘记触发器FBSDKAppEvents activateApp
  • Example after successful sending 成功发送后的示例
  • The main objective - after sending the message you will see it in Facebook! 主要目标 - 发送消息后,您将在Facebook上看到它! app notifications, with logo + text "Tap to launch your deep link" 应用通知,带徽标+文字“点按以启动您的深层链接”
  • Tap on notification 点按通知

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

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