Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-11962

iOS: Facebook requestWithGraphPath fails the second time a post is sent to the user's timeline

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Component/s: iOS
    • Labels:
      None
    • Environment:

      iOS 6
      SDK 2.1.4

      Description

      Problem description

      When trying to post something on the user's timeline using requestWithGraphPath, the call only works the first time (after authorize has been called). The following times, this error is returned:

      {"type":"result","source":{},"error":"The operation couldn’t be completed. (facebookErrDomain error 10000.)","path":"me/feed","success":false,"graph":true}
      

      Steps to reproduce

      Use the following code to verify the problem (change [APPID]):

      Ti.Facebook.appid = '[APPID]';
      Ti.Facebook.permissions = ['publish_stream'];
       
      var win = Ti.UI.createWindow({
          background: 'white',
          layout: 'vertical'
      });
       
      var button = Ti.UI.createButton({ title : 'fb login' });
      button.addEventListener('click', function() {
          Ti.Facebook.authorize();
      });
       
      var post = Ti.UI.createButton({ title : 'send post' });
      post.addEventListener('click', postFeed);
       
      Ti.Facebook.addEventListener('login', function(e) {
          if (!e.success) {
              alert('fb not logged in');
          }
      });
       
      win.add(button);
      win.add(post);
       
      function postFeed() {
          var fbData = {
              caption : "Test report to FB",
              message : "text to send to FB timeline from test iPhone app"
          };
          Ti.Facebook.requestWithGraphPath('me/feed', fbData, 'POST', function(ef) {
              Ti.API.info(JSON.stringify(ef));
              if (ef.error) {
                  alert(ef.error);
              } else {
                  alert("upload to FB successful!");
              }
          });
      }
       
      win.open();
      

      First time, clicking the send button (after login) works fine; then, it will never work again. Note that clicking again the login button won't fire the 'login' event anymore as well.

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              dcassenti Davide Cassenti
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15101
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration