skb1129 / react-native-change-icon

Change your application icon programmatically for React Native apps
MIT License
500 stars 92 forks source link

iOS: actually reject the promise if setAlternateIconName fails #22

Closed MickaelBergem closed 4 years ago

MickaelBergem commented 4 years ago

Currently, the code resolves the promise even before setAlternateIconName resolves.

It would be more robust to actually reject the promise if setAlternateIconName fails, using the completion handler as documented.

skb1129 commented 4 years ago

Hey @MickaelBergem,

Thanks a lot for your PR. I really appreciate you spending your time on this PR. I encourage you to open more PRs. Actually, If you have seen the previous versions of this package, this completion handler method was actually used but I had to remove it because the completion handler is called after the user closes the icon changed alert so the process kind of blocks. Also, the current implementation is similar for both iOS and Android which is why it is preferred.

Thanks!