PlayerIO

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

Objective-C Client Reference

Multiplayer  class documentationClass PIOGameFS

Language: Objective-C

The Player.IO GameFS service.

Methods

 
- (void)
downloadPath:toFile:useSecureHttp:timeout:progressBlock:successBlock:errorBlock:
Download a GameFS file to disk, using the default shared NSUrlCache. An application with more specific needs can create a custom NSURLCache object and set it as the shared cache instance using [NSUrlCache setSharedURLCache:]. The application should do so before any calls to this method.
- (void)
downloadPath:useSecureHttp:timeout:progressBlock:successBlock:errorBlock:
Download a GameFS file, using the default shared NSUrlCache. An application with more specific needs can create a custom NSURLCache object and set it as the shared cache instance using [NSUrlCache setSharedURLCache:]. The application should do so before any calls to this method.
- (NSString*)
getUrlWithPath:
Converts a GameFS path (like '/mygame.swf') into a full url, that can be downloaded over the internet. Important! Do not save or otherwise persist (bigdb, cookies, etc) the returned url, since the url will change over time.
- (NSString*)
getUrlWithPath:useSecureHttp:
Converts a GameFS path (like '/mygame.swf') into a full url, that can be downloaded over the internet. Important! Do not save or otherwise persist (bigdb, cookies, etc) the returned url, since the url will change over time.

downloadPath:toFile:useSecureHttp:timeout:progressBlock:successBlock:errorBlock:

Download a GameFS file to disk, using the default shared NSUrlCache. An application with more specific needs can create a custom NSURLCache object and set it as the shared cache instance using [NSUrlCache setSharedURLCache:]. The application should do so before any calls to this method.

Arguments

NSString* path
The path of the file in the GameFS, including the initial slash. Examples: '/mygame.swf' or '/characters/bob.jpg'
NSString* filePath
the path on disk to save the file to.
bool useSecureHttp
If true, this method returns a secure (https) url.
NSTimeInterval timeout
The time to wait for response before the errorBlock is called
void(^)(floatprogress) progressBlock
Called intermittently during download with the current progress of the download
void(^)(NSString*filePath) successBlock
A callback block that will be called with the downloaded data
void(^)(PIOError*error) errorBlock
A callback block that will be called on error, with information about the error.

downloadPath:useSecureHttp:timeout:progressBlock:successBlock:errorBlock:

Download a GameFS file, using the default shared NSUrlCache. An application with more specific needs can create a custom NSURLCache object and set it as the shared cache instance using [NSUrlCache setSharedURLCache:]. The application should do so before any calls to this method.

Arguments

NSString* path
The path of the file in the GameFS, including the initial slash. Examples: '/mygame.swf' or '/characters/bob.jpg'
bool useSecureHttp
If true, this method returns a secure (https) url.
NSTimeInterval timeout
The time to wait for response before the errorBlock is called
void(^)(floatprogress) progressBlock
Called intermittently during download with the current progress of the download
void(^)(NSData*data) successBlock
A callback block that will be called with the downloaded data
void(^)(PIOError*error) errorBlock
A callback block that will be called on error, with information about the error.

getUrlWithPath:

Converts a GameFS path (like '/mygame.swf') into a full url, that can be downloaded over the internet. Important! Do not save or otherwise persist (bigdb, cookies, etc) the returned url, since the url will change over time.

Arguments

NSString* path
The path of the file in the GameFS, including the initial slash. Examples: '/mygame.swf' or '/characters/bob.jpg'

Return Value

NSString* An url that can be used to download the resource over the internet.

getUrlWithPath:useSecureHttp:

Converts a GameFS path (like '/mygame.swf') into a full url, that can be downloaded over the internet. Important! Do not save or otherwise persist (bigdb, cookies, etc) the returned url, since the url will change over time.

Arguments

NSString* path
The path of the file in the GameFS, including the initial slash. Examples: '/mygame.swf' or '/characters/bob.jpg'
bool useSecureHttp
If true, this method returns a secure (https) url.

Return Value

NSString* An url that can be used to download the resource over the internet.