Customizing Referral Code
The test app provided with the AppVirality SDK 2.0 has a pre-implemented feature that allows users to modify/customize their Referral Code. This sort of personalization is the current fashion when it comes to Referral Codes.
How can a User Modify/Customize Referral Code
Taking the example from an app that may have implemented the Default UI project for the Referral Screen, as is done in the Test App, we will see how the user can easily change the Referral Code.
Step 1: Launch Referral Screen

Step 2: Toggle to Earnings Tab

Step 3: Expand “Your Personal Referral Code” pane

Step 4: Enter your new Referral Code & Save
Your new and customized Referral Code is now active.
The Referral Code customization can be added as a standalone feature for your Referral program too, as and wherever you please.
As described above, make sure you have a field to receive the new custom Referral Code.
After the user enters the Referral Code and commits to customize it (by a click action on a Button like Save etc.), send the newly entered Referral Code to the AppVirality SDK through the below mentioned method:
appVirality.customizeReferralCode(newReferralCode, new AppVirality.CustomizeRefCodeListener() { @Override public void onCustomRefCodeSet(boolean isSuccess, String errorMsg) { try { if (isSuccess) { // Referral Code changed successfully. Update the same in your // local campaign details instance. } else { // Referral Code couldn't be changed, check errorMsg to know // the cause of failure. } } catch (Exception e) { } }});Note that in the above code block we advise you to update the newly obtained Referral Code in your local campaign instance.
What happens to Old Referral Code?
Once updated, the new referral code is the de facto Referral identifier for the user. Any instances of the old referral code shall become irrelevant.
So if someone clicks on an old referral link or uses the old Referral code to sign-up, their Referral linkage would fail and hence the new user would not receive rewards. Make sure you handle this use case with appropriate error handling.
