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

unable to send direct message #22

Open
marymhart opened this issue Mar 26, 2019 · 0 comments
Open

unable to send direct message #22

marymhart opened this issue Mar 26, 2019 · 0 comments

Comments

@marymhart
Copy link

Hello, I am unable to send a direct message. I have the direct message permission enabled in the developer console & the recipient has direct messages enabled from any user. The error I receive is not much help so any insight would be appreciated. Thank you!
I am using:
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-twitter": "^0.2.1",

error:
err Error at request.js:60 at tryCatch (es6-promise.js:409) at invokeCallback (es6-promise.js:424) at es6-promise.js:176 at MessagePort.flush (es6-promise.js:128)

code:

  const data = {
       "event": {
      "type": "message_create",
      "message_create": {
        "target": {
          "recipient_id": TWITTER_USER_ID_STR
        },
        "message_data": {
          "text": "Hi",
        }
      }
    }
  };

const parsedTokens = (JSON.parse(tokens));
        const { rest } = twitter(parsedTokens);
        rest.post('direct_messages/events/new', data ).then((resp) => {
          console.log('resp', resp);
          dispatch(updateProfileLoading(false));
        }).catch((err) => {
          console.log('err', err);
          dispatch(updateProfileLoading(false));
        });```
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

1 participant