c# - Can I test real In-App Purchases before submitting to the Store? -
building in-app purchases in windows store app requires using in-app purchase simulator. almost identical real in-app purchase namespace. while building app, utilize simulator. have reserved name in store. have created in-app purchase in store app. there way test real iap before submitting app certification?
no, in-app purchases not "real" in windows store until app submitted certification. means final step before submission swap out simulator code real code. and, yes, means cannot test real code - store tester first test you.
one more thing
having said that, created helper class wraps both real , simulator api. though help 90% of utilize cases out there, perfect 90%. have validated code iap product team , submitted real apps utilize it.
you can find helper here: http://codepaste.net/rqwtcy
here's syntax if want remove advertisements, example...
i add together view model this:
public async task start() { // in app purchase setup m_hideadsfeature = await new inapppurchasehelper(hideadsfaeturename, system.diagnostics.debugger.isattached).setup(); this.hideads = m_hideadsfeature.ispurchased; } bool m_hideads = false; public bool hideads { { homecoming m_hideads; } set { setproperty(ref m_hideads, value); } } const string hideadsfaeturename = "hideads"; inapppurchasehelper m_hideadsfeature; // http://codepaste.net/ho9s5a delegatecommand m_purchasehideadscommand = null; public delegatecommand purchasehideadscommand { { if (m_purchasehideadscommand != null) homecoming m_purchasehideadscommand; m_purchasehideadscommand = new delegatecommand( purchasehideadscommandexecute, purchasehideadscommandcanexecute); this.propertychanged += (s, e) => m_purchasehideadscommand.raisecanexecutechanged(); homecoming m_purchasehideadscommand; } } async void purchasehideadscommandexecute() { pausecommandexecute(); await m_hideadsfeature.purchase(); hideads = m_hideadsfeature.ispurchased; } bool purchasehideadscommandcanexecute() { if (m_hideadsfeature == null) homecoming false; homecoming !m_hideadsfeature.ispurchased; }
i add together xaml this:
<ui:adcontrol x:name="myadcontrol" width="250" height="250" horizontalalignment="left" verticalalignment="top" adunitid="10043107" applicationid="d25517cb-12d4-4699-8bdc-52040c712cab" visibility="{binding hideads, converter={staticresource collapsedwhentrueconverter}}" />
best of luck!
c# in-app-purchase windows-store-apps winrt-xaml
No comments:
Post a Comment