FBLikeControl Not Posting to User's Facebook Page - ios

I am using Facebook's iOS SDK 3.20 to add a like button to my iOS app. The problem I'm having is that after clicking the button (and then clicking on the OK button on the confirmation screen that is brought up) no post shows up on the user's Facebook page.
Now, it took me a while to get to the point where the confirmation message would come up and not some type of error message. I had to have my app reviewed by Facebook requesting the "Native Like Button" permission and then make my Facebook app public.
I have reviewed the "Getting Started" guide and the sample apps that come with the Facebook SDK several times and the only thing I'm doing different is setting the objectID of the FBLikeControl to a URL of my choosing (company web site). Here's my code:
FBLikeControl* like = [FBLikeControl alloc] init];
like.likeControlStyle = FBLikeControlStyleButton;
like.objectID = #"http://mycompany.com";
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:like];
All my testing has been done with the XCode Simulator so after clicking the like button the web browser is brought up to show the confirmation. My only guess right now is that something is not set up right on Facebook's developer web site for the app.
Also, after all the testing I've done, I no longer see the confirmation web page. The browser is just displayed briefly and the redirects me back to the app. Here's some logging from after clicking the like button if it helps:
2014-11-24 17:31:24.358 4MyCabPremium[23014:90b] FBSDKLog: FBAppEvents Persist: Writing 4 events
2014-11-24 17:31:25.933 4MyCabPremium[23014:90b] FBSDKLog: FBAppEvents Persist: Read 4 events
2014-11-24 17:31:25.933 4MyCabPremium[23014:90b] FBSDKLog: FBAppEvents Persist: Clearing
2014-11-24 17:31:25.934 4MyCabPremium[23014:90b] FBSDKLog: FBTimeSpentData Restore: {"secondsSpentInCurrentSession":93,"lastSuspendTime":1416873520,"numInterruptions":1}
2014-11-24 17:31:26.137 4MyCabPremium[23014:90b] FBSDKLog: Dynamically loaded library at /System/Library/Frameworks/AdSupport.framework/AdSupport
2014-11-24 17:31:26.137 4MyCabPremium[23014:90b] FBSDKLog: Request <#1125>:
URL: https://graph.facebook.com/v2.2/374418562723727/activities?sdk=ios&advertiser_tracking_enabled=1&bundle_id=com.testapp.liketest&format=json&application_tracking_enabled=1&bundle_version=1.13&event=CUSTOM_APP_EVENTS&url_schemes=%5B%22fb374418562723727%22%5D&advertiser_id=XZF430BA2E-324F-4A4C-95E0-7FC0AD36F3FE&bundle_short_version=13
Method: POST
UserAgent: FBiOSSDK.3.20.0
MIME: multipart/form-data; boundary=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f
Body Size: 0 kB
Attachments:
sdk: ios
advertiser_tracking_enabled: 1
bundle_id: com.testapp.liketest
format: json
application_tracking_enabled: 1
bundle_version: 1.13
event: CUSTOM_APP_EVENTS
url_schemes: ["fb374418562723727"]
advertiser_id: XZF430BA2E-324F-4A4C-95E0-7FC0AD36F3FE
bundle_short_version: 13
custom_events_file: <Data - 0 kB>
2014-11-24 17:31:26.138 4MyCabPremium[23014:90b] FBSDKLog: FBURLConnection <#1128>:
URL: 'https://graph.facebook.com/v2.2/374418562723727/activities?sdk=ios&advertiser_tracking_enabled=1&bundle_id=com.testapp.liketest&format=json&application_tracking_enabled=1&bundle_version=1.13&event=CUSTOM_APP_EVENTS&url_schemes=%5B%22fb374418562723727%22%5D&advertiser_id=XZF430BA2E-324F-4A4C-95E0-7FC0AD36F3FE&bundle_short_version=13'
2014-11-24 17:31:26.240 4MyCabPremium[23014:90b] FBSDKLog: FBURLConnection <#1128>:
Duration: 102 msec
Response Size: 0 kB
MIME type: application/json
2014-11-24 17:31:26.240 4MyCabPremium[23014:90b] FBSDKLog: Response <#1125>
Duration: 102 msec
Size: 16 kB
Response Body:
(
{
body = {
success = 1;
};
code = 200;
}
)
2014-11-24 17:31:26.240 4MyCabPremium[23014:90b] FBSDKLog: FBAppEvents: Flushed # 1416879086, 4 events due to 'PersistedEvents' - {
"advertiser_id" = "XZF430BA2E-324F-4A4C-95E0-7FC0AD36F3FE";
"advertiser_tracking_enabled" = 1;
"application_tracking_enabled" = 1;
"bundle_id" = "com.testapp.liketest";
"bundle_short_version" = 13;
"bundle_version" = "1.13";
event = "CUSTOM_APP_EVENTS";
"url_schemes" = "[\"fb374418562723727\"]";
}
Events: [
{
"horizontal_alignment" : "left",
"_logTime" : 1416879071,
"object_id" : "http:\/\/mycompany.com",
"sound_enabled" : true,
"_implicitlyLogged" : "1",
"_ui" : "no_ui",
"style" : "button",
"auxiliary_position" : "inline",
"_eventName" : "fb_like_control_impression"
},
{
"horizontal_alignment" : "left",
"_logTime" : 1416879084,
"object_id" : "http:\/\/mycompany.com",
"sound_enabled" : true,
"_implicitlyLogged" : "1",
"_ui" : "no_ui",
"style" : "button",
"auxiliary_position" : "inline",
"_eventName" : "fb_like_control_did_tap"
},
{
"horizontal_alignment" : "left",
"_logTime" : 1416879084,
"object_id" : "http:\/\/mycompany.com",
"sound_enabled" : true,
"_implicitlyLogged" : "1",
"_ui" : "no_ui",
"style" : "button",
"auxiliary_position" : "inline",
"_eventName" : "fb_like_control_did_present_dialog"
},
{
"fb_dialog_outcome" : "Completed",
"_logTime" : 1416879084,
"_eventName" : "fb_dialogs_present_like_og",
"_implicitlyLogged" : "1",
"_ui" : "no_ui"
}
]
Flush Result : Success
Thanks in advance to anyone who can help with this problem.

Related

iOS: What is IOFence and why is it freezing our app?

We have an AR project (built in Unity) that's running 24/7 on a number of iPads Pros (12.9, gen 3) in a museum. It's been live for 2.5 years now. We've always had the occasional freeze (on iOS 13 and below), but lately they have gotten exponentially worse (on iOS 14.4.2 and 14.6).
The problem manifests as follows, at completely random times: our app keeps running in the background (we can hear sound effects and see database activity continuing), but it stops getting redrawn, causing the screen to freeze on whatever frame was drawn last.
We're getting a gpuevent .ips log at freeze time (see below), which has information about an IOSurface being blocked by IOFence. There's very little info online about these logs though, so we're sort of stuck with the analysis. From what little I can find, it seems like we have some resource, possibly a texture buffer, that gets accessed by two processes simultaneously, causing one of those processes (the one responsible for drawing the screen) to get killed by the OS. Does that sound plausible? And if so, how do we find out where in our code the issue is triggered?
Can anyone here interpret this log better than we can, or does anyone have suggestions as to our next steps?
{"bug_type":"284","timestamp":"2021-07-10 10:51:30.00 +0200","os_version":"iPhone OS 14.6 (18F72)","incident_id":"C3ABD477-2A61-4D43-A3B1-25D7CCD706E6"}
{
"process_name" : "hats",
"registers" : {
},
"timestamp" : 1625907090,
"analysis" : {
"iofence_list" : {
"iofence_num_iosurfaces" : 1,
"iofence_iosurfaces" : [
{
"iofence_current_queue" : [
{
"iofence_acceleratorid" : 1,
"iofence_backtrace" : [
-68148358856,
-68148357636,
-68144533400,
-68144532380,
-68144496896,
-68144598792,
-68144425788,
-68144434312
],
"iofence_direction" : 1
}
],
"iosurface_id" : 243,
"iofence_waiting_queue" : [
{
"iofence_acceleratorid" : 2,
"iofence_backtrace" : [
-68148358856,
-68148357636,
-68146420632,
-68154559340,
-68146423972,
-68146427004,
-68146495056,
-68154290536
],
"iofence_direction" : 2
},
{
"iofence_acceleratorid" : 1,
"iofence_backtrace" : [
-68148358856,
-68148357636,
-68144533400,
-68144532380,
-68144496896,
-68144598792,
-68144425788,
-68144434312
],
"iofence_direction" : 1
}
]
}
]
},
"fw_ta_substate" : {
"slot0" : 0,
"slot1" : 0
},
"fw_power_state" : 0,
"fw_power_boost_controller" : 0,
"guilty_dm" : 1,
"fw_power_controller_in_charge" : 0,
"fw_cl_state" : {
"slot0" : 0
},
"fw_perf_state_lo" : 1,
"fw_ta_state" : {
"slot0" : 0,
"slot1" : 0
},
"signature" : 625,
"fw_power_substate" : 4,
"command_buffer_trace_id" : 490782964,
"fw_perf_state_select" : 0,
"restart_reason" : 7,
"fw_3d_state" : {
"slot0" : 0,
"slot1" : 0,
"slot2" : 0
},
"fw_gpc_perf_state" : 0,
"fw_perf_state_hi" : 1,
"fw_power_limit_controller" : 7,
"restart_reason_desc" : "blocked by IOFence"
}
}

youtube data api not working with videorecordingdetails - show error 400 unexpectedPart

When I include VideoRecordingDetails while inserting a video through youtube data api, it shows me the below error:-
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "youtube.part",
"location" : "part",
"locationType" : "parameter",
"message" : "{0}",
"reason" : "unexpectedPart"
} ],
"message" : "{0}"
}
But after commenting the below line, its working fine.
ytvideo.setRecordingDetails(recordingDetails);
Please help me how I can set recording date of a video. Here is my code which is not working:-
VideoRecordingDetails recordingDetails = new VideoRecordingDetails();
DateTime dt = new DateTime(vdata.getYtRecordDate());
recordingDetails.setRecordingDate(dt);
ytvideo.setRecordingDetails(recordingDetails);

Getting notification in console but not in notification center

Coding iOS app in react-native (0.35.0) and using iPad mini (9.3.5) as a test device. Already made Android app with successfully implementing react-native-fcm module for notifications.
Problem I'm facing now in iOS development is that I do receive notification while app is in background but I do not get it in notif center (I can just catch it in console). I have no idea why is it happening.
This is the module I'm using react-native-fcm . I've followed all the instructions in Cocoapods and in manual integration but I can't make it work. I get no errors what so ever. Tried by directly pushing app to device trough xCode and by archiving it (thought that it might be bundling problem).
Any help would be highly appreciated (even though if someone hasn't worked in react-native but ran into this problem in for example swift). If needed I can provide more information.
Best regards,
Bepo.
EDIT:
I'm sending this JSON:
{
"notification" : {
"body" : "Notif body",
"title" : "notif",
"icon" : "myicon",
"sound" : "default",
"vibrate": "default",
"extra" : "Some extra I need"
},
"data" :{
"redirectUrl" : "Url that I need to redirect person after it clicks on notif"
},
"to" : "token that I've gotten",
"content_available": true,
"priority" : "high",
"show_in_foreground": true
}
with headers:
Content-Type:application/json
Authorization:key= my Api key on firebase
FCM response:
{
"multicast_id": ***************45844,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:********************a1027b"
}
]
}
Notification i'm catching in console:
{ notification:
{ title: 'notif',
sound: 'default',
vibrate: 'default',
icon: 'myicon',
extra: 'Some extra I need',
sound2: 'default',
e: '1',
body: 'Notif body' },
redirectUrl: 'Url that I need to redirect person after it clicks on notif',
collapse_key: 'My app id',
opened_from_tray: 0,
from: '*********' }

"Flush Result : No Connectivity" Error for FBSDKAppEvents

I have integrated FBSDKCoreKit.framework to track app events, I am calling [FBSDKAppEvents activateApp] in applicationDidBecomeActive: and enabling logs using [FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorAppEvents]
In logs it's logging following error
FBSDKLog: FBSDKAppEvents: Flushed # 1473666575, 2 events due to 'Timer' - {
"advertiser_tracking_enabled" = 1;
"anon_id" = "xxxxxx-xxxxx-xxxxx-xxxxx";
"application_tracking_enabled" = 1;
event = "CUSTOM_APP_EVENTS";
extinfo = "[xxx, xxx, xxx]";
"url_schemes" = "[\"xxxxxxxx\"]";
}
Events: [
{
"isImplicit" : false,
"event" : {
"fb_mobile_launch_source" : "Unclassified",
"_session_id" : "xxxxxx-xxxxx-xxxxx-xxxxx",
"fb_mobile_app_interruptions" : 0,
"_logTime" : 1473664599,
"_ui" : "no_ui",
"_eventName" : "fb_mobile_deactivate_app",
"_valueToSum" : 155,
"fb_mobile_time_between_sessions" : "session_quanta_2"
}
},
{
"isImplicit" : false,
"event" : {
"fb_mobile_launch_source" : "Unclassified",
"_ui" : "no_ui",
"_eventName" : "fb_mobile_activate_app",
"_logTime" : 1473665765,
"_session_id" : "96FA9509-AB21-475F-9F44-3005FE5D10BC"
}
}
]
Flush Result : No Connectivity
At end of log it's showing me error Flush Result : No Connectivity
Any one know why I'm getting this error ?
I got it working by following this guide FBSDK doc here does not explain about each configuration required for tracking events

Facebook Analytics not working with ios device

I had added app analytic for such events in my application which
perfectly works with iOS Simulator, but not with iOS device
When I run it on iOS Simulator, it gives me below log
Events: [
{
"event" : {
"_eventName" : "XXX",
"_logTime" : 1446626494,
"User ID" : "159",
},
"isImplicit" : false
}
]
Flush Result : Success
When I run it on iOS device, it gives me below log
Events: [
{
"event" : {
"_eventName" : "XXX",
"_logTime" : 1446626494,
"User ID" : "159",
},
"isImplicit" : false
}
]
Flush Result : No Connectivity
Please help me if anyone know issue.
Make sure that you are logged in with Developer Facebook ID in that
iOS device from which you had generated Facebook App ID.

Resources