Instance Method


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


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



The string that identifies the type of records to track. You use record type strings to differentiate among the different types of records in your app. 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.


The unique name of the subscription. This string must be unique in the specified database and must not be nil.


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:options:

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


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software