title: How do I publish a tweet with media from Angular 2?
body: <p>I am working on an IONIC project with angular. I want to publish tweet to a specific twitter account from the IONIC app. How can I do that?
  I tried to use <a href="https://github.com/Aoinu/ng2-twitter" rel="nofollow noreferrer">https://github.com/Aoinu/ng2-twitter</a> this NPM package, but no luck. For browser, it is giving  below error </p>
  
  <p><strong>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="https://api.twitter.com/1.1/statuses/update.json" rel="nofollow noreferrer">https://api.twitter.com/1.1/statuses/update.json</a>. (Reason: CORS header 'Access-Control-Allow-Origin' missing).</strong></p>
  
  <p>When I am trying from Ionic DevApp in iPhone 6, it is not giving any error but tweet is not posting.</p>
  
  <p>Thanks in advance for any help.</p>
  
  <p>I used below code which is calling after submit a from. </p>
  
  <pre><code>getHomeTimeline(){
          this.twitter.post(
              'https://api.twitter.com/1.1/statuses/update.json',
              {
                  status: 'test Tweet'
              },
              {
                  consumerKey: 'consumerKey',
                  consumerSecret: 'consumerSecret'
              },
              {
                  token: 'My twitter token',
                  tokenSecret: 'Token Secret'
              }
          ).subscribe((res)=&gt;{
              //this.result = res.json().map(tweet =&gt; tweet.text);
              console.log(res);
              console.log('working');
          });
      }
  </code></pre>