Skip to main content
Version: 1.6.0

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:

FieldDescription
App Link ๐Ÿค–Appโ€™s homepage or base referral link
Dynamic Link Domain ๐Ÿค–Dynamic link domain used for referral links
App Store LinkLink 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;
}