Entrypoint (Cocos)
The entrypoint is “how the player got into this session”. A fresh launch looks different from a notification‑tap looks different from a friend’s game‑invite. If you handle this well, players land exactly where they meant to go.
Typical pattern
Section titled “Typical pattern”The fields
Section titled “The fields”getEntrypointName()returns a short channel‑supplied string like'notification_tap','game_invite','share','direct','home'.getEntrypointData()returns the arbitrary JSON payload attached when the entry was created (from a share sheet, a scheduled push, an invite, …).
Treat the payload as untrusted input — it comes from another client (or from channel URL params). Validate before you use it.
When there’s nothing to act on
Section titled “When there’s nothing to act on”name === 'direct' / 'home' / null all mean “the player just launched the game”. Route them to your normal start screen.
Related
Section titled “Related”- What channels put in the payload: Web SDK entrypoint.