Sign In Register

How can we help you today?

Start a new topic
Answered

How to add ListVirtualGoodsResponse custom script data ?

Hi,


i'm investigating how to add to the VirtualGoods item some kind of custom properties. I could have used the tags field and filling it with some JSON data but I prefer to use a more safe approach.

The idea is to store another metadata collection that contains the custom properties for the different items (say VirtualGoodsMeta collection)


When I retrieve the goods list I receive something like that:

"@class": ".ListVirtualGoodsResponse",
 "scriptData": null,
 "virtualGoods": [
...

]

So it seem possibile (to me) to append some custom script data to the response using a Cloud Script attached to ListVirtualGoodsResponse event (I presume)


I though something very simple like (just to start understand)

var metaCollection = Sparks.metadaCollection("testmeta");


Where to put that custom data ? I tried to figure out but the documentation is not very clear and it seem that no one in the forum asked something similar.

Is this possibile ? And in that case how can I implement that ?


ThankĀ 

Cristian



Best Answer

I've just fond my answer by myself :)

Just use the Spark.SetScriptData(...). I missed that information :(

1 Comment

Answer

I've just fond my answer by myself :)

Just use the Spark.SetScriptData(...). I missed that information :(