opensocialjive

Jive - Get current blog post from app


I'm developing an app which has a Content Action and an !app Action.

I would like to get via javascript (i.e. Open Social API I suposse...) the current user (I got it!) and the current blog post (blogpost id) from both actions.

Is it possible?

Thank you!


Solution

  • I found it!

    You can do it adding an gadgets.util.registerOnLoadHandler() listener, and inside it you should call the osapi.jive.core.container.getLaunchContext(function (selection) {});

    From selection object you can get the type and the id:

    var type = selection.jive.content.type;  
    var contentid = selection.jive.content.id  
    

    You have a full example from Jive Developers Website