MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

ifpc open social token not set

Last post 05-11-2009 7:18 AM by rondata. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-07-2009 8:52 AM

    ifpc open social token not set

    hey guys.

    I downloaded the ifpc demo and put all of the include files and such and what I am trying to do is when a user selects a friend from a list provided to him the application posts a comment on that friends page.

    I get the list of friends using REST calls but my problem is that when I call my postTo method it gives me a: error: Open social token not set.

    Any help would be appreciated. Here is my code:

    THE CODE TO GET ALL OF THE FRIENDS

     <?php
                    $myspace = new MySpaceAPI($consumer_key,$consumer_secret);
                    $friendArray = $myspace->get_friends($platformId);

                    //$resourceToken = $myspace->OAuthToken->get_authorization_url("http://www.undergroundmusix.com/myspaceapp/umusix_php/container.php5",$requestToken);
                    // $resourceToken = $myspace->OAuthToken->get_authorization_url("http://www.explosm.net",$requestToken);
                    // $result = $myspace->OAuthToken->get_access_token();
                    // $friends = $myspace->People->get_people_friends($platformId);

                    $friend = $friendArray["friends"];
                    foreach($friend as $f){
                        echo(' <li class="ui-state-default ui-corner-all friend" title="Your Friend" id='.$f['userid'].'>');
                        echo($f['displayname']);
                        echo('<span class="ui-icon ui-icon-circle-plus inviteFriend" title= "Invite Friend" id='.$f['userid'].'></span>');
                        echo('</li>');
                    }
                    ?>

    using jquery i link the onclick even to call my post to function:

    POST TO FUNCTION:

     function postTo(friendID){
            MyOpenSpace.MySpaceContainer.get().registerParam("panelId", "apppanel_133049_canvas");
            MyOpenSpace.MySpaceContainer.get().registerParam("localRelay", "http://www.undergroundmusix.com/myspaceapp/umusix_php/ifpc_relay_external001.html");
            var postback = function(response){
                if (response.errorMessage){
                    alert("Error: " + response.errorMessage);
                    return;
                }
                switch (response){
                    case MyOpenSpace.PostTo.Result.ERROR:
                        alert("Error");
                        break;
                    case MyOpenSpace.PostTo.Result.CANCELLED:
                        alert("Cancelled");
                        break;
                    case MyOpenSpace.PostTo.Result.SUCCESS:
                        alert("Success");
                        break;
                }
            }

            var container = MyOpenSpace.MySpaceContainer.get();

            var messageText = "My cool message";

            var params = {};
            params[MyOpenSpace.Message.Field.TITLE] = "title";
            params[MyOpenSpace.Message.Field.TYPE] = MyOpenSpace.PostTo.Targets.COMMENTS; //This can be COMMENTS

            //The recipient information can be retrieve using the REST API
            var recipientId = friendID; //Set the id of the recipient
            var recipientThumbnail = ""; //Set the url of the Thumbnail image
            var recipientName = "umusix_dev";//Set the name of the recipient
            var recipientProfileUrl = ""; // Set the url of the profile of the recipient

            var message = container.newMessage(messageText, params);
            // If not post back method is required you can set it to undefined.
            container.postTo(message, postback, recipientId, recipientName, recipientThumbnail, recipientProfileUrl);
        }

  • 05-07-2009 10:01 AM In reply to

    Re: ifpc open social token not set

    Which version of the library are you using?

  • 05-07-2009 10:18 AM In reply to

    Re: ifpc open social token not set

    Hello,

     to make the REST calls I am using this library: myspacel_php5_20080317

    for the ifpc I just downloaded the most recent demo.

    Basically what I am trying to do is get my application to do myspace specific things (i..e. invite friends to use the app, send messages...).

    I tried using the official library: myspace-da-php-download(the most recents one i am assuming) but i could not get  my application to validate.

    Everytime I made calls to get an oauth token the query string returned would always tell me that External Domain or oauth_callback uri is not set.

    If you have any advice on this issue I would greatly appreciate it.

    Thank you for your time :)

  • 05-11-2009 7:18 AM In reply to

    Re: ifpc open social token not set

     Have you looked at the SDKs? 

    I know they say myspace ID but they're actually good for both. 

    Also, make sure you download the latest ifpc.zip file which is now 0004

     

    Rhonda

    http://wiki.developer.myspace.com/index.php?title=Category:MySpaceID_SDK_for_PHP

     http://wiki.developer.myspace.com/index.php?title=How_to_access_JavaScript_libraries_from_an_IFrame_and_IFPC_call_Demo_Application

     

Page 1 of 1 (4 items)