{"id":3298,"date":"2023-06-10T17:15:48","date_gmt":"2023-06-10T21:15:48","guid":{"rendered":"https:\/\/michaelrowe01.com\/?p=3298"},"modified":"2023-06-10T17:15:50","modified_gmt":"2023-06-10T21:15:50","slug":"whats-new-in-background-assets","status":"publish","type":"post","link":"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-background-assets\/","title":{"rendered":"What\u2019s new in Background Assets"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"371\" data-attachment-id=\"3301\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-background-assets\/attachment\/%ef%a3%bfwwdc23-39\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\uf8ffWWDC23-39\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3301\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/%EF%A3%BFWWDC23-39.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Check out Meet Background Assets from WWDC 2022<\/p>\n\n\n\n<p>Feature Recap<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Designed to prevent waiting when launching your app, use a framework and App Extension to download out-of-band content via a CDN or managed server\n<ul class=\"wp-block-list\">\n<li>It will download content that can be placed in your app\u2019s sandbox for use by the app<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Supported on macOS, iOS, and iPadOs<\/li>\n\n\n\n<li>Can run periodically in the at install time before user runs the app, background, or when the app is not running<\/li>\n\n\n\n<li>There are time limits on the run to optimize battery life\n<ul class=\"wp-block-list\">\n<li>Consider memory mapping your data as you are also limited to amount of memory used by your app<\/li>\n\n\n\n<li>The extension can be throttled if the app is not used very often<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The Background Asset manager is prefixed with BA<\/li>\n\n\n\n<li>User can turn off background app refresh turned off or is in low power mode &#8211; your extension will not run.<\/li>\n\n\n\n<li>BADownloadManager is a singleton that can be used throughout your app.&nbsp;<\/li>\n\n\n\n<li>All downloaded assets are marked pursuable by default.&nbsp; If you increase their size after download, they will be marked non-purgeable&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>What\u2019s New<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Essential downloads &#8211; will be integrated into the system and will stop the user from loading the app.\u00a0 They occur during app install. \u00a0 These downloads have priority over normal background downloads.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"371\" data-attachment-id=\"3300\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-background-assets\/attachment\/install-experience\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Install-experience\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience-1024x576.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3300\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/Install-experience.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Non-Essential downloads will be automatically launched after essential downloads are ready.&nbsp; Note the UI changes that shows which part of the install download is App, App Install, and Essential assets.<\/li>\n\n\n\n<li>If a user turns off In-App Content the you will not get essential downloads to download automatically.&nbsp; You will need to code your application to handle download these assets different.<\/li>\n\n\n\n<li>You can convert an essential download to a non-essential download, and the re-enque this download&nbsp;<\/li>\n\n\n\n<li>Also you need to setup your info.plist<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"371\" data-attachment-id=\"3299\" data-permalink=\"https:\/\/michaelrowe01.com\/index.php\/blog\/whats-new-in-background-assets\/attachment\/app-info-plist-requirements\/\" data-orig-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"App-Info.plist-requirements\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?fit=660%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?resize=660%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-3299\" srcset=\"https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/michaelrowe01.com\/wp-content\/uploads\/2023\/06\/App-Info.plist-requirements.png?w=1320&amp;ssl=1 1320w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Sample Implementation<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First add your required info.plist keys<\/li>\n\n\n\n<li>Create your App Extension<\/li>\n\n\n\n<li>Make sure your app extensionMakes and app are both using the same team identifier<\/li>\n\n\n\n<li>Make sure to use .withExclusiveControl for your download session&nbsp;<\/li>\n\n\n\n<li>Promoting from background to foreground does not restart the download, it just continues from where it was at a higher priority.<\/li>\n\n\n\n<li>Always use move objects to move the finished download in to the app package<\/li>\n\n\n\n<li>So far none of my apps have a need for these features.. but I do have a few game ideas which may need this in the future.&nbsp; So definitely keeping this in my back pocket&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Debugging Guidance<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Since the extension launches during the install or periodic system events.\u00a0 You must use a tool called \u201cxcrun backgroundassets-debug\u201d in a terminal to be able to debug with a device paired with your Mac. The device must be in Developer Mode\n<ul class=\"wp-block-list\">\n<li>You can now trigger events to see how the app or extension behaves.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Check out Meet Background Assets from WWDC 2022 Feature Recap What\u2019s New Sample Implementation Debugging Guidance<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"hide_page_title":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,3],"tags":[739,111,680],"class_list":["post-3298","post","type-post","status-publish","format-standard","hentry","category-blog","category-personal-softwareandit","tag-day-6","tag-debugging","tag-wwdc23"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2aMa8-Rc","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/comments?post=3298"}],"version-history":[{"count":1,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3298\/revisions"}],"predecessor-version":[{"id":3302,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3298\/revisions\/3302"}],"wp:attachment":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/media?parent=3298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/categories?post=3298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/tags?post=3298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}