简体   繁体   中英

Appcelerator Facebook Module Error Posting Photo on IOS

I'm using version 5.2.0 of appcelerator's facebook module on the 5.4.0GA sdk. I'm able to post a link to facebook with the following code:

   var data = {link: "http://www.stackfish.com" };
   fb.requestWithGraphPath('me/feed', data,"POST",showRequestResult);

But when I try to post a photo using the example code I've found I get an array mutation error. Here's the code that causes the error on IOS (it works fine on droid):

        if ( fb.getLoggedIn() == true )
        {
            // Ti.API.info('1.5.5 PostTo FacebookLogged In Perissions = ' + fb.permissions);




           Titanium.Media.openPhotoGallery({
    success:function(event)
    {

        var data = {picture: event.media, caption: 'test'};
        Titanium.Facebook.requestWithGraphPath('me/photos', data, "POST", showRequestResult);
    },
    cancel:function()
    {
    },
    error:function(error)
    {
    },
    allowEditing:true
});

Here's the error:

[ERROR] :  Script Error {
[ERROR] :      column = 2506;
[ERROR] :      line = 1;
[ERROR] :      message = "*** Collection <__NSDictionaryM: 0x14ee27430> was mutated while being enumerated.";
[ERROR] :      sourceURL = "file:///var/containers/Bundle/Application/110C8EFE-A325-4D3C-A15C-AC0FFA89C418/Stackfish.app/alloy/controllers/PostReview.js";
[ERROR] :      stack = "[native code]\nsuccess@file:///var/containers/Bundle/Application/110C8EFE-A325-4D3C-A15C-AC0FFA89C418/Stackfish.app/alloy/controllers/PostReview.js:1:2506";
[ERROR] :  }

Does anyone have any ideas on what I'm doing wrong? Thanks

Looks valid to me. I created a JIRA-ticket for you here: MOD-2286

We need to remove the fast-iteration to a classic-iteration to avoid mutation issues. Please follow the ticket and give feedback there, thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM