Beginning with the Windows Phone 8 SDK, you have the opportunity to integrate your app with the phone’s lock screen, which includes setting of the lock screen background image, posting notification text to the notification area, and displaying a numeric count field (see Figure 13.9). Apps that integrate with the phone’s lock screen are known as live apps.
Tip
To view the lock screen when using the Windows Phone emulator, press F12 twice. Pressing F12 once simulates locking the device via the power button. Pressing F12 again brings up the lock screen.
Three parts of the lock screen can potentially be modified by your app. Changing the lock screen background image is achieved using the phone SDK’s lock screen API. Setting of the lock screen’s notification text and count field is done via your app’s primary tile.
To enable modification of the lock screen, you need to add extension elements to the app’s WMAppManifest.xml file. In the Visual Studio Solution Explorer, expand Properties, right-click WMAppManifest.xml, click View Code. If not already present, insert an Extensions
element immediately after the Tokens
element in the WMAppManifest.xml file. Observe the following excerpt, which shows the extensions elements for the various lock screen related features:
<Extensions>
<Extension ExtensionName="LockScreen_Background"
ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}"
TaskID="_default" />
<Extension ExtensionName="LockScreen_Notification_IconCount"
ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}"
TaskID="_default" />
<Extension ExtensionName="LockScreen_Notification_TextField"
ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}"
TaskID="_default" />
</Extensions>
If you plan to change the lock screen’s background image, include the LockScreen_Background
extension. If you plan to include your tile’s Count
on the lock screen, include the LockScreen_Notification_IconCount
extension. Include the LockScreen_Notification_TextField
extension if you plan to include notification text on the lock screen.
Include only the Extension
elements that you want to support. This avoids unnecessarily cluttering the lock screen’s setting page and avoids misleading the user about your app’s capabilities.
18.117.184.189