Welcome Developers!

in

Welcome!

in

How to send app invites using open-social php lib

Last post 03-01-2010 11:42 AM by Joel. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 02-19-2010 4:03 AM

    How to send app invites using open-social php lib

    Hi everyone,

    I am developing a local app on myspace using the open social php lib, and i need a way to allow users to send invitations to their friends.

    Can anyone say me how to do that.

     Thanks in advance.

    Filed under:
  • 02-19-2010 4:25 PM In reply to

    Re: How to send app invites using open-social php lib

     Hicham,

     We should update this soon, but all we currently have is old 0.7 Opensocial code:

     <h1>You know someone who would love this app? Invite away.</h1>

    <div id="picker"></div>

    <script>

    MyOpenSpace.ClientLibraries.includeScript(MyOpenSpace.ClientLibraries.Scripts.MYSPACE_WIDGETS);

    MyOpenSpace.Widgets.Bootstrapper.createWidget("MyOpenSpace.Widgets.FriendPicker",
        function(p){window.friendPicker = p;},
        {
            element: "picker",
            buildSelectedUI: true,
                    friendClickAction: sendAppAdd
        });

    function sendAppAdd(person){
    if(person == null){
            return;
        }


         message = opensocial.newMessage("[sender] would like you to install this really super application [app].");

         infectedName = person.getField(opensocial.Person.Field.NAME);

        opensocial.requestShareApp(person.getField(opensocial.Person.Field.ID), message, function(){
               alert("You've spread some love to " + infectedName);
          }
         );
    }

    </script>

     

     

    thanks,

    Joel

     

  • 02-22-2010 2:00 AM In reply to

    Re: How to send app invites using open-social php lib

    Joel,
              But this code doesn't work in IFrame apps. The script error console says, 'MyOpenSpace.Clientlibraries undefined'. Is there anything to be included in the code to make it work?

  • 02-22-2010 11:50 PM In reply to

    • Hicham
    • Not Ranked
    • Joined on 02-04-2010
    • Posts 1

    Re: How to send app invites using open-social php lib

    Deleted because not well formatted using Chrome
  • 02-22-2010 11:56 PM In reply to

    Re: How to send app invites using open-social php lib

    Hi everyone,

    I an alternative solution in this link http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=124833

    But it did not work for me, here is my code:

    <head>
        <script type="text/javascript" src="http://js.myspacecdn.com/OpenSocial/RPC/RpcContainer.003.js"></script>
        <script type="text/javascript" src="js/IFPC_externalIframe006.js" ></script>
        <script type="text/javascript">
            gadgets.rpc.setRelayUrl('..', 'http://profile.myspace.com/Modules/Applications/Pages/rpc_relay.aspx');
            MyOpenSpace.MySpaceContainer.get().registerParam("panelId", "apppanel_XXXXXX_canvas");
            MyOpenSpace.MySpaceContainer.get().registerParam("localRelay", "http://www.my_domain.tld/includes/ifpc_relay_external002.html");
        </script>
    </head>

    <body>
    <script type="text/javascript">
    var container = MyOpenSpace.MySpaceContainer.get();
    var recipients = ["00000000","00000000"];

    var reason = "please install this app!";
    var params = {};
    var message = container.newMessage(reason, params);

    function shareApp()
    {
        var callback = function(response){
            // Do wathever
        }
       
        container.requestShareApp(recipients, message, callback);
    }
    </script>


    </body>

    Please tell me what's wrong with my code and help me to solve this.

    It shows me an error message "Attention ! Un problème est survenu lors du traitement de ta requête."

  • 02-23-2010 2:32 PM In reply to

    Re: How to send app invites using open-social php lib

    I will look into this problem. Unfortunately, this is all the invite sample code I have. I will see if there is some means to get it to work in an iframe.

     

    thanks,

    Joel

  • 02-24-2010 12:22 AM In reply to

    Re: How to send app invites using open-social php lib

     Thanks a lot

  • 02-24-2010 2:56 PM In reply to

    Re: How to send app invites using open-social php lib

    I am not sure if this is exactly what you need, but I am putting it here anyway:

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

     

     

    thanks,

    Joel

  • 03-01-2010 1:22 AM In reply to

    Re: How to send app invites using open-social php lib

     that's what i did the code is above , but i didn't work for me

  • 03-01-2010 8:45 AM In reply to

    Re: How to send app invites using open-social php lib

    See my post helps you http://developer.myspace.com/Community/forums/t/9612.aspx

  • 03-01-2010 11:42 AM In reply to

    Re: How to send app invites using open-social php lib

    Hi, one of our developers just informed me that you don’t need the friend picker to send invites. Here’s the invite doc:

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

     

    There is a requestShareApp method which can be employed. See the example on this page.

     

    thanks,

    Joel

Page 1 of 1 (11 items)