Thanks, I haven't tried that but won't that just get me the balance of the virtual currency? I was looking for the currency cost of a virtual good. I did some digging around and found I can get the value using the rest api for Virtual goods. it's mapped under currencyCostMap ? but it's not available in the JSON returned from ListVirtualGoods when using cloud code.
I tried SparkConfig.getVirtualGoods() but I'm getting a "ReferenceError: "SparkConfig" is not defined "when I run it in the test harness.
Thanks for your help
Quentin
Tech Support
said
over 5 years ago
Hi Quentin,
To get an instance of a SparkConfig object, you need to use Spark.getConfig(), e.g.
var virtualGoods = Spark.getConfig().getVirtualGoods();
Quentin Timmons
Okay how do I access a custom currency from GameSparks.Api.Responses.ListVirtualGoodsResponse._VirtualGood?
I can see there is a currencyCosts in the returned response but how do I access it with the Unity SDK?
Thanks
Quentin
Hi Quentin,
Sorry for the late reply. Our SDK will update shortly to allow you to interact with the new currency system. I apologise for the delay.
It will be:
Cheers,
Omar
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstTech Support
Hi Quentin,
Sorry for the late reply. Our SDK will update shortly to allow you to interact with the new currency system. I apologise for the delay.
It will be:
Cheers,
Omar
Quentin Timmons
Tech Support
Have this in your event's cloud code:
Cheers,
Omar
Quentin Timmons
Thanks, I haven't tried that but won't that just get me the balance of the virtual currency? I was looking for the currency cost of a virtual good. I did some digging around and found I can get the value using the rest api for Virtual goods. it's mapped under currencyCostMap ? but it's not available in the JSON returned from ListVirtualGoods when using cloud code.
I tried SparkConfig.getVirtualGoods() but I'm getting a "ReferenceError: "SparkConfig" is not defined "when I run it in the test harness.
Thanks for your help
Quentin
Tech Support
Hi Quentin,
To get an instance of a SparkConfig object, you need to use Spark.getConfig(), e.g.
var virtualGoods = Spark.getConfig().getVirtualGoods();
Hope this helps,
Jon.
Quentin Timmons
-
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