What are server hooks?
Server hooks are scripts on the server side that get executed automatically exactly before or after (pre-save or post-save) creating or updating an entity in a collection.
The two types of server hooks you can define for a collection are:
- Pre Save: Triggers before an entity is created or updated.
- Post Save: Triggers after an entity is created or updated.
These can be useful to calculate an extra field with some of the fields in the entity or to validate the expected data (if the entity is not filled correctly, you can reject the request and avoid storing wrong data).
You can find a couple of server hook examples here in the Server Code guide.
Keep in mind that Pre Save server hooks will be executed before Gamedonia API Response, so they have an impact on the execution time. This doesn't happen with the Post Save server hooks.
More info here: Server code guide
-
Common Problems
- I get a "400 Bad Call to API" error when updating an object
- I get a "500 Internal Server Error" when calling an API method
- I get "Unable to convert classes to dex format" error when building for Android
- I get "JsonException: Max allowed object depth reached while trying to export from type System.Single..." error
- Is Gamedonia compatible with Unity 4.x?
- View all (1 more)
-
User management
-
Data Storage
-
Push Notifications
-
Server Code
-
In-app Purchases
-
Downloadable Content
-
Facebook Integration
-
Turn-based games
-
Deployment
-
Backend & Realtime
-
General