i
This is not the latest version of this document; to access the latest version, click here.
Official Content

The Twitter API enables you to send tweets from your application.

This article focuses on what this API does and gives an example of how to use it.

Step 1: External Object

The API has one external object as the image shows.

TwitterAPI_EO

The External Object has only one method, "Tweet", where the tweet text and an optional image is sent.

Step 2: Code Sample

Create the following Panel for Smart Devices.

Layout:

TwitterAPI_Layout

Variables:

&img -> Image data type

Events:

Event 'Tweet'
     TwitterAPI.Tweet('Tweet desde app GX', &img)
Endevent

Step 3: Execution

Let's see how to send a tweet including an image.

First, select an image for the &img variable

TwitterAPI_Image1 TwitterAPI_Image2 TwitterAPI_Image3

Finally, just execute the method Tweet. This will open a Twitter application dialog with the text and image selected, and a button Send available to finish the tweet publication. Note: the message can be modified in this dialog before send it.

TwitterAPI_Image4

Availability

Implemented for iOS and Android in GeneXus X  Evolution 2 Upgrade 3 and later.

   
 



Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant