react-native-contrib / react-native-heyzap

A Heyzap plugin for React Native
MIT License
5 stars 1 forks source link

Error handling #1

Open hassankhan opened 8 years ago

hassankhan commented 8 years ago

A second set of eyes would be great to check over the Android and iOS implementations.

ekilah commented 8 years ago

https://github.com/react-native-contrib/react-native-heyzap/blob/9356f957e61511e3a1bca50b6aea6eaf56661c65/ios/Heyzap.m#L224

Adding nil to the dictionary won't work if these values are missing, you may want to just use an empty string for your bridge.

edit: you can use the ?: operator in Objective C to default to something, like:

NSString *defaultedToEmpty = maybeNilString ?: @"";

hassankhan commented 8 years ago

Haha thanks for checking my shitty implementation, this was one instance where, being an ObjC noob, I had no idea what to do. I tried using a ternary earlier, clearly must've been doing something wrong because I couldn't compile the code. Thanks for the pointers!!

ekilah commented 8 years ago

No worries - I work at Heyzap and we were excited to review what you've done! Glad to help. I don't have much time at the moment but I might contribute with some PRs in the future instead of just commenting, but I am a react noob 😛