简体   繁体   中英

Is this Today Extension (iOS8) possible?

I'm exploring the possibility of building a Today Extension for iOS8 and need advice wether this is feasible.

My host app enables a user to take photos with the camera, which then get saved locally within the app using Core Data. I want my Today Extension to select one of those photos at random and display it in the extension. A new, random photo will be selected each day.

Is it possible therefore for the Extension when launched/displayed in the Notification Center to access Core Data stored locally in the app (regardless wether the app is active or not), extract a photo/data and display it?

It is possible if you put your core data database in the shared container, not just a directory within the containing app's sandbox.

See this link where it discusses the shared container: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW6

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