Class: Parse::Installation
- Defined in:
- lib/parse/model/classes/installation.rb,
lib/parse/stack/generators/templates/model_installation.rb
Overview
This class represents the data and columns contained in the standard Parse `_Installation` collection. This class is also responsible for managing the device tokens for mobile devices in order to use push notifications. All queries done to send pushes using Parse::Push are performed against the Installation collection. An installation object represents an instance of your app being installed on a device. These objects are used to store subscription data for installations which have subscribed to one or more push notification channels.
The default schema for Installation is as follows:
class Parse::Installation < Parse::Object
# See Parse::Object for inherited properties...
property :gcm_sender_id, field: :GCMSenderId
property :app_identifier
property :app_name
property :app_version
property :badge, :integer
property :channels, :array
property :device_token
property :device_token_last_modified, :integer
property :device_type, enum: [:ios, :android, :winrt, :winphone, :dotnet]
property :installation_id
property :locale_identifier
property :parse_version
property :push_type
property :time_zone, :timezone
has_one :session, ->{ where(installation_id: i.installation_id) }, scope_only: true
end
Constant Summary
Constants included from Properties
Properties::BASE, Properties::BASE_FIELD_MAP, Properties::BASE_KEYS, Properties::CORE_FIELDS, Properties::DELETE_OP, Properties::TYPES
Constants inherited from Pointer
Constants inherited from Model
Model::CLASS_INSTALLATION, Model::CLASS_PRODUCT, Model::CLASS_ROLE, Model::CLASS_SESSION, Model::CLASS_USER, Model::ID, Model::KEY_CLASS_NAME, Model::KEY_CREATED_AT, Model::KEY_OBJECT_ID, Model::KEY_UPDATED_AT, Model::OBJECT_ID, Model::TYPE_ACL, Model::TYPE_BYTES, Model::TYPE_DATE, Model::TYPE_FIELD, Model::TYPE_FILE, Model::TYPE_GEOPOINT, Model::TYPE_NUMBER, Model::TYPE_OBJECT, Model::TYPE_POINTER, Model::TYPE_RELATION
Instance Attribute Summary collapse
- #app_identifier ⇒ String
A unique identifier for this installation’s client application.
- #app_name ⇒ String
The display name of the client application to which this installation belongs.
- #app_version ⇒ String
The version string of the client application to which this installation belongs.
- #badge ⇒ Integer
A number field representing the last known application badge for iOS installations.
- #channels ⇒ Array
An array of the channels to which a device is currently subscribed.
- #device_token ⇒ String
The Apple or Google generated token used to deliver messages to the APNs or GCM push networks respectively.
- #device_token_last_modified ⇒ Integer
Number of seconds since token modified.
- #device_type ⇒ String
The type of device, “ios”, “android”, “winrt”, “winphone”, or “dotnet” (readonly).
- #gcm_sender_id ⇒ String
This field only has meaning for Android installations that use the GCM push type.
- #installation_id ⇒ String
Universally Unique Identifier (UUID) for the device used by Parse.
- #locale_identifier ⇒ String
The locale for this device.
- #parse_version ⇒ String
The version of the Parse SDK which this installation uses.
- #push_type ⇒ String
This field is reserved for directing Parse to the push delivery network to be used.
- #session ⇒ Parse::Session
Returns the corresponding Session associated with this installation, if any exists.
- #time_zone ⇒ Parse::TimeZone
The current time zone where the target device is located.
Attributes inherited from Object
#acl, #created_at, #id, #updated_at
Attributes inherited from Pointer
Method Summary
Methods inherited from Object
#[], #[]=, #__type, #after_create, #after_destroy, #after_save, #apply_defaults!, #as_json, #before_create, #before_destroy, #before_save, build, #clear_attribute_change!, #clear_changes!, #existed?, #initialize, #new?, #parse_class, #persisted?, pointer, #pretty, #reload!, #rollback!, #schema, set_default_acl, #twin, #updates, #validate!, webhook, webhook_function
Methods included from Core::Querying
#all, #count, #distinct, #each, #find, #first, #literal_where, #newest, #oldest, #query, #scope
Methods included from Core::Schema
#auto_upgrade!, #create_schema, #fetch_schema, #schema, #update_schema
Methods included from Core::Actions
#change_requests, #changes_applied!, #changes_payload, #create, #destroy, #destroy_request, #op_add!, #op_add_relation!, #op_add_unique!, #op_destroy!, #op_increment!, #op_remove!, #op_remove_relation!, #operate_field!, #prepare_save!, #relation_change_operations, #save, #save!, #set_attributes!, #update, #update!, #update_relations, #uri_path
Methods included from Core::Fetching
Methods included from Associations::HasMany
has_many, #relation_changes?, #relation_updates, #relations
Methods included from Associations::BelongsTo
Methods included from Associations::HasOne
Methods included from Properties
#apply_attributes!, #attribute_changes?, #attribute_updates, #attributes, #attributes=, #field_map, #fields, #format_operation, #format_value
Methods inherited from Pointer
#==, #[], #[]=, #__type, #attributes, #className, #fetch, #fetched?, #hash, #initialize, #json_hash, #pointer, #pointer?, #present?, #sig
Methods inherited from Model
Methods included from Client::Connectable
Constructor Details
This class inherits a constructor from Parse::Object
Instance Attribute Details
#app_identifier ⇒ String
A unique identifier for this installation’s client application. In iOS, this is the Bundle Identifier.
53 | # File 'lib/parse/model/classes/installation.rb', line 53 property :app_identifier |
#app_name ⇒ String
The display name of the client application to which this installation belongs.
58 | # File 'lib/parse/model/classes/installation.rb', line 58 property :app_name |
#app_version ⇒ String
The version string of the client application to which this installation belongs.
63 | # File 'lib/parse/model/classes/installation.rb', line 63 property :app_version |
#badge ⇒ Integer
A number field representing the last known application badge for iOS installations.
68 | # File 'lib/parse/model/classes/installation.rb', line 68 property :badge, :integer |
#channels ⇒ Array
An array of the channels to which a device is currently subscribed. Note that *channelUris* (the Microsoft-generated push URIs for Windows devices) is not supported at this time.
75 | # File 'lib/parse/model/classes/installation.rb', line 75 property :channels, :array |
#device_token ⇒ String
The Apple or Google generated token used to deliver messages to the APNs or GCM push networks respectively.
81 | # File 'lib/parse/model/classes/installation.rb', line 81 property :device_token |
#device_token_last_modified ⇒ Integer
Returns number of seconds since token modified.
85 | # File 'lib/parse/model/classes/installation.rb', line 85 property :device_token_last_modified, :integer |
#device_type ⇒ String
The type of device, “ios”, “android”, “winrt”, “winphone”, or “dotnet” (readonly). This property is implemented as a Parse::Stack enumeration.
91 | # File 'lib/parse/model/classes/installation.rb', line 91 property :device_type, enum: [:ios, :android, :winrt, :winphone, :dotnet] |
#gcm_sender_id ⇒ String
This field only has meaning for Android installations that use the GCM push type. It is reserved for directing Parse to send pushes to this installation with an alternate GCM sender ID. This field should generally not be set unless you are uploading installation data from another push provider. If you set this field, then you must set the GCM API key corresponding to this GCM sender ID in your Parse application’s push settings.
48 | # File 'lib/parse/model/classes/installation.rb', line 48 property :gcm_sender_id, field: :GCMSenderId |
#installation_id ⇒ String
Universally Unique Identifier (UUID) for the device used by Parse. It must be unique across all of an app’s installations. (readonly).
97 | # File 'lib/parse/model/classes/installation.rb', line 97 property :installation_id |
#locale_identifier ⇒ String
The locale for this device.
102 | # File 'lib/parse/model/classes/installation.rb', line 102 property :locale_identifier |
#parse_version ⇒ String
The version of the Parse SDK which this installation uses.
107 | # File 'lib/parse/model/classes/installation.rb', line 107 property :parse_version |
#push_type ⇒ String
This field is reserved for directing Parse to the push delivery network to be used. If the device is registered to receive pushes via GCM, this field will be marked “gcm”. If this device is not using GCM, and is using Parse’s push notification service, it will be blank (readonly).
115 | # File 'lib/parse/model/classes/installation.rb', line 115 property :push_type |
#session ⇒ Parse::Session
Returns the corresponding Session associated with this installation, if any exists. This is implemented as a has_one association to the Session class using the #installation_id.
128 | # File 'lib/parse/model/classes/installation.rb', line 128 has_one :session, -> { where(installation_id: i.installation_id) }, scope_only: true |
#time_zone ⇒ Parse::TimeZone
The current time zone where the target device is located. This should be an IANA time zone identifier or a TimeZone instance.
121 | # File 'lib/parse/model/classes/installation.rb', line 121 property :time_zone, :timezone |