Facebook iOS SDK 3.5.1 Friend Request Dialog crashed on close -
i have ios app uses facebook sdk. upgraded 3.2 3.5.1 in part allow me use frictionless friend requests. process works fine with:
nsmutabledictionary* params = [nsmutabledictionary dictionarywithobjectsandkeys:nil]; [fbwebdialogs presentrequestsdialogmodallywithsession:[fbsession activesession] message:[nsstring stringwithformat:@"i posted action - give me points!"] title:@"get points friends" parameters:params handler:^(fbwebdialogresult result, nsurl *resulturl, nserror *error) { if (error) { // case a: error launching dialog or sending request. nslog(@"error sending request."); } else { if (result == fbwebdialogresultdialognotcompleted) { // case b: user clicked "x" icon nslog(@"user canceled request."); } else { nslog(@"request sent."); } }}];
but add friend cache (copy / pasted facebook website):
nsmutabledictionary* params = [nsmutabledictionary dictionarywithobjectsandkeys:nil]; fbfrictionlessrecipientcache *friendcache = [[fbfrictionlessrecipientcache alloc] init]; [friendcache prefetchandcacheforsession:nil]; [fbwebdialogs presentrequestsdialogmodallywithsession:[fbsession activesession] message:[nsstring stringwithformat:@"i posted action - give me points!"] title:@"get points friends" parameters:params handler:^(fbwebdialogresult result, nsurl *resulturl, nserror *error) { if (error) { // case a: error launching dialog or sending request. nslog(@"error sending request."); } else { if (result == fbwebdialogresultdialognotcompleted) { // case b: user clicked "x" icon nslog(@"user canceled request."); } else { nslog(@"request sent."); } }} friendcache:friendcache];
the app load dialog crash on [fbwebdialoginternaldelegate completewithresult:url:error:] @ fbwebdialogs.m:93: when either tap x button cancel dialog or try send request.
do need add dependancies, start sessions in new way, link or else don't tell in https://developers.facebook.com/docs/tutorial/iossdk/upgrading-from-3.2-to-3.5/?
thanks.
pretty sure in case it's because you're not retaining friendcache anywhere, , gets released before fbwebdialogs tries use (such when dialog dismissed).
if move friendcache ivar or property in class instead of local variable, should work.
Comments
Post a Comment