Welcome Developers!

in

Welcome!

in

postTo callback?

Last post 04-29-2008 6:51 PM by Chad Russell. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-18-2008 5:18 PM

    postTo callback?

    I just want to confirm that postTo and using a callback to be notified when it's complete isn't functional yet right?

    Is this something that will be available in the next two weeks?

    Here is my idea:

    1. get list of friends to invite
    2. iterate thru each one
    3. postTo for each one
    4. onPost callback -- increment a counter on success
    5. invite the next friend in list from step 1
    6. rinse/repeat till completed

    Thanks,

    -bcc 

  • 04-21-2008 12:01 AM In reply to

    Re: postTo callback?

     Has there ever been a response as to whether this has been enabled or not.  I can't find any info on actual implementation.  Notes say that will only respond with success/fail.  Does that translate into sent/cancelled or will a cancelled return true?  If a user creates a message with an interface developed by a developer and then it hands over to postTo how can we ascertain what's happened.  

     I tried to submit an app earlier today and was denied partially based on the fact that I didn't post that the message was sent successfully.  How do we tell if the message was sent succesfully?  If there's no way for us to accomplish that right now I don't see why an application should be denied based on a lack of functionallity of the current implementation.

     Any thoughts on this would be appreciated.

     Also is the profile app mandatory?  An app to send messages to  your friends seems like it only needs a home gadget to navigate you to the surface where postTo is currently supported.

     Thanks,

    DN 

  • 04-24-2008 12:35 PM In reply to

    Re: postTo callback?

    The PostTo callback should be working now, it'll return a 1 for success, a 0 if the user cancelled and a -1 if some unexpected error occurred.

     

  • 04-24-2008 12:59 PM In reply to

    Re: postTo callback?

     There is also an enum value:

     MyOpenSpace.PostTo.Result.ERROR

    MyOpenSpace.PostTo.Result.CANCELLED

    MyOpenSpace.PostTo.Result.SUCCESS

    Below is some example code:

     


    <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>
    
    <h1>Call Me Back</h1>
    
    <button onclick="postBlogCallback()">Blog post with callback</button>
    
    
    
    
    Filed under:
  • 04-24-2008 3:27 PM In reply to

    • Luke
    • Top 500 Contributor
    • Joined on 02-05-2008
    • Posts 23

    Re: postTo callback?

    I echo Brian's sentiment, I would like to have the ability to postTo multiple users. However, it's cumbersome to force a user through a series of postTo dialogs. Could MySpace make postTo support multiple person recipients? Obviously, incorporate some sort of rate limiting :-). As it stands right now I have to decide between using send message to a single user or impersonally blast a bulletin to all of a user's friends. This is not a very granular choice.

  • 04-24-2008 4:42 PM In reply to

    Re: postTo callback?

    Thanks for the code sample. I've been waiting for this callback so I can better track invites instead of just assuming the user actually sent the invite message. Everything appears to be working as described :) 

  • 04-29-2008 5:06 AM In reply to

    Re: postTo callback?

    But this doesnt works in IE. someval is returned as "undefined" there.

  • 04-29-2008 6:51 PM In reply to

    Re: postTo callback?

    Yep, you're right, we've got a fix coming for this. 

Page 1 of 1 (8 items)