23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FIGURE 13-19 The user consent prompt when an app requests lock screen access.<br />

FIGURE 13-20 The lock screen option on the Permissions settings panel for apps that request access.<br />

For a complete demonstration, refer to the Lock screen apps sample. In Scenario 1 it shows how to<br />

again request access to the lock screen and check the result, which is a value from the Background-<br />

AccessStatus enumeration. It also shows querying for and removing that access with the<br />

getAccessStatus and removeAccess methods of BackgroundExecutionManager.<br />

Scenario 2 then demonstrates sending badge updates to the lock screen, along with a text tile<br />

update if the app happens to be the single one selected for that privilege. There is nothing particular in<br />

this process where the lock screen is concerned, however: such updates happen exactly as they do for<br />

the primary app tile. It’s just that those updates are also reflected on the lock screen. In the case of<br />

badges, the badge glyph will appear along with the app’s Badge Logo in the Application UI ><br />

Notifications section of the manifest. (Refer back to Figure 13-10.) To repeat from earlier, this graphic<br />

must have white or transparent pixels, and the three scale sizes are 24x24 (100%), 33x33 (140%), and<br />

43x43 (180%).<br />

Scenario 3, finally, demonstrates that secondary tiles can be added to the lock screen as well,<br />

irrespective of the app tile. To make a secondary tile available for the lock screen, assuming that the app<br />

has requested lock screen access already, you need to set those two properties of Windows.UI.-<br />

StartScreen.SecondaryTile that we mentioned long ago: lockScreenBadgeLogo and<br />

lockScreenDisplayBadgeAndTileText. If the secondary tile is on the Start screen, these properties will<br />

also make it available on the PC Settings page for the lock screen.<br />

626

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!