Instance Method


Initializes and returns a query-based subscription that monitors records with the specified options.


- (instancetype)initWithRecordType:(CKRecordType)recordType predicate:(NSPredicate *)predicate options:(CKSubscriptionOptions)subscriptionOptions;



The string that identifies the type of records to track. You are responsible for naming your app’s record types. This parameter must not be nil or an empty string.


The matching criteria to apply to the records. This parameter must not be nil. For information about the operators that are supported in search predicates, see the discussion in CKQuery.


A bitmask of the configuration options for the subscription. You must specify at least one of the following values: CKSubscriptionOptionsFiresOnRecordCreation, CKSubscriptionOptionsFiresOnRecordUpdate, or CKSubscriptionOptionsFiresOnRecordDeletion.

Return Value

A subscription object initialized to track record-related changes.


The object returned by this method is configured as a query-based subscription for searching records in the target database. The subscription monitors the specified type of records in all of the user’s record zones and generates push notifications when the search criteria are met.

See Also

Initializing a Query-Based Subscription

- initWithRecordType:predicate:subscriptionID:options:

Initializes and returns a query-based subscription object that monitors records and has a specific name.