Megacool Unity
The Unity interface to the Megacool SDK
Public Types | Public Member Functions | Properties | List of all members
MegacoolShare Class Reference

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...
 

Detailed Description

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.

See also
MegacoolShareConfig

Member Enumeration Documentation

◆ ShareState

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.

Enumerator
SENT 

The share has been sent. This is the default state of a share until something happens with the link.

CLICKED 

The share link has been clicked. This can lead to OPENED or INSTALLED if the clicker finishes the process. If this state remains, assume that the receiver didn't complete an install.

Note that depending on where the share was sent this might not mean the recipient clicked on it consciously, it might have been "clicked" automatically by the app to generate a link preview or similar. It's likely the preview was seen by the recipient, but the recipient hasn't necessarily expressed intent to open the app.

OPENED 

The share led to at least one existing user opening the app. The share can have led to several re-engagements, but no new installs.

INSTALLED 

The share led to at least one new user installing the app. The share can have generated multiple installs and re-engagements in this state.

Property Documentation

◆ CreatedAt

DateTime MegacoolShare.CreatedAt
get

When the share was created.

The time the share was created.

◆ Data

Dictionary<string, object> MegacoolShare.Data
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.

◆ ReferralCode

MegacoolReferralCode MegacoolShare.ReferralCode
get

Get the unique referral code for the share.

The share's referral code.

◆ State

ShareState MegacoolShare.State
get

How far the share has come towards generating an install.

The state of the share.

◆ UpdatedAt

DateTime MegacoolShare.UpdatedAt
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.

◆ Url

Uri MegacoolShare.Url
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.

See also
MegacoolLinkClickedEvent

The documentation for this class was generated from the following file: