Microsoft
70-355 · Question #52
You create an image library app using the Universal Windows Platform (UWP). You want to use an in-app purchase to grant the user of your app access to an unlimited number of images. You need to…
The correct answer is D. async void BuyUnlimited() { if (! (Incense.ProductLicenses["unlimited"].IsActive)) { await CurrentApp.RequestProductPurchaseAsync("unlimited"); } }. See the full explanation below for the reasoning.
Question
You create an image library app using the Universal Windows Platform (UWP).
You want to use an in-app purchase to grant the user of your app access to an unlimited number of images.
You need to write the code that will allow the user to make the purchase.
Which code snippet should you use?
Options
- Aasync void BuyUnlimited() { if (Nicense.ProductLicense === "unlimited") { await CurrentApp.RequestProductPurchaseAsync("unlimited"); } }
- Basync void BuyUnlimited() { if (! (license.ProductLicenses.GetType() == "unlimited")) { await CurrentApp.RequestProductPurchaseAsync("unlimited"); } }
- Casync void BuyUnlimited() { if ((license.ProductLicenses["unlimited"].IsConsumable) { await CurrentApp.RequestProductPurchaseAsync("unlimited"); } }
- Dasync void BuyUnlimited() { if (! (Incense.ProductLicenses["unlimited"].IsActive)) { await CurrentApp.RequestProductPurchaseAsync("unlimited"); } }
How the community answered
(23 responses)- A17% (4)
- B4% (1)
- C4% (1)
- D74% (17)
Community Discussion
No community discussion yet for this question.