Developer Contributed hi5 OpenSocial FAQ
Feel free to contribute more topics and questions. If you are not sure where to fit a new question, put it under Miscellaneous and we'll work on re-organizing the content later.
You don't have to enter fully-answered questions, though of course, we'd prefer it if you not only asked questions but also shared your experiences so that other developers may benefit. Feel free to add your name and link to your hi5 profile or other website from here. See the formatting help page for help on how to add hyperlinks in this wiki.
Topics
Developer Console
- Do published apps use the latest version of the application XML file that's online even if the app is not refreshed in the dev console? Answer: Think of the "refresh" button as a "force refresh" feature. You need to keep the xml file accurate at all times as we may revisit that file to populate a cache, etc. If you are doing development or working on changes for another platform, we recommend that you use an alternate xml file (and URL) for testing.
- My app won't reload or be submitted for approval to the gallery. What's going wrong? Answer: The app won’t reload or be submitted to the gallery unless the attributes description, summary, thumbnail and icon are defined in the ModulePrefs tag
OpenSocial Implementation Questions
- Does hi5 support external content views (ContentType="URL")? Answer:
- How do I navigate to the canvas view without using requestNavigateTo? Answer: You can use the static URL that corresponds to the canvas view and use view-params to send it parameters that can be accessed in the canvas page with getParams. The static URL can be obtained from a user profile by seeing the target of the hyperlink labeled View at the top left of the Profile module.
- What fields are supported within the profile object?: Answer: The following fields are supported:
- "thumbnailUrl"
- "profileUrl"
- "gender"
- "status"
- "presence"
- "aboutMe"
- "age"
- "books"
- "birthday"
- "ethnicity"
- "interests"
- "languagesSpoken"
- "lookingFor"
- "music"
- "movies"
- "nickName"
- "relationshipStatus"
- "religion"
- "tvShows"
- What fields are supported within the FOAF object?: Right now public FOAF requests do not return additional information for the friends list, only references. If one submits a Hi5AuthToken you can get extended information, including name and profile Photo.
- Why do I get only the VIEWER's photos in the request to newFetchAlbumsRequest()?: For security purposes, we have hard coded the response to the newFetchAlbumsRequest() to only return the albums for the VIEWER of the application, regardless of the parameter set in the call that specifies which profile you want the photo album information for.
- Do you follow the RESTful spec of 0.8 with auth and XRDS? Answer: If you pass in a security token (with st=.....) then you'll be able to access more information. Without a security token we only return information explicitly marked public.
- I am unable to get the GENDER field from a person's profile. Answer: Note that gender is not in the default list of fields returned by the person request. One needs to add this field as a param. For example:
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =[opensocial.Person.Field.GENDER];req.add(req.newFetchPersonRequest('VIEWER', params), 'req'); - I am having trouble posting activities. Why is this? Answer: Please see this page on creating activities on hi5's OpenSocial Platform for more information on posting activities.
Authentication
- How do I sign my REST calls? Answer: We inject a Hi5AuthToken into the gadgets.view.getParams() hash. This lets you call backend services as that user. We are not using the API key to sign requests. In the summer of 2008, we plan to migrate to OAuth for this functionality.
- How long does the auth token stay valid before it expires? For all requests except notifications, the expiry is a day after generation; for notifications, it is 4 hours after generation.
Miscellaneous
- I use Joyent --- what steps can I take to get better performance? Answer: Edit /opt/local/etc/httpd/includes/keepalive.conf as follows: Change "KeepAlive Off" to "KeepAlive On". Then, execute "apachectl restart" on the command line.
- I am having problems with UTF-8 characters in my application XML Answer: There is a known bug in the UTF-8 handling of approved (not dev) applications. It's going out in a release soon. Until then you can replace UTF-8 characters with character entities. For example, the characters 'é' (the letter 'e' with a long accent) becomes the character entity é.