简体   繁体   中英

In app purchase with background audio task crash windows phone 8.1 store app

I am adding in app purchase in my windows phone 8.1 store app. I am also using IBackgroundTask for audi.

I want to use in-app purchase, but applications crashes on calling

var result = await CurrentAppSimulator.RequestProductPurchaseAsync(ProProductId);

without any exceptions.

This method is called within try-catch block.

It happens when application already start IBackgroundTask by calling for BackgroundMediaPlayer.Current (happens after few seconds after call RequestProductPurchaseAsync ).

If I call RequestProductPurchaseAsync after start app without calling BackgroundMediaPlayer.Current , it works normally.

What is the reason of this behaviour? Are there any ways to solve this problem?

Note: question already posted here with no perfect answer.

Currently I am shutting down background media player with some delay. Although it is not crashing many times it is not good solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM