Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAP subscription purchase error. #100

Closed
Suraj-Tiwari opened this issue Apr 5, 2018 · 12 comments
Closed

IAP subscription purchase error. #100

Suraj-Tiwari opened this issue Apr 5, 2018 · 12 comments

Comments

@Suraj-Tiwari
Copy link

Version of react-native-iap

Latest

Expected behavior

data

Actual behavior

Error

Steps to reprodue the behabior

Well in my case, Install -> manual merge -> then this code

try {
//also tried RNIap.getSubscriptions().then((data) => ....);
    RNIap.getProducts().then((item_receipt) => {
                    console.log(item_receipt);
    }).catch(err => alert('errror :' + err))
} catch (err) {
alert('errror :' + err);
}

Error message: Type Error Cannot read property of getitems of undefined.

@hyochan
Copy link
Owner

hyochan commented Apr 5, 2018

@Suraj-Tiwari Check the version and the readme. There is breaking changes in method name.

@hyochan hyochan closed this as completed Apr 5, 2018
@Suraj-Tiwari
Copy link
Author

Well that was an example

RNIap.buySubscription('my.sub.id').then((item_receipt) => {
                    console.log(item_receipt);
                }).catch(err => alert('errror :' + err))

This code produce same error too.

Error message: Type Error Cannot read property of 'buyProduct' of undefined.

@hyochan
Copy link
Owner

hyochan commented Apr 5, 2018

@Suraj-Tiwari
Could you describe the issue properly? Because I am confused. You wrote buySubscription on the code but the error message is buyProduct of undefined. Please provide the problem thorougly, so we can understand the problem. Providing your procedure would be helpful too.

@Suraj-Tiwari
Copy link
Author

Alright, Main issue is Both functions are firing undefined error for different variables and other functions too like getProducts() etc..
this message is on simulator

And same code gave this error on Physical device

Type Error: undefined is not an object (evaluating 'i.buyProduct')

Error

Code

@Suraj-Tiwari
Copy link
Author

Because I am confused. You wrote buySubscription on the code but the error message is buyProduct of undefined.

That's why i filed an issue because i was confused too #reopen this issue until it's resolved.
I'll try to Resolve from my end too.

@hyochan
Copy link
Owner

hyochan commented Apr 6, 2018

Did you link the library properly? If you checked the version perperly and used the proper methods name, I think that would be the reason you get undefined.

If you did, provide us our module version and your react-native version for more info.

### Version of react-native-iap

### Expected behavior

### Actual behavior

### Steps to reprodue the behabior

Also FYI, you don't have to write Platform specific code for our project because we do this our own.

@Suraj-Tiwari
Copy link
Author

Ok so this was happening because i forgot to add libRNIap.a
but after adding i Got this #98 again
ISSUE

@Suraj-Tiwari
Copy link
Author

Suraj-Tiwari commented Apr 6, 2018

### "react-native-iap": "^0.3.1",
### Successful purchase
### Errors 
### Install library > link manually IOS> and again compile error```

@andrideng
Copy link

@dooboolab @Suraj-Tiwari meet the same problem too. so far any solution?

@hungvu193
Copy link

hungvu193 commented Aug 14, 2018

i face this issue with react-native 0.5.4 and react-native-iap : ^1.3.5, any solutions?

@andrideng
Copy link

@hungvu193 try to connect the library manually, it works for me. 👯‍♂️

@Suraj-Tiwari
Copy link
Author

There are many fluctuations with latest react-native version. IF facing any issue try to go previous build,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants