public class

ReferralCode

extends Object
implements Serializable
java.lang.Object
   ↳ 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:

userId
8 characters that uniquely identifies the user/app combination.
shareId
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.

Summary

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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean equals (Object o)

public String getShareId ()

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

public String getUserId ()

Returns
  • the userId part of the referral code.

public int hashCode ()

public String toString ()

Returns
  • The concatenation of userId and shareId

public String toString (boolean verbose)

A more verbose stringified version of the referral code.

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