public interface

BaseEventListener

co.megacool.megacool.BaseEventListener
Known Indirect Subclasses

Class Overview

The base interface for listening to events from the SDK. Note that we do not recommend using this interface directly as we do not guarantee backwards compatibility for it. We might add methods in any release, thus you should instead extend the EventListener which allows you to override only the methods you actually need.

See Also

Summary

Fields
public static final AtomicReference<Handler> handler This creates a Handler using the android.os.Looper of the thread that the callback is created on
Public Methods
abstract void linkClicked(LinkClickedEvent event)
A link was clicked on.
abstract void receivedShareOpened(ReceivedShareOpenedEvent event)
This device clicked a share sent by someone else.
abstract void sentShareOpened(SentShareOpenedEvent event)
A share sent from this device was clicked on by someone else.
abstract void shareCompleted()
Called when a share is completed successfully.
abstract void shareDismissed()
Called when a user initiates a share, but didn't select an app to share to.
abstract 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).

Fields

public static final AtomicReference<Handler> handler

This creates a Handler using the android.os.Looper of the thread that the callback is created on

Public Methods

public abstract 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 abstract 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 abstract 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 abstract void shareCompleted ()

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

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