c# - How to implement in-app purchases in a Windows Store App -


i wondering how in-app purchases implemented in windows store apps (meaning not windows phone), because i've looked online , @ microsoft's tutorials , have found nothing seems avail me.

i used unity develop game , exported windows store 8.1 file. specifically, have event implemented in unity code linked method in mainpage.xaml.cs file accessible in visual studio (i running express 2013 windows). actual method being executed, when request product purchase in method so, error:

    // assigned event called in unity whenever "get points" button pressed.     private async void purchasepoints(object arg)     {         // find gamemanager gameobject.         unityengine.gameobject gamemanager = unityengine.gameobject.findgameobjectwithtag("gamemanager");          // script attached it.         gamemanager gamemanagerscript = gamemanager.getcomponent<gamemanager>();          // license information app.         windows.applicationmodel.store.licenseinformation licenseinformation = windows.applicationmodel.store.currentappsimulator.licenseinformation;          if (licenseinformation.productlicenses["sectordefense_points_250"].isactive)         {             await windows.applicationmodel.store.currentappsimulator.requestproductpurchaseasync("sectordefense_points_250");              gamemanagerscript.playerscore += 250;         }     } 

i'm confused how 1 supposed implement sort of functionality.

i've made sure windowsstoreproxy.xml file , customize within suit app's needs, although i've never worked xml before.

any appreciated!

thanks in advance.

no need of hard coding, here easiest way implement in-app purchase application. visit link , download plugin free. microsoft store plugin-https://prime31.com/plugins


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -