ios - CloudKit subscription with "CONTAINS" predicate -



ios - CloudKit subscription with "CONTAINS" predicate -

i trying setup cloudkit subscription based on testing membership in array.

the code i'm using create subscription follows:

nspredicate *predicate = [nspredicate predicatewithformat:@"users contains %@", userid]; cksubscription *itemsubscription = [[cksubscription alloc] initwithrecordtype:@"foo" predicate:predicate options:cksubscriptionoptionsfiresonrecordcreation|cksubscriptionoptionsfiresonrecordupdate]; cknotificationinfo *notificationinfo = [[cknotificationinfo alloc] init]; [notificationinfo setalertlocalizationkey:@"record notification"]; [notificationinfo setshouldbadge:yes]; [itemsubscription setnotificationinfo:notificationinfo]; [database savesubscription:itemsubscription completionhandler:^(cksubscription *subscription, nserror *error) { nslog(@"error: %@, subscription: %@", error, subscription); }];

the log shows subscription created successfully, when test adding or changing record via cloudkit admin console never notification on device.

i able receive notifications subscriptions other kinds of predicates (i've tested simple true predicate, , 1 tests equality against string field), know have notification code setup correctly.

i've verified predicate listed above works when used in fetch records query, know predicate setup correctly record type have in cloudkit.

has been able subscription notifications predicate tests membership in array?

after playing around, found unless set notificationinfo.alertbody subscription never fired.

so seek setting "test" first, after set "". found continued work after set blank string (though didn't seek setting blank start with), , blank string doesn't show notification, handler still gets called, after.

with ios 8.1.1 / xcode 6.1.1

ios objective-c nspredicate icloud cloudkit

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -