Facebook iOS SDK - How can I make a Page Like Button works?

Chris So

I am trying to use FBSDKLikeControl / FBSDKLikeButton to let users like my Fan Page.

I tried in their sample code and it works on any Fan Pages. However, when I change the FacebookAppID into mine, it breaks. When I click the Like Button, the app navigates me to Facebook app and then switches back immediately.

- (void)viewDidLoad
{
  [super viewDidLoad];

  self.pageLikeControl.likeControlAuxiliaryPosition = FBSDKLikeControlAuxiliaryPositionBottom;
  self.pageLikeControl.likeControlHorizontalAlignment = FBSDKLikeControlHorizontalAlignmentCenter;
    self.pageLikeControl.objectID = @"burgerking";

}

plist file settings: plist file settings When I change above URL Schemes and FacebookAppID, the like function will fail.

Is it a permission problem on my app setting? I have not submitted any items to review yet as such login permission("public_actions").

Many Thanks!

hpDev_iOS

Yes, You have to register your app with Facebook Developer and for now u no need to review your iOS app to Facebook as its in developing mode.

As u register your app with Facebook you will get instruction how to config your .plist of iOS app for connect with facebook.

Example Code :

FBSDKLikeControl *button = [[FBSDKLikeControl alloc] init];
button.objectID = @"https://www.facebook.com/FacebookDevelopers";
[self.view addSubview:button];

In the above code u just have to replace button.objectID Value with your Facebook post/page URL. I hope this will be Help full to u.

For More Refer : https://developers.facebook.com/docs/sharing/ios

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to make an action button which takes user to Facebook app in iOS?

분류에서Dev

How can I make a functioning animated button?

분류에서Dev

How can I subscribe to a page's updates on Facebook?

분류에서Dev

how to login with facebook with custom login button using facebook sdk

분류에서Dev

How can I make two iframes fit the width of the page?

분류에서Dev

How can i get user information from Latest Facebook sdk-4.0.1

분류에서Dev

IOS Swift and Facebook SDK

분류에서Dev

How to make theme button affect whole page

분류에서Dev

How can I make a c# https web request that works in both proxy and no proxy situations

분류에서Dev

How can I automatically scrape new information from page with Facebook open graph API

분류에서Dev

I would like to make my menu bar scroll with the page

분류에서Dev

How can I make text that looks like a link run a controller function when clicked?

분류에서Dev

Make a Facebook Like Box responsive

분류에서Dev

How can I make a function run only when I reload the page with angular?

분류에서Dev

How to make a Widget change color briefly like a button

분류에서Dev

How can I wire up a button on my page so that it is clicked when a user presses enter?

분류에서Dev

How can I make Xamarin show the hamburger icon rather than the back button?

분류에서Dev

How can I make appear a remove button on every LI in a Todo List?

분류에서Dev

How can I make a Chrome Extension open an external page instead of the defualt popup.html

분류에서Dev

How can I trigger a YouTube video to play in browser on iOS by clicking on a play button instead of the embed?

분류에서Dev

where can I find matrix like chart for ios frameworks

분류에서Dev

how to make a button go from MainActivity page to another (Android)

분류에서Dev

Can someone explain to me how a closure works? (Swift iOS)

분류에서Dev

Facebook & Twitter Like Buttons Slowing Page Load

분류에서Dev

How can I change button value with stylish?

분류에서Dev

jQuery - How I can reset the html() of this button?

분류에서Dev

How can I place a checkbox within a button?

분류에서Dev

iOS Facebook SDK 오류 언어

분류에서Dev

iOS의 Facebook SDK 오류 2`

Related 관련 기사

  1. 1

    How to make an action button which takes user to Facebook app in iOS?

  2. 2

    How can I make a functioning animated button?

  3. 3

    How can I subscribe to a page's updates on Facebook?

  4. 4

    how to login with facebook with custom login button using facebook sdk

  5. 5

    How can I make two iframes fit the width of the page?

  6. 6

    How can i get user information from Latest Facebook sdk-4.0.1

  7. 7

    IOS Swift and Facebook SDK

  8. 8

    How to make theme button affect whole page

  9. 9

    How can I make a c# https web request that works in both proxy and no proxy situations

  10. 10

    How can I automatically scrape new information from page with Facebook open graph API

  11. 11

    I would like to make my menu bar scroll with the page

  12. 12

    How can I make text that looks like a link run a controller function when clicked?

  13. 13

    Make a Facebook Like Box responsive

  14. 14

    How can I make a function run only when I reload the page with angular?

  15. 15

    How to make a Widget change color briefly like a button

  16. 16

    How can I wire up a button on my page so that it is clicked when a user presses enter?

  17. 17

    How can I make Xamarin show the hamburger icon rather than the back button?

  18. 18

    How can I make appear a remove button on every LI in a Todo List?

  19. 19

    How can I make a Chrome Extension open an external page instead of the defualt popup.html

  20. 20

    How can I trigger a YouTube video to play in browser on iOS by clicking on a play button instead of the embed?

  21. 21

    where can I find matrix like chart for ios frameworks

  22. 22

    how to make a button go from MainActivity page to another (Android)

  23. 23

    Can someone explain to me how a closure works? (Swift iOS)

  24. 24

    Facebook & Twitter Like Buttons Slowing Page Load

  25. 25

    How can I change button value with stylish?

  26. 26

    jQuery - How I can reset the html() of this button?

  27. 27

    How can I place a checkbox within a button?

  28. 28

    iOS Facebook SDK 오류 언어

  29. 29

    iOS의 Facebook SDK 오류 2`

뜨겁다태그

보관