AVInstallation Class Reference

Inherits from AVObject : NSObject
Declared in AVInstallation.h

Overview

A LeanCloud Framework Installation Object that is a local representation of an installation persisted to the LeanCloud. This class is a subclass of a AVObject, and retains the same functionality of a AVObject, but also extends it with installation-specific fields and related immutability and validity checks.

A valid AVInstallation can only be instantiated via [AVInstallation defaultInstallation] because the required identifier fields are readonly. The timeZone and badge fields are also readonly properties which are automatically updated to match the device’s time zone and application badge when the AVInstallation is saved, thus these fields might not reflect the latest device state if the installation has not recently been saved.

AVInstallation objects which have a valid deviceToken and are saved to the LeanCloud can be used to target push notifications.

This class is currently for iOS only. There is no AVInstallation for LeanCloud applications running on OS X, because they cannot receive push notifications.

Targeting Installations

+ query

Creates a query for AVInstallation objects. The resulting query can only be used for targeting a AVPush. Calling find methods on the resulting query will raise an exception.

+ (AVQuery *)query

Discussion

Creates a query for AVInstallation objects. The resulting query can only be used for targeting a AVPush. Calling find methods on the resulting query will raise an exception.

Declared In

AVInstallation.h

Accessing the Current Installation

+ defaultInstallation

Default Singleton Installation.

+ (AVInstallation *)defaultInstallation

Return Value

Default Singleton Instance.

Discussion

Default Singleton Installation.

Declared In

AVInstallation.h

+ currentInstallation

+ (AVInstallation *)currentInstallation

Properties

  deviceType

The device type for the AVInstallation.

@property (nonatomic, copy, readonly) NSString *deviceType

Discussion

The device type for the AVInstallation.

Declared In

AVInstallation.h

  installationId

The installationId for the AVInstallation.

@property (nonatomic, copy, readonly, nullable) NSString *installationId

Discussion

The installationId for the AVInstallation.

Declared In

AVInstallation.h

  deviceToken

The device token for the AVInstallation.

@property (nonatomic, copy, nullable) NSString *deviceToken

Discussion

The device token for the AVInstallation.

Declared In

AVInstallation.h

  deviceProfile

The device profile for the AVInstallation.

@property (nonatomic, copy, nullable) NSString *deviceProfile

Discussion

The device profile for the AVInstallation.

Declared In

AVInstallation.h

  badge

The badge for the AVInstallation.

@property (nonatomic, assign) NSInteger badge

Discussion

The badge for the AVInstallation.

Declared In

AVInstallation.h

  timeZone

The timeZone for the AVInstallation.

@property (nonatomic, copy, readonly) NSString *timeZone

Discussion

The timeZone for the AVInstallation.

Declared In

AVInstallation.h

  channels

The channels for the AVInstallation.

@property (nonatomic, strong, nullable) NSArray *channels

Discussion

The channels for the AVInstallation.

Declared In

AVInstallation.h

  apnsTopic

The apns topic for universal push notification.

@property (nonatomic, copy, nullable) NSString *apnsTopic

Discussion

The apns topic for universal push notification.

Declared In

AVInstallation.h

  apnsTeamId

The apns teamId for universal push notification.

@property (nonatomic, copy, nullable) NSString *apnsTeamId

Discussion

The apns teamId for universal push notification.

Declared In

AVInstallation.h

– setDeviceTokenFromData:

Sets the device token string property from an NSData-encoded token.

- (void)setDeviceTokenFromData:(NSData *)deviceTokenData

Parameters

deviceTokenData

NSData-encoded device token.

Discussion

Sets the device token string property from an NSData-encoded token.

Declared In

AVInstallation.h

– setDeviceTokenFromData:teamId:

Sets the device token string property from an NSData-encoded token, with a team ID.

- (void)setDeviceTokenFromData:(NSData *)deviceTokenData teamId:(NSString *_Nullable)teamId

Parameters

deviceTokenData

NSData-encoded device token

teamId

Team ID

Discussion

Sets the device token string property from an NSData-encoded token, with a team ID.

Declared In

AVInstallation.h