Referrals Module on React Native
Configure the referral module on your React native app using Firebase. This module allow users or players to refer others with a referral link and gain points.
Configure Gameball With Your Firebase
Before you start, you must configure your Firebase on your Gameball account. Follow the steps in Configure your Firebase account on Gameball for mobile friends referral links article in our Help Center to configure your Firebase account on Gameball.
Integration Details
For dynamic links you can use react-native firebase package and follow the steps of dynamic links initialization. To get the initial link that is used to start the app, use:
If there is a link, call the getReferralCode function and pass the URL as a parameter:
After this, call addReferral function:
Parameter | Required | Description | Type |
| Required | referralCode extracted from the link | String |
| Required | player ID is a unique ID for you user. (eg. user email, UUID,.. etc.). The playerId is to be provided by the client and must be unique for each user. | String |
| Optional | Each player type has an ID | Integer |
| Optional | PlayerAttributes is a builder class which is used to add or update your player info to Gameball. Player object is described in Object Reference section. | Object |
| Optional | Mobile device token used for push notifications | String |
| Optional | Operating system of the device running the application | String |
Now, referral links will be generated successfully for your players!
Last updated