PlayerIO

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

Objective-C Client Reference

Multiplayer  class documentationClass PIOPlayerInsight

Language: Objective-C

PlayerInsight

Properties

 
playersOnline
The numbers of players online in the entire game

Methods

 
- (NSString*)
getSegmentWithSegmentGroup:
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.
- (void)
refresh
Refresh the players online counter and the current segments of the user.
- (void)
refreshWithSuccessBlock:
Refresh the players online counter and the current segments of the user.
- (void)
refreshWithSuccessBlock:errorBlock:
Refresh the players online counter and the current segments of the user.
- (void)
sessionKeepAlive
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.
- (void)
sessionKeepAliveWithSuccessBlock:
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.
- (void)
sessionKeepAliveWithSuccessBlock:errorBlock:
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.
- (void)
setSegmentsWithSegments:
Assign custom PlayerInsight segments to the current user
- (void)
setSegmentsWithSegments:successBlock:
Assign custom PlayerInsight segments to the current user
- (void)
setSegmentsWithSegments:successBlock:errorBlock:
Assign custom PlayerInsight segments to the current user
- (void)
trackEventWithEventType:value:
Track the given event for the current user in PlayerInsight
- (void)
trackEventWithEventType:value:successBlock:
Track the given event for the current user in PlayerInsight
- (void)
trackEventWithEventType:value:successBlock:errorBlock:
Track the given event for the current user in PlayerInsight
- (void)
trackExternalPaymentWithCurrency:amount:
Track a completed payment in PlayerInsight from an external non-PayVault payment method.
- (void)
trackExternalPaymentWithCurrency:amount:successBlock:
Track a completed payment in PlayerInsight from an external non-PayVault payment method.
- (void)
trackExternalPaymentWithCurrency:amount:successBlock:errorBlock:
Track a completed payment in PlayerInsight from an external non-PayVault payment method.
- (void)
trackInvitedByWithInvitingUserId:invitationChannel:
Tell PlayerInsight who invited the current user in this session. Used for viral analysis.
- (void)
trackInvitedByWithInvitingUserId:invitationChannel:successBlock:
Tell PlayerInsight who invited the current user in this session. Used for viral analysis.
- (void)
trackInvitedByWithInvitingUserId:invitationChannel:successBlock:errorBlock:
Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

@property (nonatomic) int playersOnline

The numbers of players online in the entire game

getSegmentWithSegmentGroup:

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

NSString* segmentGroup
The segmentGroup to get the current segment value for.

Return Value

NSString*

refresh

Refresh the players online counter and the current segments of the user.

refreshWithSuccessBlock:

Refresh the players online counter and the current segments of the user.

Arguments

void(^)() successBlock
Callback block that will be called when the operation succeeds

refreshWithSuccessBlock:errorBlock:

Refresh the players online counter and the current segments of the user.

Arguments

void(^)() successBlock
Callback block that will be called when the operation succeeds
void(^)(PIOError*error) errorBlock
Callback block that will be called instead of successBlock if an error occurs during the operation.

sessionKeepAlive

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.

sessionKeepAliveWithSuccessBlock:

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

void(^)() successBlock
Callback block that will be called when the operation was completed

sessionKeepAliveWithSuccessBlock:errorBlock:

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

void(^)() successBlock
Callback that will be called when the operation was completed
void(^)(PIOError*error) errorBlock
Callback block that will be called when the operation was completed

setSegmentsWithSegments:

Assign custom PlayerInsight segments to the current user

Arguments

NSMutableArray* segments
Custom segments for the user in PlayerInsight, each string should be in the form 'segmentGroup:value', like 'adcampaign:googleads'.

setSegmentsWithSegments:successBlock:

Assign custom PlayerInsight segments to the current user

Arguments

NSMutableArray* segments
Custom segments for the user in PlayerInsight, each string should be in the form 'segmentGroup:value', like 'adcampaign:googleads'.
void(^)() successBlock
Callback block that will be called when the operation succeeds

setSegmentsWithSegments:successBlock:errorBlock:

Assign custom PlayerInsight segments to the current user

Arguments

NSMutableArray* segments
Custom segments for the user in PlayerInsight, each string should be in the form 'segmentGroup:value', like 'adcampaign:googleads'.
void(^)() successBlock
Callback block that will be called when the operation succeeds
void(^)(PIOError*error) errorBlock
Callback block that will be called instead of successBlock if an error occurs during the operation.

trackEventWithEventType:value:

Track the given event for the current user in PlayerInsight

Arguments

NSString* eventType
The name of the event to track.
int value
The amount to add to the counter value.

trackEventWithEventType:value:successBlock:

Track the given event for the current user in PlayerInsight

Arguments

NSString* eventType
The name of the event to track.
int value
The amount to add to the counter value.
void(^)() successBlock
Callback block that will be called when the operation was completed successfully

trackEventWithEventType:value:successBlock:errorBlock:

Track the given event for the current user in PlayerInsight

Arguments

NSString* eventType
The name of the event to track.
int value
The amount to add to the counter value.
void(^)() successBlock
Callback block that will be called when the operation was completed successfully
void(^)(PIOError*error) errorBlock
Callback block that will be called instead of successBlock if an error occurs during the operation.

trackExternalPaymentWithCurrency:amount:

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

Arguments

NSString* currency
The currency the payment was made in.
int amount
The amount of the payment in the given currency.

trackExternalPaymentWithCurrency:amount:successBlock:

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

Arguments

NSString* currency
The currency the payment was made in.
int amount
The amount of the payment in the given currency.
void(^)() successBlock
Callback block that will be called when the operation was completed successfully

trackExternalPaymentWithCurrency:amount:successBlock:errorBlock:

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

Arguments

NSString* currency
The currency the payment was made in.
int amount
The amount of the payment in the given currency.
void(^)() successBlock
Callback block that will be called when the operation was completed successfully
void(^)(PIOError*error) errorBlock
Callback block that will be called instead of successBlock if an error occurs during the operation.

trackInvitedByWithInvitingUserId:invitationChannel:

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

Arguments

NSString* invitingUserid
The connectUserId of the user who invited this user.
NSString* invitationChannel
An identifier for the channel the invitation was received over, like 'email' or 'fb_invite'.

trackInvitedByWithInvitingUserId:invitationChannel:successBlock:

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

Arguments

NSString* invitingUserid
The connectUserId of the user who invited this user.
NSString* invitationChannel
An identifier for the channel the invitation was received over, like 'email' or 'fb_invite'.
void(^)() successBlock
Callback block that will be called when the operation was completed successfully

trackInvitedByWithInvitingUserId:invitationChannel:successBlock:errorBlock:

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

Arguments

NSString* invitingUserid
The connectUserId of the user who invited this user.
NSString* invitationChannel
An identifier for the channel the invitation was received over, like 'email' or 'fb_invite'.
void(^)() successBlock
Callback block that will be called when the operation was completed successfully
void(^)(PIOError*error) errorBlock
Callback block that will be called instead of successBlock if an error occurs during the operation.