How to add ListVirtualGoodsResponse custom script data ?
C
Cristian Marastoni
started a topic
almost 8 years ago
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:
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
C
Cristian Marastoni
said
almost 8 years ago
I've just fond my answer by myself :)
Just use the Spark.SetScriptData(...). I missed that information :(
1 Comment
C
Cristian Marastoni
said
almost 8 years ago
Answer
I've just fond my answer by myself :)
Just use the Spark.SetScriptData(...). I missed that information :(
Cristian Marastoni
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:
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
I've just fond my answer by myself :)
Just use the Spark.SetScriptData(...). I missed that information :(
Cristian Marastoni
I've just fond my answer by myself :)
Just use the Spark.SetScriptData(...). I missed that information :(
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics