FBLikeControl does not load nor function

后端 未结 4 1471
日久生厌
日久生厌 2021-01-21 04:13

With the new release of facebook ios sdk, the documentation is talking about the facebook like control, that allows to like a page. https://developers.facebook.com/docs/ios/like

相关标签:
4条回答
  • 2021-01-21 04:43

    Mawoon answered worked for me. Thank you sir.

    Usage example:

    [FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
    [FBSettings enablePlatformCompatibility:NO];
    
    FBLikeControl *like = [[FBLikeControl alloc] init];
    like.frame = CGRectMake(itemX, itemY, 60, 20);
    like.likeControlStyle = FBLikeControlStyleButton;
    like.objectID = @"http://shareitexampleapp.parseapp.com/photo1/";
    

    For some reason I'm not being able to set the 'size' of the like button, also changing the value of the likeControlStyle is not yielding any results, could be because its still a preview feature.

    0 讨论(0)
  • 2021-01-21 04:46

    As mentioned here its currently only preview feature, please check screenshot. My best guess is you may not have enabled developers in Facebook applications you created through app page.

    enter image description here

    0 讨论(0)
  • 2021-01-21 04:48

    You can not change the size of button because its standard button provided by fb but you can use button style using below code:

    Here is the complete code:

    [FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
    [FBSettings enablePlatformCompatibility:NO];
    FBLikeControl *like = [[FBLikeControl alloc] init];
    like.objectID = @"http://shareitexampleapp.parseapp.com/photo1/";
    like.likeControlHorizontalAlignment=FBLikeControlHorizontalAlignmentRight;
    like.likeControlStyle=FBLikeControlStyleBoxCount;
    [self.view addSubview like];
    
    0 讨论(0)
  • 2021-01-21 05:01

    You can use FBlikeControl button by enabling below feature in viewdidload or where you create FBlikeControl button:

    [FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
    [FBSettings enablePlatformCompatibility:NO];
    
    0 讨论(0)
提交回复
热议问题