Title

body
 
xxx of yyy characters
Hi5 Platform Development

Watch this Topic   watch
Messages 

1-9 of 9

Close Topic

Reason

Message



 
Topic: Passing appParams
Is there a way to pass parameters from the parent request string? On Myspace you can use an appParams bag.
Apr 1, 2008
11:56 PM
I should probably also state that this isn't an April Fool's joke
Apr 2, 2008
12:29 AM
Yes the parameter name is view-params instead of appParams on Hi5.
Posted by Phil 
Apr 2, 2008
10:40 AM
That's good news, but I can't seem to get it to work. Would it be possible to get an example? I try appending view-params to my canvas URI but it doesn't seem to make it to my application
Apr 2, 2008
5:14 PM
Did anyone get this to work? Can you pass parameters via appParams or view-params?
Posted by Peter 
May 12, 2008
3:34 PM
I happen to know, thanks to Roman Mazur, another developer on the forum, that Graffiti has been using this methodology for directing traffic from friend updates with view-params set. Perhaps someone from the Graffiti team can pitch in with their experience?

Sameer.
May 12, 2008
10:18 PM
Jeff, you can also parameters via the requestNavigateTo function. Here's a post from Lou to another thread that you might find helpful:

--------

http://code.google.com/apis/opensocial/docs/0.7/
reference/gadgets.views.html#requestNavigateTo

view-params are encoded in json format, not like query params. The opts you pass in to requestNavigateTo should be a map, and then the parameters are appended properly to the new view's url.


I whipped up a sample app that demonstrates proper usage - you should be able to get to the code here:

http://www.hi5.com/friend/apps/developer/app/get/xml/12867

hope that helps,
Lou
May 14, 2008
5:09 PM
yeah, even if you aren't using requestNavigateTo you can see the proper syntax for view-params if you execute the code in this example. it's encoded json notation, not encoded url query param notation. Here's a sample that works i snipped from a url, and represents path=http://hi5.com:
 view-params=%7B%22path%22%3A%22http%3A%2F%2Fhi5.com%22%7D 
which is view-params={"path":"http://hi5.com"} before encoding. pretty sure you can also get the right syntax by using gadgets.json.stringify:
 var viewParams = {};
viewParams['path'] = 'http://hi5.com';
var viewParamsStr = gadgets.json.stringify(viewParams);
var url = url + "?view-params=" + viewParamsStr; 
this is all accurate to opensocial spec. hope that helps.
May 14, 2008
5:27 PM
Yeah... I really believe that view-params=%7B%22path%22%3A%22http%3A%2F%2Fhi5.com%22%7D works. But the trouble is connected with posting such part of link to the profile updates section via FriendsUpdateService.
I really don't know how to encode view-params=%7B%22path%22%3A%22http%3A%2F%2Fhi5.com%22%7D properly in order to pass it as the value of the paramater 'title' or 'body' in the FriendsUpdate request.
Posted by Roman 
May 15, 2008
2:00 AM
1-9 of 9


Select Language