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

SmsAndroid undefined? #9

Closed
vincentaudebert opened this issue Jan 31, 2018 · 5 comments
Closed

SmsAndroid undefined? #9

vincentaudebert opened this issue Jan 31, 2018 · 5 comments

Comments

@vincentaudebert
Copy link

Sorry I'm quite new to React Native.

I yarn installed your package and when I try this code

componentDidMount() {
        Sms.autoSend(
            '+111111111',
            'Test message',
            fail => {
                console.log('Failed with this error: ' + fail);
            },
            success => {
                console.log('SMS sent successfully');
            }
        );
    }

I get this error:

00:08:32: TypeError: undefined is not an object (evaluating '_reactNativeGetSmsAndroid2.default.autoSend')

Any idea of what I'm doing wrong?

@vincentaudebert
Copy link
Author

Ah my bad... I'm using Expo... Could be the same error than this one: tkporter/react-native-sms#25

@vincentaudebert
Copy link
Author

Might be worth mentioning in the README that this package won't work if used with Expo?

@briankabiro
Copy link
Owner

Yeah, I think that's valid. But do you have any suspicions as to why it fails with Expo?

@vincentaudebert
Copy link
Author

@briankabiro I think it's Expo not supporting SMS access. I had found a github issue about it but I can't find it back.

@briankabiro
Copy link
Owner

I've updated the README accordingly.

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

No branches or pull requests

2 participants