In the below steps, we are trying to connect a Construct 2 test project to Myket in-App Purchase service:
- First, download the In-App Purchase Test project here and open it in the Construct 2 environment.
- Then, by using the Node.js Command Prompt, enter the below command and create the Cordova project at your desired location:
cordova create In-AppPurchase ir.myket.iap.construct2 In-AppPurchase
- When developing the app, note that application Package name is ir.myket.iap.construct2.
- Then return to the Construct 2 environment and export the project to the folder that you created in the previous step.
- We use Intel XDK software to add plug-ins. Run the program and add the plugin like the image:*It should be noted that in this program you must create an account and developer certificate to use to sign up for the APK.
- If you encounter the “requested plugin was not found” error message, click the remove button.7. After the project is opened, log in to Plugin management.
- Download myket-iab-cordova-plugin from here and click the Add Plugins button.9. In the Plugin variable field, you must enter the public key of your app, which you received from Myket developer panel. To do this, enter BILLING_KEY in the left section and enter the key in the right section. For this test project, the public key is in the below box:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCcXdOUo+1NxAZ72i2hFvq9GwJSUWNBnu/PtxqKTl2M5Z3ozGYjaSJT2rgZtqG+jdIy8fFkx8oAOjtgQyQeaQ5Qcxl7B6lsJEFOuPHVcD3qhEvavxDnemDZ3NfvoK+F8GMGppd7mQW90JJuAer+gq4esigb1ch9upkGgi5QpghQHwIDAQAB
- Then create the Apk file in the Build tab (at the top).
- Click Start Build to start the process. If you encounter an error during the build, update your plugins from the plugin management section.
- Download and install Apk file.