Hey, In my game i want players to be able to send challenge requests to other that include an image upload that the player accepting the challenge will download. So the challenge itself is sending a painted image to other players.
I know how to send a challenge and upload an image but how do i associate them together ? cloud script ? other way ?
Best Answer
C
Customer Support
said
over 3 years ago
Okay, so if you have the id/shortCode of your uploadable, you can include it in the message you are going to send with the CreateChallengeRequest. Then, each player who receives the message can separately get the image URL.
This is actually the best option. The other way is to create a wrapper request that takes all the details you need to create a challenge including the uploadableID. You call a GetUploadablesRequest from that event and get the URL back. Then you call the CreateChallengeRequest from within that request (there is an example of that in the link above too) with the url included in the message. Doing things this way means that the URL might not be valid by the time a player sees it, as the URL is only valid for 30mins.
I'm using the Gamespraks GetUploadUrlRequest like in this example : Unity-Upload-images so i the images are uploaded to the uploadedFiles System Collection.
Customer Support
said
over 3 years ago
Answer
Okay, so if you have the id/shortCode of your uploadable, you can include it in the message you are going to send with the CreateChallengeRequest. Then, each player who receives the message can separately get the image URL.
This is actually the best option. The other way is to create a wrapper request that takes all the details you need to create a challenge including the uploadableID. You call a GetUploadablesRequest from that event and get the URL back. Then you call the CreateChallengeRequest from within that request (there is an example of that in the link above too) with the url included in the message. Doing things this way means that the URL might not be valid by the time a player sees it, as the URL is only valid for 30mins.
Does that make sense? Sean
A
Aviv Zvulun
said
over 3 years ago
Hey Sean, this dentally make sense.
When you say to include the upload id in the message with the Create Challenge request ,you mean to use the challengeMessage field for the upload id right ?
Customer Support
said
over 3 years ago
Yep. You could add it in there. It could be useful to to do something like "Here is my Message%"+uploadID .... that way you could split the string to get the uploadID but also keep a challenge message to your opponents
Aviv Zvulun
Hey, In my game i want players to be able to send challenge requests to other that include an image upload that the player accepting the challenge will download.
So the challenge itself is sending a painted image to other players.
I know how to send a challenge and upload an image but how do i associate them together ? cloud script ? other way ?
This is actually the best option. The other way is to create a wrapper request that takes all the details you need to create a challenge including the uploadableID. You call a GetUploadablesRequest from that event and get the URL back. Then you call the CreateChallengeRequest from within that request (there is an example of that in the link above too) with the url included in the message.
Doing things this way means that the URL might not be valid by the time a player sees it, as the URL is only valid for 30mins.
Does that make sense?
Sean
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Where is your image uploaded to?
Sean
Aviv Zvulun
Hey Sean,
I'm using the Gamespraks GetUploadUrlRequest like in this example : Unity-Upload-images
so i the images are uploaded to the uploadedFiles System Collection.
Customer Support
This is actually the best option. The other way is to create a wrapper request that takes all the details you need to create a challenge including the uploadableID. You call a GetUploadablesRequest from that event and get the URL back. Then you call the CreateChallengeRequest from within that request (there is an example of that in the link above too) with the url included in the message.
Doing things this way means that the URL might not be valid by the time a player sees it, as the URL is only valid for 30mins.
Does that make sense?
Sean
Aviv Zvulun
Hey Sean, this dentally make sense.
When you say to include the upload id in the message with the Create Challenge request ,you mean to use the challengeMessage field for the upload id right ?
Customer Support
1 person likes this
Aviv Zvulun
Great thank you for your help!
-
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 2486 topics