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

Types wrong in 3.5.1 #740

Closed
jvandenaardweg opened this issue Sep 30, 2019 · 4 comments
Closed

Types wrong in 3.5.1 #740

jvandenaardweg opened this issue Sep 30, 2019 · 4 comments
Labels
🐛 bug Something isn't working ❄️ types Typing issues

Comments

@jvandenaardweg
Copy link
Contributor

jvandenaardweg commented Sep 30, 2019

Version of react-native-iap

3.5.1

Version of react-native

0.61.0

Platforms you faced the error (IOS or Android or both?)

both

Expected behavior

no type errors

Actual behavior

type errors on acknowledgePurchaseAndroid and requestSubscription. But maybe more.

Tested environment (Emulator? Real Device?)

emulator

Steps to reproduce the behavior

running the latest version and then do your type checking

Solution

requestSubscription = (sku: string, oldSku: string, prorationMode: number)

Should be:

requestSubscription = (sku: string, oldSku?: string, prorationMode?: number)

and...

acknowledgePurchaseAndroid = (token: string, developerPayload: string)

Should be:

acknowledgePurchaseAndroid = (token: string, developerPayload?: string)

I guess there are more of these little things now since the index.d.ts is gone and index.ts does not yet reflect those types. Don't have the time to go through them all at this moment. Just letting you know the types should be looked at :-)

@nathantqn
Copy link

I'm facing the same problem, the fields oldSku and prorationMode of requestSubscription should be optional

@hyochan hyochan added 🐛 bug Something isn't working ❄️ types Typing issues labels Sep 30, 2019
@hyochan
Copy link
Member

hyochan commented Sep 30, 2019

You guys are right. Sorry that I've missed this out. Today, I've just migrated our project to typescript since there are so many issues related to typings. Now we only need to concentrate on ts file and flow and js will be auto-generated.

I've released 3.5.2 for the fix.

@nathantqn
Copy link

Thanks a lot @hyochan

@jvandenaardweg
Copy link
Contributor Author

Thanks @hyochan for the fast response. Will try it out soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ❄️ types Typing issues
Projects
None yet
Development

No branches or pull requests

3 participants