PlayerIO

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

Objective-C Client Reference

Multiplayer  class documentationClass PIONotifications

Language: Objective-C

The Player.IO Notifications service.

Properties

 
myEndpoints
The list of notification endpoints registered for the current client.

Methods

 
- (void)
deleteEndpoints:successBlock:
Deletes the given endpoints
- (void)
deleteEndpoints:successBlock:errorBlock:
Deletes the given endpoints
- (void)
refreshWithSuccessBlock:
Refreshes myEndpoints synchronously Refreshes myEndpoints asynchronously
- (void)
refreshWithSuccessBlock:errorBlock:
Refreshes myEndpoints asynchronously
- (void)
registerEndpointWithEndpointType:identifier:configuration:enabled:successBlock:
Register a device or endpoint with Player.IO synchronously.
- (void)
registerEndpointWithEndpointType:identifier:configuration:enabled:successBlock:errorBlock:
Register a device or endpoint with Player.IO synchronously.
- (void)
sendNotifications:successBlock:
Send one or more notifications
- (void)
sendNotifications:successBlock:errorBlock:
Send one or more notifications
- (void)
toggleEndpoints:enabled:successBlock:
Enables or disabled the given endpoints.
- (void)
toggleEndpoints:enabled:successBlock:errorBlock:
Enables or disabled the given endpoints.

@property (nonatomic) NSArray * myEndpoints

The list of notification endpoints registered for the current client.

deleteEndpoints:successBlock:

Deletes the given endpoints

Arguments

NSArray* endpoints
The endpoints to delete.
void(^)() successBlock
Callback block that is invoked when operation succeeds.

deleteEndpoints:successBlock:errorBlock:

Deletes the given endpoints

Arguments

NSArray* endpoints
The endpoints to delete.
void(^)() successBlock
Callback block that is invoked when operation succeeds.
void(^)(PIOError*) errorBlock
Callback block that is invoked when operation fails.

refreshWithSuccessBlock:

Refreshes myEndpoints synchronously Refreshes myEndpoints asynchronously

Arguments

void(^)() successBlock
Callback block that will be called when the refresh is complete.

refreshWithSuccessBlock:errorBlock:

Refreshes myEndpoints asynchronously

Arguments

void(^)() successBlock
Callback block that will be called when the refresh is complete.
void(^)(PIOError*) errorBlock
Callback block that will be called instead of successCallback if an error occurs.

registerEndpointWithEndpointType:identifier:configuration:enabled:successBlock:

Register a device or endpoint with Player.IO synchronously.

Arguments

NSString* endpointType
The endpoint type to register. For example: "ios-push-notifications".
NSString* identifier
The identifier of the endpoint, such as the device token on iOS or an email address for email.
NSDictionary* configuration
Configuration relating to the endpoint. Can be nil.
BOOL enabled
Should the endpoint be enabled.
void(^)() successBlock
Callback block that is invoked when operation succeeds

registerEndpointWithEndpointType:identifier:configuration:enabled:successBlock:errorBlock:

Register a device or endpoint with Player.IO synchronously.

Arguments

NSString* endpointType
The endpoint type to register. For example: "ios-push-notifications".
NSString* identifier
The identifier of the endpoint, such as the device token on iOS or an email address for email.
NSDictionary* configuration
Configuration relating to the endpoint. Can be nil.
BOOL enabled
Should the endpoint be enabled.
void(^)() successBlock
Callback block that is invoked when operation succeeds
void(^)(PIOError*) errorBlock
Callback block that is invoked when operation fails

sendNotifications:successBlock:

Send one or more notifications

Arguments

NSArray* notifications
Array of PIONotification objects to send
void(^)() successBlock
Callback block that is invoked when operation succeeds

sendNotifications:successBlock:errorBlock:

Send one or more notifications

Arguments

NSArray* notifications
Array of PIONotification objects to send
void(^)() successBlock
Callback block that is invoked when operation succeeds
void(^)(PIOError*) errorBlock
Callback that is invoked when operation fails

toggleEndpoints:enabled:successBlock:

Enables or disabled the given endpoints.

Arguments

NSArray* endpoints
The endpoints to enable or disable.
BOOL enabled
If true, all the given endpoints will be enabled. If false, they'll be disabled.
void(^)() successBlock
Callback block that is invoked when operation succeeds

toggleEndpoints:enabled:successBlock:errorBlock:

Enables or disabled the given endpoints.

Arguments

NSArray* endpoints
The endpoints to enable or disable.
BOOL enabled
If true, all the given endpoints will be enabled. If false, they'll be disabled.
void(^)() successBlock
Callback block that is invoked when operation succeeds
void(^)(PIOError*) errorBlock
Callback block that is invoked when operation fails