ios - Facebook SDK: Knowing if sharing took place -
i sharing link app using code hellofacebooksample, can't figure out how know if sharing took place. use sharing:
fbappcall *appcall = [fbdialogs presentsharedialogwithlink:urltoshare name:@"hello facebook" caption:nil description:@"the 'hello facebook' sample application showcases simple facebook integration." picture:nil clientstate:nil handler:^(fbappcall *call, nsdictionary *results, nserror *error) { if (error) { nslog(@"error: %@", error.description); } else { nslog(@"success!"); } nslog(@"results: %@",results); }];
and works fine. problem accessing results dictionary. figured out need add app delegate:
- (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { // attempt extract token url return [fbappcall handleopenurl:url sourceapplication:sourceapplication fallbackhandler:^(fbappcall *call) { nslog(@"in fallback handler"); }]; }
otherwise handler isn't run @ all. weird thing in sample app results dictionary has 2 fields,
completiongesture = cancel; didcomplete = 1;
but when use exact same code in own app, on same phone, dictionary contains
didcomplete = 1;
why that, , there other way find out if user shared or cancelled?
see section here on can expect in result dictionary, , why values available:
https://developers.facebook.com/ios/share-dialog/#handling-responses
Comments
Post a Comment