MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

postTo Callback Function is not called (iframe app)

Last post 01-22-2009 5:33 AM by rondata. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 01-12-2009 8:45 AM

    postTo Callback Function is not called (iframe app)

     Hello.

    I am trying to do multiple friends invite for my iFrmae based app, but callback function in postTo method is not called.

    JS libs i'm using:

    <script src="http://x.myspacecdn.com/OpenSocial/references/gadgets003.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/references/opensocialreference001.v07.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/MyOpenSpace008.Util.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/MyOpenSpace005.Entities.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/MyOpenSpace011.Mappers.v07.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/MyOpenSpace003.Enums.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/MyOpenSpace028.Core.v07.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/OpenSocial/MyOpenSpace010.Engine.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/modules/common/static/js/Apps/ifpc002.js" type="text/javascript"></script>
    <script src="http://x.myspacecdn.com/modules/common/static/js/Apps/json001.js" type="text/javascript"></script>

    osContainer.postTo(os_token, message, person, callbackFunc);

    callbackFunc is not called.

    Help, please.

  • 01-12-2009 11:49 AM In reply to

    Re: postTo Callback Function is not called (iframe app)

     Which version of the library is this? :)

  • 01-13-2009 5:14 AM In reply to

    Re: postTo Callback Function is not called (iframe app)

    I do not know which version.Where i can find correct version ?? 

  • 01-13-2009 11:00 AM In reply to

    Re: postTo Callback Function is not called (iframe app)

     let me know if that solves your problem..I sent it to you :)

  • 01-13-2009 11:02 AM In reply to

    Re: postTo Callback Function is not called (iframe app)

     I don't know if it helps, but are you using this one:

    <script src="http://x.myspacecdn.com/OpenSocial/IFPC_externalIframe002.js" type="text/javascript"></script> 

    It's now available on MySpace's server (wasn't until last week).

    I tested it yesterday and it's working fine with my IFrame application.

  • 01-15-2009 10:25 PM In reply to

    Re: postTo Callback Function is not called (iframe app)

    I downloaded this file and include it in my page: myspace_opensocial_javascript_20080915.zip. The same code as you, Pavel Grudina. I meet an error too.

    here my code:

    <html><head>

    <script src="data/javascript/references/gadgets003.js" type="text/javascript"></script>
    <script src="data/javascript/references/opensocialreference001.v07.js" type="text/javascript"></script>
    <script src="data/javascript/MyOpenSpace007.Util.js" type="text/javascript"></script>
    <script src="data/javascript/MyOpenSpace005.Entities.js" type="text/javascript"></script>
    <script src="data/javascript/MyOpenSpace010.Mappers.v07.js" type="text/javascript"></script>
    <script src="data/javascript/MyOpenSpace003.Enums.js" type="text/javascript"></script>
    <script src="data/javascript/MyOpenSpace021.Core.v07.js" type="text/javascript"></script>

    <script src="data/javascript/MyOpenSpace010.Engine.js" type="text/javascript"></script>
    <script src="data/javascript/references/ifpc002.js" type="text/javascript"></script>
    <script src="data/javascript/references/json001.js" type="text/javascript"></script>

    <script type="text/javascript">
    //<![CDATA[   
        opensocial.Container.get().registerParam("ptoString", "COMMENTS,BLOG,BULLETINS,PROFILE,SEND_MESSAGE,SHARE_APP");
        opensocial.Container.get().registerParam("panelId", "apppanel_124914_canvas");
        opensocial.Container.get().registerParam("localRelay", "http://api.msappspace.com/OpenSocial/ifpc_relay.aspx");
        opensocial.Container.get().registerParam("remoteRelay", "http://profile.myspace.com/Modules/Applications/Pages/ifpc_relay.aspx");
        opensocial.Container.get().registerParam("ownerid", "1003631790");
        opensocial.Container.get().registerParam("appid", "124914");
    //]]>
    </script>

    </head>
    <body onload="MyOpenSpace.OnLoad.runOnLoadHandlers();">

    <a name="mainFrameTop"></a>
    <div id="messageBox" class="messageBox">
    </div>
    <div style ='text-align:center;'>
    <h1>Call Me Back</h1>
    <button onclick="postBlogCallback()">Blog post with callback</button>
    <div id="mainFrame" class="mainFrame">test</div>
    <div id="test"></div>


    </div>

    <script>
    window.osContainer = opensocial.Container.get();

        function postBlogCallback(){
        var os_token = MyOpenSpace.MySpaceContainer.OSToken;
        var message = opensocial.newMessage("I am a blog post");
       
        message.setField(opensocial.Message.Field.TITLE, "About Testing");
        message.setField(opensocial.Message.Field.TYPE, MyOpenSpace.PostTo.Targets.BLOG);
       
        osContainer.postTo(os_token, message, null, ptCallback);
    }


    function ptCallback(someVal){
        if (someVal == MyOpenSpace.PostTo.Result.ERROR) {
            alert('callback gave error')
        }
        else if (someVal == MyOpenSpace.PostTo.Result.CANCELLED) {
            alert('user cancelled PostTo')
        }
        else if (someVal == MyOpenSpace.PostTo.Result.SUCCESS) {
            alert('WE ARE MEETING WITH GREAT SUCCESS!!!')
        }
        else {
            alert('Unrecognized response: ' + someVal)
        }
       
    }
    </script>
    </body>

    </html>

    The error show: Oops! There was an problem fulfilling your request.

    Does it the right code? So sorry, i'm newbie.

  • 01-16-2009 12:06 PM In reply to

    Re: postTo Callback Function is not called (iframe app)

     email me at rrondeau at myspace dot com so I can send you an updated, but not yet published version of the library.

    Rhonda

     

  • 01-16-2009 1:50 PM In reply to

    Re: postTo Callback Function is not called (iframe app)

    If you're struggling with this please install our DEMO APP:

    http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=124833

    Everything will become crystal clear :)

     

     

  • 01-18-2009 11:18 PM In reply to

    Re: postTo Callback Function is not called (iframe app)

    rondata@myspace:

    If you're struggling with this please install our DEMO APP:

    http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=124833

    Everything will become crystal clear :)

     

     

     

     Thanks for your App Rondata. It's very kind of you.

    Filed under: ,
  • 01-20-2009 7:45 PM In reply to

    Re: postTo Callback Function is not called (iframe app)

     I am able to get the postTo send out a single friend request, however it is also not calling my callback function. I have tried many different ways to get this to work and it simply will not.

     

    I am using the demo app and all the information provided from that demo app.

     

    The App ID is 118011

  • 01-22-2009 1:32 AM In reply to

    Re: postTo Callback Function is not called (iframe app)

    Just a quick update. The demo clearly states the following "The localRelay parameter is the location in the hosting server to the ifpc_relay_external001.html downloaded in the previous section." Since I was trying to host this file on my static server, it did not work out very well. Moving this file to the same machine which the application is running on seems to have fixed that issue.
  • 01-22-2009 5:33 AM In reply to

    Re: postTo Callback Function is not called (iframe app)

    Thanks for your update, and glad you're back on track. :)

Page 1 of 1 (12 items)