FBLikeControl callback
Update:
Since Facebook apparently made this header private, you now have to subscribe directly to the notification using a raw string:
[[NSNotificationCenter defaultCenter] addObserver:myObject selector:@selector(myCallback:) name:@"FBLikeActionControllerDidUpdateNotification"];
Old answer for reference:
For anyone in the future looking for this: I ended up subscribing myself to FBLikeActionControllerDidUpdateNotification notifications. Once the notification is received you can do the following:
if ([notification.object isKindOfClass:[FBLikeActionController class]]) {
if ([(FBLikeActionController*)notification.object objectIsLiked]) {
// do your stuff here, user liked!
}
}
FBLikeControl callback
Update:
Since Facebook apparently made this header private, you now have to subscribe directly to the notification using a raw string:
[[NSNotificationCenter defaultCenter] addObserver:myObject selector:@selector(myCallback:) name:@"FBLikeActionControllerDidUpdateNotification"];
Old answer for reference:
For anyone in the future looking for this: I ended up subscribing myself to FBLikeActionControllerDidUpdateNotification notifications. Once the notification is received you can do the following:
if ([notification.object isKindOfClass:[FBLikeActionController class]]) {
if ([(FBLikeActionController*)notification.object objectIsLiked]) {
// do your stuff here, user liked!
}
}
FBSDKLikeButton callback in swift facebook SDK v4.21.0
Well, did it by parsing the url in:
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
}
fb{app-id}://bridge/like?version=web&bridge_args=%7B%22app_name%22%3A%22AAP-NAME%22%2C%22action_id%22%3A%22B0B73D93-6434-4FF0-A300-00B0A7E470BE%22%7D&method_results=%7B%22object_is_liked%22%3Afalse%2C%22like_count%22%3A5039330%2C%22like_count_string%22%3A%225M%22%2C%22social_sentence%22%3A%225M%20people%20like%20this.%22%2C%22completionGesture%22%3A%22unlike%22%2C%22didComplete%22%3A1%7
and setting a completion callback in the appdelegate that is set from the view that has the like button and then nillified once consumed
FBSDKLikeControl - How do I know the user liked the page or not?
https://developers.facebook.com/docs/facebook-login/permissions/#reference-user_likes
Can't you just get this permission and check if your page is liked by the user and choose not to show the like control/button ?
So long as you do not do any like gating, you'll be fine (like gating is when you restrict access to the app itself, or some content within the app unless the user likes your page.)
Related Topics
Default Uifont Size and Weight But Also Support Preferredfontfortextstyle
Stop Overscroll When Using "-Webkit-Overflow-Scrolling: Touch"
Swift: Is Correct to Use Stored Properties as Computed Properties
Background Image Not Displaying Correctly in iOS
Left-To-Right Mark Not Working in Swift
Why Does 'Position:Fixed' Not Work When Viewed in an 'Iframe' Using an iPhone or iOS Device
Swift Correct Use of Getters and Setters
Exceeding Max Text("") Concatenation Length - Swiftui -
Rgba to Abgr: Inline Arm Neon Asm for iOS/Xcode
Detect Permission of Media Library iOS
Is There a Way of Automatically Writing Custom Values to The Bundle's .Plist During a Build Phase
CSS Flexible Box Layout on Ipad
Hls Video Streaming on iOS/Safari
How to Make a Reusable Tableview for Different Screens in the Same Application
Didreceiveremotenotification Not Called in Background Mode