Open aminmeshk opened 4 years ago
Anyone else having the exact same problem? AndroidSuccessTypes is defined in module but when imported, is undefined.
It's due to that the AndroidSuccessTypes
enum is exported from the index.d.ts
, which doesn't seem to work. Something like this should work:
SendSMS.send({successTypes: ['sent', 'queued'] as AndroidSuccessTypes[]})
I'm using React Native v0.63.2, TypeScript v4.0.2, react-native-sms v1.11.0 When I want to call this method with
AndroidSuccessTypes
forsuccessTypes
, it gives runtime error:import SendSMS, { AndroidSuccessTypes } from 'react-native-sms';
[Sun Sep 20 2020 09:32:02.246] ERROR TypeError: Cannot read property 'sent' of undefined, js engine: hermes
And when I log the
AndroidSuccessTypes
, it is actually undefined:console.log(AndroidSuccessTypes);
Output:[Sun Sep 20 2020 09:45:56.101] LOG undefined