Megacool Unity
The Unity interface to the Megacool SDK
|
A share sent from the Megacool SDK. You don't create shares directly, you create a MegacoolShareConfig
and pass it to either Megacool.Instance.DefaultShareConfig
or Megacool.Instance.Share()
, or you might receive shares sent from others by clicking on them.
More...
Public Types | |
enum class | ShareState { SENT = 0 , CLICKED , OPENED , INSTALLED } |
Different states a share can be in. All shares start as SENT , becomes CLICKED when it has had at least one link click, and then becomes either OPENED or INSTALLED . More... | |
Public Member Functions | |
MegacoolShare (MegacoolReferralCode referralCode, ShareState state, DateTime createdAt, DateTime updatedAt, Dictionary< string, object > data, Uri url) | |
override string | ToString () |
Properties | |
MegacoolReferralCode | ReferralCode [get] |
Get the unique referral code for the share. More... | |
ShareState | State [get] |
How far the share has come towards generating an install. More... | |
DateTime | CreatedAt [get] |
When the share was created. More... | |
DateTime | UpdatedAt [get] |
When the share object was last updated (changed state). This is the same as CreatedAt if the share has never been updated. More... | |
Dictionary< string, object > | Data [get] |
Data associated with the share object to customize the user experience or adding additional information for each share. More... | |
Uri | Url [get] |
Get the URL that is associated with the share object. More... | |
A share sent from the Megacool SDK. You don't create shares directly, you create a MegacoolShareConfig
and pass it to either Megacool.Instance.DefaultShareConfig
or Megacool.Instance.Share()
, or you might receive shares sent from others by clicking on them.
|
strong |
Different states a share can be in. All shares start as SENT
, becomes CLICKED
when it has had at least one link click, and then becomes either OPENED
or INSTALLED
.
Note that the state only moves in one direction, towards the best outcome that has come from it. Thus a share that receives several link clicks where some lead to re-engagements (OPENED
) and some to an install, once the first install happens the state will never change from INSTALLED
.
To keep more granualar track of how many installs or re-engagements a share has generated you need to listen to the Megacool.Instance.OnSentShareOpened
delegate and keep count yourself.
|
get |
When the share was created.
The time the share was created.
|
get |
Data associated with the share object to customize the user experience or adding additional information for each share.
Note that properties set in the MegacoolShareConfig.Data
when the share was created might not be available when the share is received from a MegacoolReceivedShareOpenedEvent
or MegacoolSentShareOpenedEvent
if the network request to create the share failed. Thus you should always assume a key might be missing from the data.
The data.
|
get |
Get the unique referral code for the share.
The share's referral code.
|
get |
How far the share has come towards generating an install.
The state of the share.
|
get |
When the share object was last updated (changed state). This is the same as CreatedAt
if the share has never been updated.
The time the share was last updated.
|
get |
Get the URL that is associated with the share object.
Note that a url set with MegacoolShareConfig.Url
when the share was created might be "/"
(the default) on a share received from MegacoolReceivedShareOpenedEvent
or MegacoolSentShareOpenedEvent
if the network request to create the share failed.
For navigation purposes inside the app you should probably use MegacoolLinkClickedEvent.Url
instead, as that's computed locally and thus faster and works offline.
The URL of the share.