【问题标题】:ios app URL scheme for facebookfacebook 的 ios 应用程序 URL 方案
【发布时间】:2015-01-22 11:35:02
【问题描述】:

我想通过 FB 分享我的应用 URL。假设 url 方案设置为“www.myapp.com”,在这种情况下,我的 URL 字符串将是“www.myapp.com://?myParam=123”。

问题是,fb 应用会在应用本身中打开此 URL,并将 URL 更改为“www.myapp.com/?myParam=123”。

【问题讨论】:

  • 您在 Facebook 上的分享情况如何(通过 API?状态更新?分享对话框?)?您应该查看应用链接 - applinks.org
  • SLComposeViewController 的 addURL 方法
  • 这将只允许您共享 http/https url,而不是自定义方案。

标签: ios iphone facebook-ios-sdk


【解决方案1】:

对于其他寻找这个的人,我使用了 UIActivityViewController,并使用“excludedActivityTypes”属性从共享选项中删除了 facebook 和 twitter。

UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@

                                            [[NSString stringWithFormat:@"iOS: %@",[NSURL URLWithString:[NSString stringWithFormat:@"www.abc.in://?shareid=%@", _stateManagerShared.shareID]]],

                                             [NSString stringWithFormat:@"Android: %@",[NSURL URLWithString:[NSString stringWithFormat:@"www.abc.in/shareid=%@", _stateManagerShared.shareID]]]]

                                                                             applicationActivities:nil];

    activityVC.excludedActivityTypes = @[UIActivityTypePostToFacebook, UIActivityTypePostToTwitter];

    [self presentViewController:activityVC animated:YES completion:nil];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-20
    • 2014-03-20
    相关资源
    最近更新 更多