darryncampbell / react-native-datawedge-intents

React Native interface for Zebra's DataWedge Intent API
MIT License
43 stars 46 forks source link

Disable import for iOS when building app for Android and iOS #21

Closed vkozinec closed 2 years ago

vkozinec commented 3 years ago

Hello, we are working on scanning app in React Native and since we are using the same codebase for both platforms there is a bug when using it on iOS.

I see that Platform is imported but never used, so for now I just added if statement to check if it is android and then the error does not happen.

https://github.com/darryncampbell/react-native-datawedge-intents/blob/0c479425b5afdb35877602bc9d88b0831b9de52d/index.js#L7

The issue is that I edited the core file and if the update arrives, changes will be gone. I could fork the repo and then keep up with updates but would be nice to come up with a solution in the main repo.

If we can use this library on iOS devices with some Bluetooth scanners, then this is not the best solution I assume.

Simulator Screen Shot - iPhone 11 - 2021-08-27 at 15 00 45

darryncampbell commented 3 years ago

Hi, could you please raise a pull request and I will test & merge it?

vkozinec commented 3 years ago

Sure, I will just test on more devices since I just checked for "android" platform in code and try to come with a cleaner solution.

iOS does not crash/throws errors anymore, and non-Zebra android devices work with that "fix".