FAQs - Events

Can I send Events from Cloud Code?

Yes. You can use SparkRequests to send Events using Cloud Code. Please see our Using SparkRequests API tutorial for more details and guidance on how to do this.

I've noticed that when I create an Event in the GameSparks console, on the Cloud Code page Scripts panel it's listed as both an Event and a Challenge Event - why both?

This is done in anticipation of the differing use cases you might want to achieve for your game using an Event and its attached Cloud Code. Events are meant for general uses cases such as posting scores to Leaderboards or getting player details. Challenge Events are meant to serve those use cases where your Cloud Code needs access to a Challenge context. For a fuller explanation, please see this Tips & Tricks article.

Is it possible to restrict player access to an Event until that Event is initiated by the completion of another Event?

Yes. Yes, this would be possible by using Segments to restrict player access based on value. So when that Event gets invoked, it gets the player's segment values. If that player's segment values subscribes that player to a certain membership, then they're allowed to run the Event, otherwise the Event remains hidden / locked.