PlayerIO

The fastest way to build online games without breaking a sweat.

Android Client Reference

Android  class documentationClass PlayerInsight

Namespace: com.playerio
Language: Java

PlayerInsight

Methods

 
public int
getPlayersOnline ()

The numbers of players online in the entire game

public String
getSegment (String segmentGroup)

Gets the segment value for the given segment group. For instance, if the player is tagged in the segment 'source:facebook' the method will return 'facebook' when called with 'source' as the argument.

public void
refresh (Callback<Void> callback)

Refresh the players online counter and the current segments of the user. public void refresh() throws PlayerIOError { state = channel.playerInsightRefresh(); } Refresh the players online counter and the current segments of the user.

public void
sessionKeepAlive (Callback<Void> callback)

Every API call performs a session keep-alive implicitly, but if there will be long periods of inactivity this method can be used to ensure that the session that was started through Authenticate does not die out.

public void
setSegments (String[] playerInsightSegments, Callback<Void> callback)

Assign custom PlayerInsight segments to the current user

public void
trackEvent (String eventType, int value, Callback<Void> callback)

Track the given event for the current user in PlayerInsight

public void
trackExternalPayment (String currency, int amount, Callback<Void> callback)

Track a completed payment in PlayerInsight from an external non-PayVault payment method.

public void
trackInvitedBy (String invitingUserId, String invitationChannel, Callback<Void> callback)

Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

PlayerInsight.getPlayersOnline

public int
getPlayersOnline ()

The numbers of players online in the entire game

PlayerInsight.getSegment

public String
getSegment (String segmentGroup)

Gets the segment value for the given segment group. For instance, if the player is tagged in the segment 'source:facebook' the method will return 'facebook' when called with 'source' as the argument.

Arguments

String segmentGroup
The segmentGroup to get the current segment value for.

PlayerInsight.refresh

public void
refresh (Callback<Void> callback)

Refresh the players online counter and the current segments of the user. public void refresh() throws PlayerIOError { state = channel.playerInsightRefresh(); } Refresh the players online counter and the current segments of the user.

Arguments

Callback<Void> callback
Callback that will be called when the operation completes

PlayerInsight.sessionKeepAlive

public void
sessionKeepAlive (Callback<Void> callback)

Every API call performs a session keep-alive implicitly, but if there will be long periods of inactivity this method can be used to ensure that the session that was started through Authenticate does not die out.

Arguments

Callback<Void> callback
Callback that will be called when the operation was completed

PlayerInsight.setSegments

public void
setSegments (String[] playerInsightSegments, Callback<Void> callback)

Assign custom PlayerInsight segments to the current user

Arguments

String[] playerInsightSegments
Custom segments for the user in PlayerInsight, each string should be in the form 'segmentGroup:value', like 'adcampaign:googleads'.
Callback<Void> callback
Callback that will be called when the operation complete

PlayerInsight.trackEvent

public void
trackEvent (String eventType, int value, Callback<Void> callback)

Track the given event for the current user in PlayerInsight

Arguments

String eventType
The name of the event to track.
int value
The amount to add to the counter value.
Callback<Void> callback
Callback that will be called when the operation was completed

PlayerInsight.trackExternalPayment

public void
trackExternalPayment (String currency, int amount, Callback<Void> callback)

Track a completed payment in PlayerInsight from an external non-PayVault payment method.

Arguments

String currency
The currency the payment was made in.
int amount
The amount of the payment in the given currency.
Callback<Void> callback
Callback that will be called when the operation was completed

PlayerInsight.trackInvitedBy

public void
trackInvitedBy (String invitingUserId, String invitationChannel, Callback<Void> callback)

Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

Arguments

String invitingUserId
The connectUserId of the user who invited this user.
String invitationChannel
An identifier for the channel the invitation was received over, like 'email' or 'fb_invite'.
Callback<Void> callback
Callback that will be called when the operation was completed