MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Is it possible to share data between app instances?

Last post 07-07-2008 7:21 PM by $cott. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-01-2008 12:09 AM

    Is it possible to share data between app instances?

    I need to be able to persist data between two instances of an app. Is this in any ways possible? Can a user view data stored for his/her friends app?
  • 07-04-2008 8:29 PM In reply to

    Re: Is it possible to share data between app instances?

    From the OpenSocial reference section:

    opensocial.DataRequest.newFetchPersonAppDataRequest(idSpec, keys)

    Creates an item to request app data for the given people. When processed, returns a Map< PersonId, Map<String, String>> object.
    parameters
    Array.<String>, String idSpec An ID, array of IDs, or a group reference; the supported keys are VIEWER, OWNER, VIEWER_FRIENDS, OWNER_FRIENDS, or a single ID within one of those groups
    Array.<String>, String keys The keys you want data for; this can be an array of key names, a single key name, or "*" to mean "all keys"
    returns
    Object A request object


    It looks like you can grab data for a friend by id, but you would only be able to grab data saved by this application instance

     

    Okay, a little more digging and I found these

    newFetchGlobalAppDataRequest 
    newFetchInstanceAppDataRequest 

     I'm assuming that Global allows you to share data between apps.  I couldn't find any documentation on it - other than a basic function description - so I'm hoping that is what you are looking for.  That's assuming, of course, that the App Data API is working Wink.

  • 07-05-2008 1:06 AM In reply to

    Re: Is it possible to share data between app instances?

    Alright! Thanks, I've been needing something like this for a while. now only if the Data API would be a little less broken.. I suppose I could implement it for now in the hopes that they will get it running smoother in the future haha (we can only hope).

    And I ran across global data before too, and thought I was saved, but then I read this forum post.

    Chad Russell:
    Hi all, we had to remove the ability to update global app data from the container for security reasons, sorry for any inconvenience!

     Oh well, but requesting the data by friend ID is all I really need for now.

  • 07-05-2008 1:24 AM In reply to

    Re: Is it possible to share data between app instances?

     Yeah, I ended up rolling my own as well.  I've got registration and unregistration working (when user installs or uninstalls app, via the callback).  I've also got a name/value data store that is keyed by user and application.  You can read values for another user easily, by providing the correct ID and authentication information.

  • 07-07-2008 7:10 PM In reply to

    Re: Is it possible to share data between app instances?

    Have you gotten opensocial.DataRequest.newFetchPersonAppDataRequest(idSpec, keys) to work? What's the syntax you would use for that, I can't seem to figure it out.
  • 07-07-2008 7:21 PM In reply to

    Re: Is it possible to share data between app instances?

     nope, I gave up

    I wrote my own app storage mechanism using webservices and a sql backend.  Works like a charm.

Page 1 of 1 (6 items)