@@ -6,12 +6,12 @@ InApp Billing for Cafe Bazaar (Android)
6
6
## Installation
7
7
8
8
1 . ` npm install --save react-native-cafe-bazaar `
9
- 2 . Add the following in ` android/setting .gradle `
9
+ 2 . Add the following in ` android/settings .gradle `
10
10
11
11
``` gradle
12
12
...
13
13
include ':react-native-cafe-bazaar', ':app'
14
- project(':react-native-cafe-bazaar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cafe-bazaar/android')
14
+ project(':react-native-cafe-bazaar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cafe-bazaar/android/app ')
15
15
```
16
16
17
17
3 . And the following in ` android/app/build.gradle `
@@ -27,7 +27,7 @@ InApp Billing for Cafe Bazaar (Android)
27
27
4 . Update MainActivity or MainApplication depending on React Native version.
28
28
- React Native version >= 0.29
29
29
Edit ` MainApplication.java ` .
30
- 1 . Add ` import com.contoriel.cafebazaar.CafeBazaarPackage; `
30
+ 1 . Add ` import com.contoriel.cafebazaar.CafeBazaarPackage; ` in the top of the file.
31
31
2 . Register package:
32
32
``` java
33
33
@Override
@@ -53,6 +53,10 @@ or for React Native 29+
53
53
new CafeBazaarPackage (" YOUR_CAFE_BAZAAR_PUBLIC_KEY_HERE" )
54
54
```
55
55
56
+ Add the billing permission as follows to AndroidManifest.xml file:
57
+ ``` xml
58
+ <uses-permission android : name =" com.farsitel.bazaar.permission.PAY_THROUGH_BAZAAR" ></uses-permission >
59
+ ```
56
60
57
61
58
62
### ON THE BAZAAR DEVELOPER PANEL
@@ -78,6 +82,10 @@ Most of methods returns a `Promise`.
78
82
** Important:** Opens the service channel to CafeBazaar. Must be called (once!) before any other billing methods can be called.
79
83
80
84
``` javascript
85
+ import CafeBazaar from ' react-native-cafe-bazaar'
86
+
87
+ ...
88
+
81
89
CafeBazaar .open ()
82
90
.then (() => CafeBazaar .purchase (' YOUR_SKU' ,' DEVELOPER_PAYLOAD' ,RC_REQUEST ));
83
91
```
0 commit comments