GPGApplicationModel Class Reference

GPGApplicationModel Class Reference

Overview

Deprecated.

Use the data loading methods in the class representing a specific Play Games feature instead. For example, to load Achievement metadata, you can implement the following code:

[GPGAchievementMetadata metadataForAchievementId:achievementId
    completionHandler:(GPGAchievementMetadata *metadata, NSError *error) {
 }];

This object manages all relevant information for each of the Google Games features in the current application.

Each of the Google Play Games features has a sub-model object through which its data may be accessed.

Feature Sub-Models

Data for the deprecated appState (Cloud Save) feature is accessed through the appState sub-model.

Application Keys

If you require model information to be available then you can use the application keys to receive a notification when data is loaded. The following example displays checking if appState has loaded.

GPGApplicationModel *am = [GPGManager sharedInstance].applicationModel;
[am loadDataForKey:GPGModelGetAllAppStateKey
 completionHandler:^(NSError *error) {
   if (nil == error) {
   } else {
   }
 }];

See a more detailed breakdown of loading data in the GPGKeyedModel documentation.

GPGModelGetAllAppStateKey

The AppState data from the cloud.

Inheritance diagram for GPGApplicationModel:
GPGKeyedModel

Public Member Functions

(instancetype) - initWithApplicationId:
 Designated Initializer.
Querying Data
(void) - loadDataForKey:
 Deprecated.
(void) - loadDataForKey:completionHandler:
 Deprecated.
(void) - reloadDataForKey:
 Deprecated.
(void) - reloadDataForKey:completionHandler:
 Deprecated.
(BOOL) - isLoadingDataForKey:
 Deprecated.
(BOOL) - isDataLoadedForKey:
 Deprecated.
(NSError *) - errorFromLoadingDataForKey:
 Deprecated.

Properties

GPGAchievementModelachievement
 The achievement model.
GPGGameMetadataModel * application
 The application metadata model.
GPGLeaderboardModelleaderboard
 The leaderboard model.
GPGPlayerModelplayer
 The player model.
GPGTurnBasedModelturnBased
 The turn-based model.
NSMutableDictionary * keyToCompletionHandlers
 Loading state.
Models
GPGAppStateModelappState
 Models.

Member Function Documentation

- (instancetype) initWithApplicationId: (NSString *)  applicationId

Designated Initializer.

Designated initializer

- (void) loadDataForKey: (NSString *)  key

Deprecated.

Initiates a request to load the given key's data if it has not already been loaded.

If the data is already loading then this method does nothing.

Threadsafe.

- (void) loadDataForKey: (NSString *)  key
completionHandler: (GPGModelDidLoadBlock)  completionHandler 

Deprecated.

Initiates a request to load the given key's data if it has not already been loaded. Calls the completion handler once the data is loaded.

If the data is already loaded then the completion handler will be called immediately.

Threadsafe.

Parameters:
completionHandler(optional) A block of the form: ^(NSError *error). Executes the completion handler immediately if the data is already loaded.
- (void) reloadDataForKey: (NSString *)  key

Deprecated.

Initiates a load request for the given key's data even if the data has already been loaded.

If the data is already loading then this method does nothing.

Threadsafe.

- (void) reloadDataForKey: (NSString *)  key
completionHandler: (GPGModelDidLoadBlock)  completionHandler 

Deprecated.

Initiates a load request for the given key's data even if the data has already been loaded. Calls the completion handler once the data is loaded.

If the data is already loading then this method does nothing. If the data is already loaded the completion handler will NOT be called immediately.

Threadsafe.

Parameters:
completionHandler(optional) A block of the form: ^(NSError *error).
- (BOOL) isLoadingDataForKey: (NSString *)  key

Deprecated.

Checks the current loading state of data for the given key.

Returns:
YES if the data for the given key is currently being loaded, NO otherwise.
- (BOOL) isDataLoadedForKey: (NSString *)  key

Deprecated.

Returns YES if the data for the given key successfully loaded, otherwise returns NO if an error occurred or the data has not been loaded yet.

This can be YES if the data is currently loading and the data has already been loaded once before. When this is the case the data is refreshing and you should represent the user interface state accordingly.

- (NSError *) errorFromLoadingDataForKey: (NSString *)  key

Deprecated.

Returns the error for the given key if the data failed to load, otherwise returns nil.


Property Documentation

- (GPGAppStateModel*) appState [read, assign]

Models.

The app state model.

- (GPGAchievementModel*) achievement [read, assign]

The achievement model.

- (GPGGameMetadataModel*) application [read, assign]

The application metadata model.

- (GPGLeaderboardModel*) leaderboard [read, assign]

The leaderboard model.

- (GPGPlayerModel*) player [read, assign]

The player model.

- (GPGTurnBasedModel*) turnBased [read, assign]

The turn-based model.

- (NSMutableDictionary*) keyToCompletionHandlers [read, copy, inherited]

Loading state.

Оставить отзыв о...

Текущей странице
Play Games Services for iOS
Play Games Services for iOS