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

fix(android): proper parsing of plugin integers and doubles #2234

Merged
merged 2 commits into from
Dec 9, 2019

Conversation

trancee
Copy link
Contributor

@trancee trancee commented Dec 9, 2019

When passing in a value via JavaScript to Capacitor like this:
({volume:0.0})
then Capacitor in Android is parsing this to an Integer instead and getFloat() will fail since it is expecting a Float type.

The same happens when doing this:
({volume:0.1})
then Capacitor in Android is parsing this to a Double instead.

So I added explicit casting for these 2 use cases.

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thanks!

@jcesarmobile jcesarmobile changed the title Fixed issue where value is Integer or Double when parsed from JS. fix(android): proper parsing of plugin integers and doubles Dec 9, 2019
@jcesarmobile jcesarmobile merged commit 7fc4b5d into ionic-team:master Dec 9, 2019
@trancee trancee deleted the android/getfloat branch December 10, 2019 00:32
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

Successfully merging this pull request may close these issues.

2 participants