We're going to implement Twitter in our apps by accessing a web service through UI buttons.
In the
Chapter 9
folder, copy theTwitter Web Pop-Up
project folder to your desktop. All the configuration, libraries, and assets needed are already included. You can download the project files that accompany this book from the Packt Publishing website.Create a new
main.lua
file and save it to the project folder.Set the following variables at the beginning of the code:
display.setStatusBar( display.HiddenStatusBar ) local ui = require("ui") local openBtn local closeBtn local score = 100
Create a local function called
onOpenTouch()
with an event parameter. Add anif
statement so that the event receives a"release"
action:local onOpenTouch = function( event ) if event.phase == "release" then
Using the local variable called
message
, add in the following string statement and concatenatescore
:local message = "Posting to Twitter from Corona SDK and got a final...