在路径(对象)和“属性”中发现og:type冲突

时间:2019-02-28 07:21:54

标签: facebook-opengraph facebook-ios-sdk

Facebook分享对话。
平台:iOS,Android。

2-3周前,一切正常,但今天我无法正常显示分享对话。发生错误:conflicting og:type found in path (object) and 'properties' (games.victory)

https://monosnap.com/file/XTbGqcbIKaQOGxb93G2LiDmdI1Qu3g 在路径(对象)和“属性”(games.victory)中发现的og:type冲突 发生了什么变化?该如何解决?

这是iOS的示例:

NSDictionary * properties =
@{
  @"fb:app_id" : @"123456789",
  @"og:type" : @"games.victory",
  @"og:title" : @"Some title",
  @"og:description" : @"A message",
  @"og:url" : @"http://link.to.app.com",
  @"og:image" : @"https://link.to.image.png"
  };

    FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

    FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
    [action setObject:object forKey:@"victory"];
    action.actionType = @"games.celebrate";

    FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
    content.action = action;
    content.previewPropertyName = @"victory";

    FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];

    shareDialog.mode = FBSDKShareDialogModeWeb;
    shareDialog.delegate=self;
    shareDialog.fromViewController = UnityGetGLViewController();
    shareDialog.shareContent = content;
    [shareDialog show];

0 个答案:

没有答案