I am relatively new to gamesparks and I am trying to figure out how to use downloadables. The documentation doesn't seem to be helping me in how to implement downloadable using the unity sdk. I just want to know how to download a file onto my application in general and I cannot figure it out right now. Any help would be appreciated. Thank you.
Best Answer
C
Customer Support
said
almost 6 years ago
Hi Marc
Once you have your downloadable set up in the GameSparks portal.
You can use a getDownloadablerequest to get a URL for the downloadable
In Unity the code for this is
using GameSparks.Api;
using GameSparks.Api.Requests;
using GameSparks.Api.Responses;
new GetDownloadableRequest()
.SetShortCode(shortCode)
.Send((response) => {
DateTime? lastModified = response.LastModified;
GSData scriptData = response.ScriptData;
string shortCode = response.ShortCode;
var size = response.Size;
string url = response.Url;
});
In Unity you can use WWW to get the file and then save it.
Regards
Katie
1 Comment
Customer Support
said
almost 6 years ago
Answer
Hi Marc
Once you have your downloadable set up in the GameSparks portal.
You can use a getDownloadablerequest to get a URL for the downloadable
In Unity the code for this is
using GameSparks.Api;
using GameSparks.Api.Requests;
using GameSparks.Api.Responses;
new GetDownloadableRequest()
.SetShortCode(shortCode)
.Send((response) => {
DateTime? lastModified = response.LastModified;
GSData scriptData = response.ScriptData;
string shortCode = response.ShortCode;
var size = response.Size;
string url = response.Url;
});
In Unity you can use WWW to get the file and then save it.
Marc Wilk
Hi Marc
Once you have your downloadable set up in the GameSparks portal.
You can use a getDownloadablerequest to get a URL for the downloadable
In Unity the code for this is
using GameSparks.Api;
using GameSparks.Api.Requests;
using GameSparks.Api.Responses;
new GetDownloadableRequest()
.SetShortCode(shortCode)
.Send((response) => {
DateTime? lastModified = response.LastModified;
GSData scriptData = response.ScriptData;
string shortCode = response.ShortCode;
var size = response.Size;
string url = response.Url;
});
In Unity you can use WWW to get the file and then save it.
Regards
Katie
Customer Support
Hi Marc
Once you have your downloadable set up in the GameSparks portal.
You can use a getDownloadablerequest to get a URL for the downloadable
In Unity the code for this is
using GameSparks.Api;
using GameSparks.Api.Requests;
using GameSparks.Api.Responses;
new GetDownloadableRequest()
.SetShortCode(shortCode)
.Send((response) => {
DateTime? lastModified = response.LastModified;
GSData scriptData = response.ScriptData;
string shortCode = response.ShortCode;
var size = response.Size;
string url = response.Url;
});
In Unity you can use WWW to get the file and then save it.
Regards
Katie
1 person likes this
-
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