CodeName OneShai Almog5 min readintermediate
The Hard Part of Invite a Friend Is the Install
Summary
Codename One adds an invitation API that preserves a unique code through the install process on Android (via Play Install Referrer) and iOS (via App Clip) into the analytics stack. Create an Invite, register a listener at startup, and set a few build hints to get exact attribution without fingerprinting.
- Use `Invites.create` with `InviteRequest` to generate a local code and register it; sharing works offline.
- Three handoff paths—direct, Android install‑referrer, iOS App Clip—deliver the exact invitation code to the installed app.
- Register an `InviteListener` and call `Invites.checkForInvite()` in `start()` to receive attribution before UI loads.
- Add platform build hints (Android signing SHA‑256, iOS App Store ID, enable Associated Domains/App Clip) to wire the flow.
Any mobile developer building referral or invite flows needs reliable, privacy‑respecting attribution across install on Android and iOS.
6/10