Skip to content
This repository was archived by the owner on Oct 20, 2020. It is now read-only.

Commit 97c6b88

Browse files
committed
Update README.md
1 parent 299fef0 commit 97c6b88

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,16 @@ In order to do this send in `null` as parameter, along with your Activity-instan
110110

111111
[See the Google Play docs for more info on static responses](http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static).
112112

113-
## Testing with your own In-App Products
114-
You can always test with static responses but it has limited functionalities. Testing with real in-app products will be like production. Before all, you'll need to do the following ;
115-
* I assume you've already created your Google Play Developer account and an application draft.
116-
* Now you need to create In-app Products at Play Developer Console and activate it ( a button at the top right )
117-
* Then you can write the JS codes like explained in Javascript API section, I suggest you to use `getProductDetails` function to see if it's working properly.
118-
* After you ready to test, you'll need to properly create a signed APK. You can follow the guide [here](https://facebook.github.io/react-native/docs/signed-apk-android.html).
119-
* When you have the APK, you need to upload it to Play Developer Console, Alfa or Beta section will be OK.
120-
* After uploading process, you have to publish it to market. Don't worry, if your APK belongs in Alfa or Beta section, publishing will not be available for general public. ( It could take 1 - 2 hours process APK by Google )
121-
* The final part is, you'll need to create a Open Beta Testing or Open Alfa Testing. So console will give you a signup URL after you approved open testing. Now put this URL in the browser of your **testing device** (it must be a physical device, not a emulator ) signup from the URL and download the app where it redirected.
122-
* Try to buy something with Open Beta User, it will ask your credit cart details but you will not be charged.
123-
113+
## Testing with your own In-app products
114+
Testing with static responses is limited, because you are only able to test the purchase-method. Therefore, testing with real In-app products is recommended. But before that is possible, you need to do the following:
115+
* I will assume you've already created your Google Play Developer account and an application there.
116+
* Now you need to create In-app Products under your application at Play Developer Console and activate it (press the button at the top right).
117+
* Assuming you have installed this module (InApp Billing), you can write the JS code as explained in the Javascript API section. I suggest you to use `getProductDetails` function to see if it's the product is retrieved.
118+
* When you're ready to test, you'll need to properly create a signed APK. You can follow this [guide](https://facebook.github.io/react-native/docs/signed-apk-android.html).
119+
* When you have the APK, you need to upload it to Play Developer Console, either the Alpha or the Beta channel will be OK.
120+
* After uploading, you will have to publish it to the market. Don't worry, when publishing the APK to the Alpha or Beta channel the APK will not be available for general public. (**ImportantÆ*: It might take several hours for Google to process the APK).
121+
* The final part is, you'll need to create an add testers for the channel you've published to. The web page will give you a signup URL (opt-in) after you've approved open testing. Visit this URL in the browser of your **testing device** (it must be a physical device, not a emulator) signup from the URL and download the app where it redirected.
122+
* Try to buy something with the device. The purchase will eventually be cancelled, but you can also do this manually through your Google Merchant wallet.
124123

125124
## Javascript API
126125
All methods returns a `Promise`.
@@ -174,7 +173,7 @@ InAppBilling.purchase('android.test.purchased')
174173
* **consumed:** Boolean (If consumed or not)
175174

176175
```javascript
177-
InAppBilling.consumePurchase('android.test.purchased').then(...);
176+
InAppBilling.consumePurchase('your.inapp.productid').then(...);
178177
```
179178

180179
### subscribe(productId)
@@ -192,7 +191,7 @@ InAppBilling.consumePurchase('android.test.purchased').then(...);
192191
* **receiptData:** String
193192

194193
```javascript
195-
InAppBilling.subscribe('android.test.subscription')
194+
InAppBilling.subscribe('your.inapp.productid')
196195
.then((details) => {
197196
console.log(details)
198197
});
@@ -206,7 +205,7 @@ InAppBilling.subscribe('android.test.subscription')
206205
* **subscribed:** Boolean
207206

208207
```javascript
209-
InAppBilling.isSubscribed('android.test.subscription').then(...);
208+
InAppBilling.isSubscribed('your.inapp.productid').then(...);
210209
```
211210

212211
### isPurchased(productId)
@@ -217,7 +216,7 @@ InAppBilling.isSubscribed('android.test.subscription').then(...);
217216
* **purchased:** Boolean
218217

219218
```javascript
220-
InAppBilling.isPurchased('android.test.purchased').then(...);
219+
InAppBilling.isPurchased('your.inapp.productid').then(...);
221220
```
222221

223222
### listOwnedProducts()
@@ -251,7 +250,7 @@ InAppBilling.listOwnedSubscriptions().then(...);
251250
* **priceText:** String
252251

253252
```javascript
254-
InAppBilling.getProductDetails('android.test.purchased').then(...);
253+
InAppBilling.getProductDetails('your.inapp.productid').then(...);
255254
```
256255

257256
### getProductDetailsArray(productIds)
@@ -262,7 +261,7 @@ InAppBilling.getProductDetails('android.test.purchased').then(...);
262261
* **productDetailsArray:** Array of the productDetails (same as above)
263262

264263
```javascript
265-
InAppBilling.getProductDetailsArray(['android.test.purchased', 'android.test.purchased2']).then(...);
264+
InAppBilling.getProductDetailsArray(['your.inapp.productid', 'your.inapp.productid2']).then(...);
266265
```
267266

268267
### getSubscriptionDetails(productId)
@@ -280,7 +279,7 @@ InAppBilling.getProductDetailsArray(['android.test.purchased', 'android.test.pur
280279
* **priceText:** String
281280

282281
```javascript
283-
InAppBilling.getSubscriptionDetails('android.test.subscription').then(...);
282+
InAppBilling.getSubscriptionDetails('your.inapp.productid').then(...);
284283
```
285284

286285
### getSubscriptionDetailsArray(productIds)
@@ -291,7 +290,7 @@ InAppBilling.getSubscriptionDetails('android.test.subscription').then(...);
291290
* **productDetailsArray:** Array of the productDetails (same as above)
292291

293292
```javascript
294-
InAppBilling.getSubscriptionDetailsArray(['android.test.subscription', 'android.test.subscription2']).then(...);
293+
InAppBilling.getSubscriptionDetailsArray(['your.inapp.productid', 'your.inapp.productid2']).then(...);
295294
```
296295

297296
### getPurchaseTransactionDetails(productId)
@@ -309,7 +308,7 @@ InAppBilling.getSubscriptionDetailsArray(['android.test.subscription', 'android.
309308
* **receiptData:** String
310309

311310
```javascript
312-
InAppBilling.getPurchaseTransactionDetails('android.test.purchased')
311+
InAppBilling.getPurchaseTransactionDetails('your.inapp.productid')
313312
.then((details) => {
314313
console.log(details)
315314
});
@@ -330,7 +329,7 @@ InAppBilling.getPurchaseTransactionDetails('android.test.purchased')
330329
* **receiptData:** String
331330

332331
```javascript
333-
InAppBilling.getSubscriptionTransactionDetails('android.test.subscription')
332+
InAppBilling.getSubscriptionTransactionDetails('your.inapp.productid')
334333
.then((details) => {
335334
console.log(details)
336335
});

0 commit comments

Comments
 (0)