Skip to content

unable to send direct message #22

Description

@marymhart

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));
        });```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions