3 Star 5 Fork 0

华为移动服务 / hms-iap-vr-clientdemo

Gitee — Enterprise-level DevOps R&D management platform
Join Gitee
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Notice: Creating folder will generate an empty file .keep, because not support in Git

HUAWEI In-App Purchases(IAP) Clientdemo for VR

The iap_demo App demonstrates Huawei VR Pay client APIs and usages.

Table of Content


Huawei VR Pay is a payment service provided by Huawei in-app Purchases in VR devices. Currently, only the api for customizing prices is provided. CP need to define offering information in their apps.

Disclaimer: The demo only demonstrates the purchase procedure, and it does not have a real use of purchased products.

Getting Started

  1. Check whether the Android studio development environment is ready. Open the sample code project directory with file "build.gradle" in Android Studio.

  2. Finish the configuration in AppGallery Connect. See details: Configuring AppGallery Connect

  3. To build this demo, please first import the demo in the Android Studio (3.x+).

  4. Configure the sample code:

    • Download the file "agconnect-services.json" of the app on AGC, and add the file to the app root directory(\app) of the demo.
    • Add the certificate file to the project and add your configuration to in the app-level build.gradle file.
    • Open the AndroidManifest file and change the value of package to your app package name.
    • Replace the PUBLIC_KEY in the Constant class with the public key of your app.
    • Replace the PRIVATE_KEY in the Constant class with the private key of your app.
    • Replace the APPID and MERCHANTID in the Constant class with the appid and merchantid of your app.
  5. Run the sample on your Android device or emulator.

Supported Environments

Android SDK Version >= 22 and JDK version >= 1.8 is recommended.


Once you start the demo, you should be able to see the following page.

demo home page

Tap 确认支付 ¥0.01, the demo will call the pay API, and jump to the checkout page which is provided by IAP Service.

payment selection

Once purchase succeed, IAP Service will display the purchase result.

payment result

Question or issues

If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.

If you have questions about how to use HMS samples, try the following options:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.

If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.


This demo is licensed under the Apache License, version 2.0.

Repository Comments ( 0 )

Sign in for post a comment


华为应用内支付vr支付客户端示例代码。此代码主要介绍华为应用内支付服务VR支付的客户端开发步骤,帮助您快速了解华为VR支付提供的客户端接口及其使用方法。 expand collapse


No release





load more
can not load any more


181749 a2d7925e 1850385 181749 9f8568a7 1850385