From 422f9f17169f6977271268a2d23c7ce70365124b Mon Sep 17 00:00:00 2001 From: Minggang Wang Date: Mon, 18 Jan 2016 16:11:10 +0800 Subject: [PATCH] [IAP]Update the example for IAP extension. As the IAP extension has been refactored, updating this example to combine with the new JS interfaces. Also, using app-tools to pack the apk file. BUG=XWALK-5696,5697 --- examples/iap/README.md | 20 +++ examples/iap/iap.html | 315 +++++++++++++++++++------------------ examples/iap/iap.json | 9 -- examples/iap/manifest.json | 7 + 4 files changed, 185 insertions(+), 166 deletions(-) create mode 100644 examples/iap/README.md delete mode 100644 examples/iap/iap.json create mode 100644 examples/iap/manifest.json diff --git a/examples/iap/README.md b/examples/iap/README.md new file mode 100644 index 0000000..c2bd180 --- /dev/null +++ b/examples/iap/README.md @@ -0,0 +1,20 @@ +# Package for Google Play&XiaoMi Store +1. Install Crosswalk App Tools, see https://github.com/crosswalk-project/crosswalk-app-tools for details. +2. Change ```"xwalk_package_id"``` in manifest.json to the value below: + * ```"com.crosswalk.iapsample"``` for Google Play. + * ```"com.sdk.migame.payment"``` for XiaoMi Store. +3. Download the extension zip file from https://github.com/crosswalk-project/crosswalk-android-extensions/releases and unpack it, change ```"xwalk_extensions"``` to the path of the extensions in manifest.json. +4. Add the following additional permissions in the default AndroidManifest.xml: + + ``` + + + + + ``` +5. Run ```crosswalk-pkg```: + ``` + crosswalk-pkg --targets="arm" --platform="android" --release \ + --crosswalk=/path/to/xwalk_app_template examples/iap + ``` +6. Sign the apk manually, see https://developer.android.com/tools/publishing/app-signing.html#signing-manually for details. diff --git a/examples/iap/iap.html b/examples/iap/iap.html index 7bcaacd..1168023 100644 --- a/examples/iap/iap.html +++ b/examples/iap/iap.html @@ -1,157 +1,158 @@ - - - - - - - -
test
-

-

-
Fuel:
-
-
-
-
- -
-
- - -
- -
- -
-
-
-
- - - - + + + + + + Sample of In-app purchase + + + + + +

Sample of In-app purchase

+
+

Select the store which you want to test.

+
+ +
+
+ +
+
+ +
+
+
+
+ + diff --git a/examples/iap/iap.json b/examples/iap/iap.json deleted file mode 100644 index 15579ca..0000000 --- a/examples/iap/iap.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "iap-test", - "version": "0.0.0.1", - "app": { - "launch":{ - "local_path": "iap.html" - } - } -} diff --git a/examples/iap/manifest.json b/examples/iap/manifest.json new file mode 100644 index 0000000..20f13e5 --- /dev/null +++ b/examples/iap/manifest.json @@ -0,0 +1,7 @@ +{ + "name": "InAppPurchaseDemo", + "start_url": "iap.html", + "xwalk_package_id": "com.crosswalk.iapsample", + "xwalk_app_version": "1.0.0", + "xwalk_extensions": ["/path/to/extensions"] +}