i
This document refers to an older version. GeneXus 16 is our latest version.

HowTo: Using Twitter API for Smart Devices

Official Content
This documentation is valid for:

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.

   
 



Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.