app crash when try get user photo by Facebook iOS Graph API with app-scoped user id -


i use facebook ios. user's data without problem graph api. user's data app-scoped user id. try user's picture application crashed. tried use [fbrequestconnection startwithgraph:@"/me/picture" ...] , [fbrequestconnection startwithgraph:@"/(app id user's data)/picture" ...] still crashed. why?

   2014-06-02 16:16:51.669 testapp[448:60b] -[nsnull datausingencoding:]: unrecognized selector sent instance 0x19f8068     2014-06-02 16:16:51.679 testapp[448:60b] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull datausingencoding:]: unrecognized selector sent instance 0x19f8068'     *** first throw call stack:  (     0   corefoundation                      0x018ac1e4 __exceptionpreprocess + 180     1   libobjc.a.dylib                     0x0162b8e5 objc_exception_throw + 44     2   corefoundation                      0x01949243 -[nsobject(nsobject) doesnotrecognizeselector:] + 275     3   corefoundation                      0x0189c50b ___forwarding___ + 1019     4   corefoundation                      0x0189c0ee _cf_forwarding_prep_0 + 14     5   testapp                             0x00022721 +[fbutility simplejsondecode:error:] + 42     6   testapp                             0x0000a75e -[fbrequestconnection parsejsonorotherwise:error:] + 69     7   testapp                             0x0000a5a0 -[fbrequestconnection parsejsonresponse:error:statuscode:] + 1256     8   testapp                             0x00009e04 -[fbrequestconnection completewithresponse:data:orerror:] + 666     9   testapp                             0x00007564 __68-[fbrequestconnection startwithcacheidentity:skiproundtripifcached:]_block_invoke + 201     10  testapp                             0x00045fbc -[fburlconnection invokehandler:error:response:responsedata:] + 49     11  testapp                             0x00045ec7 -[fburlconnection logandinvokehandler:response:responsedata:] + 414     12  testapp                             0x00046442 -[fburlconnection connectiondidfinishloading:] + 248     13  foundation                          0x013f4e49 ___nsurlconnectiondidfinishloading_block_invoke + 40     14  foundation                          0x0138b7e1 __65-[nsurlconnectioninternal _withconnectionanddelegate:onlyactive:]_block_invoke + 62     15  foundation                          0x01213f5e -[nsurlconnectioninternalconnection invokefordelegate:] + 119     16  foundation                          0x01213ec6 -[nsurlconnectioninternal _withconnectionanddelegate:onlyactive:] + 208     17  foundation                          0x01213dd8 -[nsurlconnectioninternal _withactiveconnectionanddelegate:] + 76     18  foundation                          0x01214188 _nsurlconnectiondidfinishloading + 43     19  cfnetwork                           0x064aa69f ___zn27urlconnectionclient_classic26_delegate_didfinishloadingeu13block_pointerfvve_block_invoke + 111     20  cfnetwork                           0x064a83de ___zn27urlconnectionclient_classic18_withdelegateasyncepkcu13block_pointerfvp16_cfurlconnectionpk33cfurlconnectionclientcurrent_vmaxe_block_invoke_2 + 104     21  corefoundation                      0x0184dc69 cfarrayapplyfunction + 57     22  cfnetwork                           0x06411441 _zn19runloopblockcontext7performev + 155     23  cfnetwork                           0x064f33f4 _zthn16_n19runloopblockcontext24multiplexerclientperformev + 20     24  cfnetwork                           0x06411257 _zn17multiplexersource7performev + 299     25  cfnetwork                           0x0641106c _zn17multiplexersource8_performepv + 76     26  corefoundation                      0x0183577f __cfrunloop_is_calling_out_to_a_source0_perform_function__ + 15     27  corefoundation                      0x0183510b __cfrunloopdosources0 + 235     28  corefoundation                      0x018521ae __cfrunlooprun + 910     29  corefoundation                      0x018519d3 cfrunlooprunspecific + 467     30  corefoundation                      0x018517eb cfrunloopruninmode + 123     31  graphicsservices                    0x038a05ee gseventrunmodal + 192     32  graphicsservices                    0x038a042b gseventrun + 104     33  uikit                               0x002ebf9b uiapplicationmain + 1225     34  testapp                             0x00003b2d main + 141     35  libdyld.dylib                       0x01ef3701 start + 1     36  ???                                 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception (lldb) 

thanks!

i guess because don't handle http redirect facebook sending if query /me/picture. if want url of picture, use /me/picture?redirect=false stated in docs: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/picture/#read

otherwise add code handle http redirects.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -