This document provides an overview of building Newsstand apps for iOS. It discusses adding Newsstand support to an app by including the UINewsstandApp key in the app's Info.plist. Custom Newsstand icons can be defined to better reflect a publication's content. NewsstandKit is used to retrieve content updates in the background via push notifications, organize issues and assets, and download content. The app's Newsstand icon and badge can be updated to showcase new content and issues to the user.
CNIC Information System with Pakdata Cf In Pakistan
Â
Building newsstand_apps
1. Building Newsstand Apps
Session 504
Ben Nielsen
iOS Application Engineering
These are confidential sessionsâplease refrain from streaming, blogging, or taking pictures
1
12. Appearing in Newsstand
Becoming a Newsstand app
⢠Add one key to your Info.plist
<key>UINewsstandApp</key>
<true/>
⢠Youâre now a Newsstand app!
⢠But you need an iconâŚ
12
13. Appearing in Newsstand
Time for an icon
⢠One icon style in iOS 4
â Home screen
â Search
â Settings
â App switcher
â Notifications
13
15. Appearing in Newsstand
Newsstand icons
⢠Distinct from standard app icons
â Home screen and app switcher
⢠Should reflect your content
⢠Dynamicâcan be updated after
your app is installed
⢠Additional adornment for magazine
and newspaper styles
15
16. Appearing in Newsstand
Standard icons
⢠We still need them!
â Settings, Search, NotificationsâŚ
⢠Newsstand icon must be defined in addition to the standard icon
16
17. Appearing in Newsstand
Standard icon specification
⢠Top-level key in your Info.plist with an array of image names
<key>CFBundleIconFiles</key>
<array>
! <string>Icon.png</string>
! <string>Icon@2x.png</string>
...
</array>
17
18. Appearing in Newsstand
Newsstand icons
⢠A new top-level Info.plist key
â CFBundleIconsâa dictionary of icon styles
CFBundlePrimaryIcon UINewsstandIcon
18
19. Appearing in Newsstand
Updating your Info.plist
<key>CFBundleIcons</key>
New top-level key
<dict>
<key>CFBundlePrimaryIcon</key>
Icon style key
<dict>
<key>CFBundleIconFiles</key>
<array>
Existing CFBundleIconFiles <string>Icon.png</string>
<string>Icon@2x.png</string>
</array>
</dict>
</dict>
19
20. Appearing in Newsstand
Updating your Info.plist
<key>CFBundleIcons</key>
New top-level key
<dict>
<key>CFBundlePrimaryIcon</key>
Icon style key
<dict>...</dict>
<dict>
<key>CFBundleIconFiles</key>
<array>
Existing CFBundleIconFiles <string>Icon.png</string>
<string>Icon@2x.png</string>
</array>
</dict>
</dict>
20
21. Appearing in Newsstand
Customizing your Newsstand icon
⢠Icons are adorned to resemble their physical counterparts
â Newspaper or magazine?
â Binding edge
⢠Exist as keys inside the UINewsstandIcon style dictionary
21
22. Appearing in Newsstand
Customizing your Newsstand icon
UINewsstandBindingTypeMagazine UINewsstandBindingTypeNewspaper
Stack
Staples Pages
Fold
UINewsstandBindingEdgeLeft
UINewsstandBindingEdgeRight
UINewsstandBindingEdgeBottom
22
23. Appearing in Newsstand
Updating your Info.plist
<key>CFBundleIcons</key><dict>
<key>UINewsstandIcon</key><dict> Newsstand style
<key>CFBundleIconFiles</key>...</array> key and icon files
<key>UINewsstandBindingType</key>
<string>UINewsstandBindingTypeNewspaper</string>
Options
<key>UINewsstandBindingEdge</key>
<string>UINewsstandBindingEdgeBottom</string>
</dict>
</dict>
23
24. Appearing in Newsstand
Additional considerations
⢠Icons need not be square
â Use a shape that matches your physical appearance
⢠You must still include CFBundlePrimaryIcon
â Standard and Newsstand icon are both needed
⢠Backward compatibility
â CFBundleIcons is required for Newsstand apps in iOS 5
â Can coexist with existing icon keys for earlier versions of iOS
24
36. INFORMING
Downloading Content UPDATING ORGANIZING
NKAssetDownload
DOWNLOADING
⢠Handles data transfer
â Keeps going
⢠Uses NSURLConnectionDelegate
⢠Wake for critical events
newsstand-content
⢠Wi-Fi only in background
36
37. INFORMING
Downloading Content UPDATING ORGANIZING
Setup
DOWNLOADING
NSArray *itemsToDownload = !! query server for list of assets
for (item in itemsToDownload) {
NSURLRequest *downloadRequest = [item URLRequest];
NKAssetDownload *asset = [issue addAssetWithRequest:downloadRequest];
NSURLConnection *connection = [asset downloadWithDelegate:myDelegate];
}
37
41. INFORMING
Downloading Content UPDATING ORGANIZING
Background
DOWNLOADING
⢠What if the app is suspended?
â No status updates
â Wakes for authentication and completion
⢠What if the app is terminated!?
â Relaunched in the background
UIApplicationLaunchOptionsNewsstandDownloadsKey
NSString *assetIdentifier = [myAssetDownload identifier];
41
42. INFORMING
Downloading Content UPDATING ORGANIZING
Reconnecting
DOWNLOADING
⢠Reconnect on launch
NKLibrary *library = [NKLibrary sharedLibrary];
for (NKAssetDownload *asset in [library downloadingAssets])
NSURLConnection *connection = [asset downloadWithDelegate:myDelegate];
⢠Always!
â Abandoned downloads may get cancelled
42
43. INFORMING
Downloading Content UPDATING ORGANIZING
Completion
DOWNLOADING
⢠Success!
-connectionDidFinishDownloading:destinationURL:
â Destination is a temporary file
â Move to issue repository
[myIssue contentURL]
â Process
-[UIApplication beginTaskWithExpirationHandler:];
43
46. INFORMING
Updating Your Newsstand Icon UPDATING ORGANIZING
Showing off your new content
DOWNLOADING
⢠Part of getting new content
is obtaining a new icon
⢠Once content is ready to view,
show it off!
â Update your Newsstand icon
â Inform readers of new
issues via badging
June 2011
May 2011
46
47. INFORMING
Updating Your Newsstand Icon UPDATING ORGANIZING
Update your icon
DOWNLOADING
⢠Publication covers play a huge role in the physical newsstand
â We want your icons to do the same here
⢠Your icon should represent your most recent content
â But donât show it until your content is ready to read!
⢠Changes the appearance of your app in Newsstand and app switcher
â Overrides your UINewsstandIcon, not your standard app icon
47
48. INFORMING
Updating Your Newsstand Icon UPDATING ORGANIZING
Update your icon
DOWNLOADING
⢠Simple!
-[UIApplication setNewsstandIconImage:(UIImage*)]
⢠Can be used while running in the background, so update whenever
your content is ready
48
49. INFORMING
Updating Your Newsstand Icon UPDATING ORGANIZING
Badge your app
DOWNLOADING
⢠Badges in Newsstand have a revised look: âNewâ sash
⢠Add a badge when a user has not yet opened a particular issue
â Remove the badge once it has been read
49
50. INFORMING
Updating Your Newsstand Icon UPDATING ORGANIZING
Badge your app
DOWNLOADING
⢠Uses existing badge API
-[UIApplication setApplicationIconBadgeNumber:(NSInteger)]
⢠As with normal badging...
â Non-zero value shows the sash
â Zero clears the sash
⢠The count is not shown, but it should track your unread issues
50
57. Summary
⢠Becoming a Newsstand app is easy
⢠Get content updates in the background
⢠Use NewsstandKit to download and organize content
⢠Update your Newsstand icon and badge to show off your content
57
59. Related Sessions
Presidio
App Publishing with iTunes Connect Thursday 10:15AM
Pacific Heights
Local and Push Notifications Thursday 4:30PM
Russian Hill
Adopting Multitasking Thursday 4:30PM
59
60. Labs
Internet & Web Lab B
Newsstand Lab Thursday 2:00PM
Internet & Web Lab A
App Publishing with iTunes Connect Lab Thursday 2:00PM
Internet & Web Lab A
Local and Push Notifications Lab Friday 9:00AM
60