I m new user, and looking service for realtime turn based game, i have checked all documentation and codes, but its difficult to understand me, can u please link me some examples of android, so i can study that codes.
Thanks.
Best Answer
C
Customer Support
said
over 8 years ago
Hi Swapnil,
First of all, apologies for the delay in answering your questions. At this time we only have in-depth tutorials for Unity3D which you can find on on our Tutorials page on our Learn section.
The tutorial there covers logging in users via Facebook, creating a leaderboard and posting and retrieving scores.
We have a new video tutorial specifically for doing challenges in Unity on Youtube which you can view by clicking here. The documentation for this video series is not yet ready as we want to ensure it's quality and ease of use. It should be ready in the next couple of days.
Even though the videos are for Unity, the process is almost the exact same for the Android SDK and can be easily followed, only requests are coded differently while setting up the portal and cloud code are the same regardless of engine.
In Unity a CreateChallengeRequest() looks like:
//we use CreateChallengeRequest with the shortcode of our challenge, we set this in our GameSparks Portal
new CreateChallengeRequest().SetChallengeShortCode("ticTacToe")
.SetUsersToChallenge(userIds) //We supply the userIds of who we wish to challenge
.SetEndTime(System.DateTime.Today.AddDays(1)) //We set a date and time the challenge will end on
.SetChallengeMessage("I've challenged you to Tic Tac Toe!") // We can send a message along with the invite
.Send((response) =>
{
if (response.HasErrors)
{
Debug.Log(response.Errors);
}
else
{
//Show message saying sent!;
}
});
In Java that would be:
Map<string, object> data = new HashMap<string, object>();
data.put("@class" : ".CreateChallengeRequest"); //The type of request we're sending
data.put("challengeShortCode" : "ticTacToe"); //The shortcode of the challenge we created on the portal
data.put("endTime" : "2013-12-31T12:00Z"); //When the challenge ends
data.put("usersToChallenge" : "524c13c7e4b0f3abf2b1ddc0"); //The users we want to challenge
Map<string, object> result = gamesparksApi.send(data); //Send our request
Similarly, to list all running challenges and get information from them your ListChallengeRequest() in Unity looks like:
new ListChallengeRequest().SetShortCode("ticTacToe") //List all challenges with the shortcode "ticTacToe"
.SetState("RECEIVED") //We only want to get games that we've received
.SetEntryCount(50) //We want to pull in the first 50 we find
.Send((response) => //The data we want is stored in the response
{
foreach (var challenge in response.ChallengeInstances)
{
string challengeId = challenge.ChallengeId;
}
}
In Java it would look like:
Map<string, object> data = new HashMap<string, object>();
data.put("@class" : ".ListChallengeRequest"); //List all challenges
data.put("shortCode" : "ticTacToe"); //with the shortcode "ticTacToe"
data.put("state" : "Running"); //Retrieve currently running games
data.put("entryCount" : 100); //Grab the first 100 we find
Map<string, object> result = gamesparksApi.send(data); //Send our request, the data we want is stored in the result.
It seems that GameSparks is not interested to reply this thread, also have very poor tutorials, so its impossible to understand to newbies.
Customer Support
said
over 8 years ago
Swapnil
Our customer services team is working on completing a tutorial that will work for you right now. The tutorial will be complete with documents, videos and sample code. Please just bear with us.
John.
Customer Support
said
over 8 years ago
Answer
Hi Swapnil,
First of all, apologies for the delay in answering your questions. At this time we only have in-depth tutorials for Unity3D which you can find on on our Tutorials page on our Learn section.
The tutorial there covers logging in users via Facebook, creating a leaderboard and posting and retrieving scores.
We have a new video tutorial specifically for doing challenges in Unity on Youtube which you can view by clicking here. The documentation for this video series is not yet ready as we want to ensure it's quality and ease of use. It should be ready in the next couple of days.
Even though the videos are for Unity, the process is almost the exact same for the Android SDK and can be easily followed, only requests are coded differently while setting up the portal and cloud code are the same regardless of engine.
In Unity a CreateChallengeRequest() looks like:
//we use CreateChallengeRequest with the shortcode of our challenge, we set this in our GameSparks Portal
new CreateChallengeRequest().SetChallengeShortCode("ticTacToe")
.SetUsersToChallenge(userIds) //We supply the userIds of who we wish to challenge
.SetEndTime(System.DateTime.Today.AddDays(1)) //We set a date and time the challenge will end on
.SetChallengeMessage("I've challenged you to Tic Tac Toe!") // We can send a message along with the invite
.Send((response) =>
{
if (response.HasErrors)
{
Debug.Log(response.Errors);
}
else
{
//Show message saying sent!;
}
});
In Java that would be:
Map<string, object> data = new HashMap<string, object>();
data.put("@class" : ".CreateChallengeRequest"); //The type of request we're sending
data.put("challengeShortCode" : "ticTacToe"); //The shortcode of the challenge we created on the portal
data.put("endTime" : "2013-12-31T12:00Z"); //When the challenge ends
data.put("usersToChallenge" : "524c13c7e4b0f3abf2b1ddc0"); //The users we want to challenge
Map<string, object> result = gamesparksApi.send(data); //Send our request
Similarly, to list all running challenges and get information from them your ListChallengeRequest() in Unity looks like:
new ListChallengeRequest().SetShortCode("ticTacToe") //List all challenges with the shortcode "ticTacToe"
.SetState("RECEIVED") //We only want to get games that we've received
.SetEntryCount(50) //We want to pull in the first 50 we find
.Send((response) => //The data we want is stored in the response
{
foreach (var challenge in response.ChallengeInstances)
{
string challengeId = challenge.ChallengeId;
}
}
In Java it would look like:
Map<string, object> data = new HashMap<string, object>();
data.put("@class" : ".ListChallengeRequest"); //List all challenges
data.put("shortCode" : "ticTacToe"); //with the shortcode "ticTacToe"
data.put("state" : "Running"); //Retrieve currently running games
data.put("entryCount" : 100); //Grab the first 100 we find
Map<string, object> result = gamesparksApi.send(data); //Send our request, the data we want is stored in the result.
Hope that helps,
Shane
S
Swapnil Gawali
said
over 8 years ago
Thanks for your reply, I am Java Developer, and i dont have any knowledge of C#, please let us know, when Java guides and tutorials will be available?
g
gaurav dubey
said
about 6 years ago
HI ,
I am newer with this and want to any demo or sample for android development .Please share link or any reference.
Swapnil Gawali
Hi GS,
I m new user, and looking service for realtime turn based game, i have checked all documentation and codes, but its difficult to understand me, can u please link me some examples of android, so i can study that codes.
Thanks.
Hi Swapnil,
First of all, apologies for the delay in answering your questions. At this time we only have in-depth tutorials for Unity3D which you can find on on our Tutorials page on our Learn section.
The tutorial there covers logging in users via Facebook, creating a leaderboard and posting and retrieving scores.
We have a new video tutorial specifically for doing challenges in Unity on Youtube which you can view by clicking here. The documentation for this video series is not yet ready as we want to ensure it's quality and ease of use. It should be ready in the next couple of days.
Even though the videos are for Unity, the process is almost the exact same for the Android SDK and can be easily followed, only requests are coded differently while setting up the portal and cloud code are the same regardless of engine.
In Unity a CreateChallengeRequest() looks like:
In Java that would be:
Similarly, to list all running challenges and get information from them your ListChallengeRequest() in Unity looks like:
In Java it would look like:
Hope that helps,
Shane
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstSwapnil Gawali
It seems that GameSparks is not interested to reply this thread, also have very poor tutorials, so its impossible to understand to newbies.
Customer Support
Swapnil
Our customer services team is working on completing a tutorial that will work for you right now. The tutorial will be complete with documents, videos and sample code. Please just bear with us.
John.
Customer Support
Hi Swapnil,
First of all, apologies for the delay in answering your questions. At this time we only have in-depth tutorials for Unity3D which you can find on on our Tutorials page on our Learn section.
The tutorial there covers logging in users via Facebook, creating a leaderboard and posting and retrieving scores.
We have a new video tutorial specifically for doing challenges in Unity on Youtube which you can view by clicking here. The documentation for this video series is not yet ready as we want to ensure it's quality and ease of use. It should be ready in the next couple of days.
Even though the videos are for Unity, the process is almost the exact same for the Android SDK and can be easily followed, only requests are coded differently while setting up the portal and cloud code are the same regardless of engine.
In Unity a CreateChallengeRequest() looks like:
In Java that would be:
Similarly, to list all running challenges and get information from them your ListChallengeRequest() in Unity looks like:
In Java it would look like:
Hope that helps,
Shane
Swapnil Gawali
Thanks for your reply, I am Java Developer, and i dont have any knowledge of C#, please let us know, when Java guides and tutorials will be available?
gaurav dubey
HI ,
I am newer with this and want to any demo or sample for android development .Please share link or any reference.
-
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