问题
I have a few Windows phone 7 app developed with Windows phone 7.1 SDK. Currently, I'm showing ads in all those free apps. I would like to provide an option to remove ads from the app and allow user to buy the app when they click on it. I know there are such in-app purchase api for windows phone 8. Does anyone know anything about similar api in wp7 or to implement similar thing for windows phone 7 in a custom way?
I see 9gag app by Rudy Huyn (http://www.windowsphone.com/en-us/store/app/9gag/91000c5c-9943-43b8-aa65-7609d91057ef) does it but I'm not sure how he does it. When I click remove ads in this app it take me to the paid version of the app. But there are no separate two apps in the store, like we do - one app as normal and another as Pro.
Any help?
回答1:
You can publish a trial app. This way users can download it for free and then buy if they like it.
Here you can fin tutorial for creating trial apps - http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967558(v=vs.105).aspx . ´
Now I can also show you how to take the user to the Store to see the app's listing with the Buy button:
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.Show();
Please note, that this will work only with published app, not in debugging (the listing is not yet there in Store). Also - there are more useful tasks like MarketplaceReviewTask, you can take a look at it too.
UPDATE: We figured a second way to do this while maintaining the free status of the app in store. Basically you need to publish a free app and a private paid app. Now using MarketplaceDetailTask you can point the user to the paid app by supplying it's GUID:
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.ContentIdentifier = "PAID-APPS-GUID";
marketplaceDetailTask.ContentType = MarketplaceContentType.Applications;
marketplaceDetailTask.Show();
That said, you need to publish the paid one first to find out it's Store GUID that you can then insert into the public free one.
来源:https://stackoverflow.com/questions/21089924/is-there-a-way-to-implement-custom-in-app-upgrade-in-windows-phone-7