public class


extends Object
implements Serializable
   ↳ co.megacool.megacool.ReferralCode

Class Overview

A referral code is the magic part tacked on to URLs shared through the SDK that allows us to credit a user for inviting others. You do not need to create these yourself, but they might be useful if you want to identify specific users as seen by Megacool.

A referral code consists of two parts:

8 characters that uniquely identifies the user/app combination.
2+ characters that identifies a given share. This enables us to associate each share with a GIF.

The userId is assigned from the server-side the first time the app gets online, but it's possible to create shares before this happens. These shares will be associated with a referral code that doesn't have a userId yet.


Public Methods
boolean equals(Object o)
String getShareId()
String getUserId()
int hashCode()
String toString()
String toString(boolean verbose)
A more verbose stringified version of the referral code.
Inherited Methods
From class java.lang.Object

Public Methods

public boolean equals (Object o)

public String getShareId ()

  • the shareId part of the referral code or an empty string if it's not set

public String getUserId ()

  • the userId part of the referral code.

public int hashCode ()

public String toString ()

  • The concatenation of userId and shareId

public String toString (boolean verbose)

A more verbose stringified version of the referral code.

verbose pass true to get a verbose representation, otherwise it'll be the same output as toString().
  • a verbose stringified version of the referral code if verbose is true, otherwise a concatenation of the userId and shareId.