Skip to content

Commit

Permalink
Fixed android method and readme.
Browse files Browse the repository at this point in the history
`refreshAllPurchaseItems()` method  had error in parameter. Fixed it and also edited the readme. Published to npm version 0.2.5.
  • Loading branch information
hyochan committed Jan 24, 2018
1 parent 88e6a47 commit 87dfa77
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ Android iap is implemented with iap version 3 which is currently recent.

## Important
[email protected] has been published and it is recommended to use version after `0.2.0` from `2018/01/23`.
`react-native-iap` module versions that are not described in `change logs` may not run as expected so please refer to version mentioned in `Changelogs` below.

The `[Breaking Changes]` from version `0.1.*` is that you have `prepare() method deprecated` which you should call before using `RNIap` methods. Now you have to call `prepareAndroid()` instead just to know that it is just android dependent method.
Also to import module, previously in `0.1.*` you only had to do `import RNIap from 'react-native-iap'` but now you have to do like `import * as RNIap from 'react-native-iap'`.
## Breaking Changes
Changes from `[email protected].*` to `[email protected].*` is that you have `prepare()` method deprecated which you should call before using `RNIap` methods. Now you have to call `prepareAndroid()` instead just to know that it is just android dependent method.
Also to import module, previously in `[email protected].*` you had to `import RNIap from 'react-native-iap'` but now you have to do like `import * as RNIap from 'react-native-iap'`.

For new method, refreshAllItems has been implemented for both ios and android. This feature will support senario for non-consumable products.

Also there are some other methods that is not supported in ios and implemented in android. You can see more in Changelogs below.
Lastly, this module also supports types for typescript users from `0.2.5`.

## Changelogs
- **[0.2.5]**
+ types support.
![alt text](https://firebasestorage.googleapis.com/v0/b/bookoo-89f6c.appspot.com/o/typing%20screen%20shot.png?alt=media&token=ea2ef1f3-50af-4d9c-8388-7fd22ddc8aa0)
+ call new Method for android inside refreshItems(). This will now return object values like ios.
- **[0.2.3]**
+ Support annotations to hint while using our module.
- **[0.2.0]**
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const refreshAllItems = () => {
} else if (Platform.OS === 'android') {
return new Promise(function (resolve, reject) {
try {
RNIapModule.refreshAllPurchaseItems('INAPP', (err, items) => {
RNIapModule.refreshAllPurchaseItems((err, items) => {
if ((typeof items) === 'string') {
resolve(JSON.parse(items));
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-iap",
"version": "0.2.4",
"version": "0.2.5",
"description": "",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 87dfa77

Please sign in to comment.