[Help][SDKBOX][iOS]Facebook share not working in facebook app but works in browser

hi,
@nite

I have a problem in getting callback in facebook app.
When I shared the link using facebook app… the post was shared but the reward animation that i gave in “onSharedSuccess” function is not working…but the same is working when I shared it through browser… Why is it so?? is that onSharedSuccess function is not been called when used in facebook app??

Can someone help me with this issue??

Thanks,
Monisha.

Are you using c++ or js?

@nite thank u for replying.

I’m using javascript.

I am also facing an issue while sending invitation …when I invite …it directs to the browser not to the facebook app and each time when I invite using browser I have to login first and then invite…

I think for js we fixed the onShared callback during last update.
new facebook SDK will use browser as their default interaction method because facebook want their user to have their cookie.

I have updated sdkbox to v2.3.13.5.

When i try to share using facebook app, onSharedCancel callback is only been called even though i get shared message from facebook app.Here’s the screen shot.

and this is the log which i’m getting

      FBSDKLog: FBSDKAppEvents Persist: Read 1 event states. First state has 3 events
      2017-05-12 17:01:48.999945+0530 test-mobile[638:72953] FBSDKLog: FBSDKAppEvents 
     Persist: Clearing
     onSharedCancel // this is the log which i gave under "onSharedCancel" call back//
     2017-05-12 17:01:49.288948+0530 test-mobile[638:73028] dnssd_clientstub write_all(37) 
     DEFUNCT
     2017-05-12 17:01:49.289346+0530 test-mobile[638:73028] dnssd_clientstub 
     deliver_request ERROR: write_all(37, 70 bytes) failed
     2017-05-12 17:01:49.289721+0530 test-mobile[638:73028] dnssd_clientstub write_all(37) 
       DEFUNCT
      2017-05-12 17:01:49.953098+0530 test-mobile[638:72953] FBSDKLog: 
    FBSDKTimeSpentData Restore: 
    {"lastSuspendTime":1494588702,"numInterruptions":0,"sessionID":"BB3CB53E-D2D2-
   4446-AE7A-391E65F70223","secondsSpentInCurrentSession":14}
    connection status change: 1002 connection_status
    2017-05-12 17:01:57.440007+0530 test-mobile[638:73030] <Google:HTML> You are 
     currently using version 7.18.0 of the SDK. Please consider updating your SDK to the most 
    recent SDK version to get the latest features and bug fixes. The latest SDK can be 
     downloaded from http://goo.gl/iGzfsP. A full list of release notes is available at 
    https://developers.google.com/admob/ios/rel-notes.
    2017-05-12 17:01:59.272698+0530 test-mobile[638:72953] FBSDKLog: FBSDKAppEvents: 
     Flushed @ 1494588718, 4 events due to 'Timer' - {
    "advertiser_tracking_enabled" = 1;
      "anon_id" = "XZB5A13D66-68E4-4320-9F07-EDE9A41C202E";
    "application_tracking_enabled" = 1;
     event = "CUSTOM_APP_EVENTS";
     extinfo = "
    [\"i2\",\"com.infocom.test\",\"1.0\",\"\",\"10.3.1\",\"iPhone7,2\",\"en_IN\",\"IST\",\"Vodafone 
   India\",568,320,\"2.00\",2,15,9,\"Asia\\/Kolkata\"]";
    "url_schemes" = "[\"fb1322042141180744\"]";
  }
 Events: [
    {
     "event" : {
  "_ui" : "FBSDKContainerViewController",
  "_eventName" : "fb_dialog_share_result",
  "_logTime" : 1494588709,
  "fb_dialog_outcome" : "Completed",
  "_implicitlyLogged" : "1"
},
"isImplicit" : true
   },
   {
"event" : {
  "4_error_code" : "",
  "0_auth_logger_id" : "299C506B-DC71-4FD6-B21A-A99C7D4033C3",
  "7_logging_token" : "",
  "_eventName" : "fb_mobile_login_start",
  "_logTime" : 1494588702,
  "1_timestamp_ms" : 1494588701714,
  "6_extras" : "{\"default_audience\":\"friends\",\"tryIntegratedAuth\":false,\"tryFBAppAuth\":true,\"login_behavior\":\"FBSDKLoginBehaviorNative\",\"tryFallback\":false,\"permissions\":\"public_profile,email,user_friends\",\"trySafariAuth\":true,\"isReauthorize\":true}",
  "_ui" : "no_ui",
  "5_error_message" : "",
  "2_result" : "",
  "_implicitlyLogged" : "1"
},
"isImplicit" : true
  },
 {
"event" : {
  "0_auth_logger_id" : "299C506B-DC71-4FD6-B21A-A99C7D4033C3",
  "3_method" : "sfvc_auth",
  "1_timestamp_ms" : 1494588701788,
  "_ui" : "FBSDKContainerViewController",
  "7_logging_token" : "",
  "_logTime" : 1494588702,
  "4_error_code" : "",
  "_implicitlyLogged" : "1",
  "6_extras" : "{\"isMessengerAppCanOpenURLSchemeRegistered\":true,\"isURLSchemeRegistered\":true,\"isFacebookAppCanOpenURLSchemeRegistered\":true}",
  "2_result" : "",
  "_eventName" : "fb_mobile_login_method_start",
  "5_error_message" : ""
},
"isImplicit" : true
  },
 {
"event" : {
  "fb_dialog_share_content_type" : "Status",
  "_eventName" : "fb_dialog_share_show",
  "fb_dialog_mode" : "Native",
  "_logTime" : 1494588702,
  "_implicitlyLogged" : "1",
  "_ui" : "FBSDKContainerViewController"
},
"isImplicit" : true
 }
 ]  
       Flush Result : Success

Emm, and old documentation https://developers.facebook.com/docs/ios/troubleshooting#onsuccess, seems be removed.

there are nothing sharer:didCompleteWithResults: (from Facebook SDK) even share photo success.

expected a postId field in the callback result, but it seems that facebook lie to us ;(

but


    FBShareInfo info;
    info.type  = FB_PHOTO;
    info.title = "capture screen";
    info.image = _captureFilename;
    PluginFacebook::share(info);

works fine.

ok… What am I supposed to do now??

PluginFacebook.framework.zip (2.3 MB)

can you help to test this update plugin sdk ?

sure…will test and let u know soon…

@yinjimmy

I tested with the updated plugin sdk and I am getting the same issue now in browser as well as in facebook app.

2017-05-15 13:58:05.673383+0530 test-mobile[736:127699] FBSDKLog: 	FBSDKAppEvents Persist: Clearing
onSharedCancel // log that i gave under onSharedCancel callback
2017-05-15 13:58:06.597285+0530 test-mobile[736:127699] FBSDKLog: 	FBSDKTimeSpentData Restore: {"lastSuspendTime":1494836876,"numInterruptions":1,"sessionID":"B79B30A3-62CE-4E86-8429-498227805FA5","secondsSpentInCurrentSession":25}
connection status change: 1002 connection_status
2017-05-15 13:58:07.288420+0530 test-mobile[736:127699] FBSDKLog: FBSDKAppEvents: Flushed @ 1494836886, 4 events due to 'Timer' - {
"advertiser_tracking_enabled" = 1;
"anon_id" = "XZE7FCF11A-08D1-4AB8-AC82-4BE6AAFABE0C";
"application_tracking_enabled" = 1;
event = "CUSTOM_APP_EVENTS";
extinfo = "[\"i2\",\"com.infocom.test\",\"1.0\",\"\",\"10.3.1\",\"iPhone7,2\",\"en_IN\",\"IST\",\"Vodafone India\",568,320,\"2.00\",2,15,9,\"Asia\\/Kolkata\"]";
"url_schemes" = "[\"fb1322042141180744\"]";
 }
Events: [
 {
"event" : {
  "_ui" : "no_ui",
  "_eventName" : "fb_dialog_share_result",
  "_logTime" : 1494836886,
  "fb_dialog_outcome" : "Completed",
  "_implicitlyLogged" : "1"
},
"isImplicit" : true
},
{
"event" : {
  "0_auth_logger_id" : "7280985E-A6B6-430C-B020-7C15BF418DCD",
  "3_method" : "sfvc_auth",
  "1_timestamp_ms" : 1494836875079,
  "_ui" : "no_ui",
  "7_logging_token" : "",
  "_logTime" : 1494836875,
  "4_error_code" : "",
  "_implicitlyLogged" : "1",
  "6_extras" : "{}",
  "2_result" : "success",
  "_eventName" : "fb_mobile_login_method_complete",
  "5_error_message" : ""
},
"isImplicit" : true
 },
 {
"event" : {
  "0_auth_logger_id" : "7280985E-A6B6-430C-B020-7C15BF418DCD",
  "3_method" : "sfvc_auth",
  "1_timestamp_ms" : 1494836875081,
  "_ui" : "no_ui",
  "7_logging_token" : "",
  "_logTime" : 1494836875,
  "4_error_code" : "",
  "_implicitlyLogged" : "1",
  "6_extras" : "{}",
  "2_result" : "success",
  "_eventName" : "fb_mobile_login_complete",
  "5_error_message" : ""
 },
"isImplicit" : true
},
{
"event" : {
  "fb_dialog_share_content_type" : "Status",
  "_eventName" : "fb_dialog_share_show",
  "fb_dialog_mode" : "Native",
  "_logTime" : 1494836876,
  "_implicitlyLogged" : "1",
  "_ui" : "no_ui"
},
"isImplicit" : true
}
	]
Flush Result : Success
2017-05-15 13:58:11.824591+0530 test-mobile[736:128903] dnssd_clientstub write_all(31) DEFUNCT
2017-05-15 13:58:11.824653+0530 test-mobile[736:128903] dnssd_clientstub deliver_request ERROR: write_all(31, 68 bytes) failed
2017-05-15 13:58:11.824783+0530 test-mobile[736:128903] dnssd_clientstub write_all(31) DEFUNCT

Em, do you mean:

  1. dialog link, you get onSharedCancel when share success ? in browser or in facebook app ?
  2. dialog photo with FB app, you get onSharedCancel when share success ?

I tested with dialog link with browser (iOS simulator), facebook app (iPhone 4s). works fine.
dialog photo with iPhone 4s, works fine (include cancel and share).

I downloaded the plugin sdk which you gave me to test .
1.yes, in dialog link I’m getting onSharedCancel call back when share success both in browser and also in facebook app.
2.I didn’t try with dialog photo since i’m not using it in my game.

I thought of testing it in another project. So created an empty project and imported facebook in it and did all necessary things. I took a build and first run it on iOS simulator.The result was too weird.
I gave my login details and it directed to a confirm login page and I gave ok.
screenshot:

When I gave ok …it was not directed to my app instead it went to a blank page which has a done button on the top left corner.

When I clicked done , it came to my app and displayed “login failed”.

I was not able to login. here’s log

      login failed
  2017-05-16 12:37:43.316 facebooktest-mobile[7305:91990] FBSDKLog: FBSDKAppEvents: Flushed @ 1494918463, 2 events due to 'Timer' - {
"advertiser_tracking_enabled" = 1;
"anon_id" = "XZABB1CC47-0C4A-41C1-85FE-160E3FBCE7DA";
"application_tracking_enabled" = 1;
event = "CUSTOM_APP_EVENTS";
extinfo = "[\"i2\",\"org.cocos2dx.facebooktest\",\"1.0\",\"\",\"10.3\",\"x86_64\",\"en_US\",\"GMT+5:30\",\"NoCarrier\",568,320,\"3.00\",4,465,82,\"Asia\\/Kolkata\"]";
"url_schemes" = "[\"fb367767990285865\"]";
 }
Events: [
 {
"event" : {
  "0_auth_logger_id" : "ECB31C2B-91E2-411F-B718-4FE44D57F98B",
  "3_method" : "sfvc_auth",
  "1_timestamp_ms" : 1494918453812,
  "_ui" : "FBSDKContainerViewController",
  "7_logging_token" : "",
  "_logTime" : 1494918454,
  "4_error_code" : "",
  "_implicitlyLogged" : "1",
  "6_extras" : "{\"implicit_cancel\":true}",
  "2_result" : "cancelled",
  "_eventName" : "fb_mobile_login_method_complete",
  "5_error_message" : ""
},
"isImplicit" : true
},
{ 
"event" : {
  "0_auth_logger_id" : "ECB31C2B-91E2-411F-B718-4FE44D57F98B",
  "3_method" : "sfvc_auth",
  "1_timestamp_ms" : 1494918453812,
  "_ui" : "FBSDKContainerViewController",
  "7_logging_token" : "",
  "_logTime" : 1494918454,
  "4_error_code" : "",
  "_implicitlyLogged" : "1",
  "6_extras" : "{}",
  "2_result" : "cancelled",
  "_eventName" : "fb_mobile_login_complete",
  "5_error_message" : ""
},
"isImplicit" : true
}
]
Flush Result : Success

Next scenario

Tested with facebook app in device iPhone 6

I connected iPhone and tested it on iPhone.
When I clicked login it directed to page asking me to login either using facebook app or browser.

I chose facebook app. Gave my login details and it asked for permissions. I gave ok and it directed to the same login page again.
Clicked done and it came to my app displaying “login failed”.

In my actual game that I was testing before I’m able to login but onSharedCancel is been called all the time.
Can you plz test it with iPhone 6 and see??

updates:
Just now tested with dialog photo in my game. I’m getting the same issue. onSharedCancel is only been called when share success.

test dialog link with iPhone 6s :

no facebook app:

  1. onSharedCancel when I click ‘DONE’ or ‘x’
  2. ##FB onSharedSuccess:{“postId”:“1009942952471586”} when I click ‘send’

facebook app exist:

  1. onSharedCancel when I click ‘cancel’
  2. ##FB onSharedSuccess:{“postId”:“100003676714850_1009948182471063”} when I click ‘send’

Sorry…I didn’t get you…

Did u mean that you tested with iPhone 6s??

yes, tested with iPhone 6s.

ok…so it’s working for in browser and also with facebook app??

sorry…can u be more clear??

Is it that u installed facebook app in iphone 6s and onSharedSuccess callback worked fine??

on iPhone 6s device:

test dialog link:

no facebook app:

  1. onSharedCancel when I click ‘DONE’ or ‘x’
  2. ##FB onSharedSuccess:{“postId”:“1009942952471586”} when I click ‘send’

facebook app exist:

  1. onSharedCancel when I click ‘cancel’
  2. ##FB onSharedSuccess:{“postId”:“100003676714850_1009948182471063”} when I click ‘send’

ok…so dialog link is not working but dialog photo is working?? right??

If you don’t mind can I get your project to test??

dialog link and dialog photo works fine on iPhone 6s & iPhone 4s.