public abstract class

EventListener

extends Object
implements BaseEventListener
java.lang.Object
   ↳ co.megacool.megacool.EventListener

Class Overview

The extension point for listening to events emitted by the SDK.

The base implementation of the methods in this class merely logs the events, if you want to retain this you can include super() in your implementation, but you don't have to.

Summary

[Expand]
Inherited Fields
From interface co.megacool.megacool.BaseEventListener
Public Constructors
EventListener()
Public Methods
void linkClicked(LinkClickedEvent event)
A link was clicked on.
void receivedShareOpened(ReceivedShareOpenedEvent event)
This device clicked a share sent by someone else.
void sentShareOpened(SentShareOpenedEvent event)
A share sent from this device was clicked on by someone else.
void shareCompleted()
Called when a share is completed successfully.
void shareDismissed()
Called when a user initiates a share, but didn't select an app to share to.
void sharePossiblyCompleted()
Called when the user has at least selected an app to share to (API level 22 and up), or when we're unable to tell if an app was selected or not (API level 21 and down).
[Expand]
Inherited Methods
From class java.lang.Object
From interface co.megacool.megacool.BaseEventListener

Public Constructors

public EventListener ()

Public Methods

public void linkClicked (LinkClickedEvent event)

A link was clicked on. Override this method to implement deep linking, ie navigate to a specific part of your app when a link is clicked.

Parameters
event the link clicked event

public void receivedShareOpened (ReceivedShareOpenedEvent event)

This device clicked a share sent by someone else. Override this method to reward users when they install from a referral, or autoconnect them to friends in the game based on who sent the share.

Use isFirstSession() to determine if the event was a new install or a re-engagement.

Parameters
event the received share opened event

public void sentShareOpened (SentShareOpenedEvent event)

A share sent from this device was clicked on by someone else. Override this to reward the sender for referring someone to the game, use isFirstSession() to differentiate between new installs and re-engagements.

Parameters
event the sent share opened event

public void shareCompleted ()

Called when a share is completed successfully. Few of the apps you can share to will actually report this.

public void shareDismissed ()

Called when a user initiates a share, but didn't select an app to share to.

This is only called on API level 22 and up.

public void sharePossiblyCompleted ()

Called when the user has at least selected an app to share to (API level 22 and up), or when we're unable to tell if an app was selected or not (API level 21 and down). Most apps do not report the result of a share, so we can't be sure that the user actually completed the share or not.