Referral System
The Referral System module allows users to send referral invite links and rewards referrers/recipients when conditions are met.
This feature is Android-only (no iOS referral system doc in the current official SDK documentation).
Configuration is done via the Settings Inspector in Unity.
Configuration is applied automatically at build time for each platform.
Platform markersโ
The following markers are used to indicate platform availability of parameters and features:
- (no marker) โ Shared parameter or feature
- ๐ โ iOS-specific parameter or feature
- ๐ค โ Android-specific parameter or feature
- โ ๏ธ โ Not implemented in the Unity plugin yet
Ask your release manager for the required parameters before configuring the SDK.
Configureโ
Fill the following fields in the Settings Inspector:
| Field | Description |
|---|---|
| App Link ๐ค | Appโs homepage or base referral link |
| Dynamic Link Domain ๐ค | Dynamic link domain used for referral links |
| App Store Link | Link to the app in the App Store / Google Play |
| Referral App Store Id๐ค | Application ID in the App Store / Play Store |
| App Invite Message ๐ค | Default referral invite message shown to users |
The Unity Settings Inspector must include these fields so the SDK can use them to generate referral URLs.
Usageโ
Send Referral Inviteโ
To send a referral invite link, call:
P101XP.GetInstance().SendInviteLink("event_referrer_invite");
Referral Reward Callbacksโ
Subscribe to referral reward events using your Unity wrapperโs referral listener interface:
private void OnRewardedInviteLinkSender(RewardedInviteLinkResult result)
{
// Called after the user (sender) qualifies for a referral reward
}
private bool OnRewardedInviteLinkRecipient(RewardedInviteLinkRecipientResult result)
{
// Called for the referral recipient
// Return true if conditions for reward are met (for example, reached a level)
}
Attach the callbacks:
P101XP.GetInstance().RewardedInviteLinkSenderEvent += OnRewardedInviteLinkSender;
P101XP.GetInstance().RewardedInviteLinkRecipientEvent += OnRewardedInviteLinkRecipient;
Result Payload Objectsโ
public class RewardedInviteLinkResult
{
public string eventName;
}
public class RewardedInviteLinkRecipientResult
{
public string referrer;
public string eventName;
}