简体   繁体   中英

CloudKit update notification can wake up an app from “Not running” state?

I have an alarm system on my app and the data is sync via CloudKit. If I setup an alarm on one device the same alarm is setup on another device.

The only problem is that this is not working when the app is not running ( The user close the app from the Multitasking screen.)

I want to know if it is possible to wake up with a notification from CloudKit.

Currently my configuration is like this

CKNotificationInfo *notificationInfo = [CKNotificationInfo new];
    notificationInfo.shouldBadge = false;
    notificationInfo.alertBody = @"";
    notificationInfo.shouldSendContentAvailable = true;
    notificationInfo.soundName = @"";
    subscription.notificationInfo = notificationInfo;

Thank you in advance.

@Paulw11 is right. Once the app is forced quit on the device, all the background services are shut down until the user launches the app again.

This is probably a user training issue where you should say clearly in your app somewhere that they shouldn't quit the app manually, but just let it stay active in order for users to get alarms.

Force-quitting apps is a paranoid habit by many iOS users (even non-techy) ones. It's entirely unnecessary since iOS manages resources efficiently when apps aren't running.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM