trying to create a demomy code below
local myRectangle = display.newRect( display.contentCenterX, display.contentCenterY, display.actualContentWidth, display.actualContentHeight )
local twitter = require (āplugin.twitterā)
twitter.init(āgWxZVU4RW56ss2VIGnoiem0M2ā, āfPd7s0raTVmE4YxqvLzR6wT4ZEyPuPuefgEuWGguwzgf8dhL4fā)
local myText = display.newText( āTwitter Test Appā, display.contentCenterX, 5, native.systemFontBold, 12 )
myText:setFillColor( 1, 0, 0.5 )
local widget = require( āwidgetā )
āLog In
local function onSuccess()
Ā Ā print(āaaā)
print(āTwitter user " ā¦ twitter.user.screenName ā¦ " successfully logged in!ā)
myText:removeSelf( )
myText = nil
myText = display.newText( āTwitter user " ā¦ twitter.user.screenName ā¦ " successfully logged in!ā , display.contentCenterX, 5, native.systemFontBold, 12 )
myText:setFillColor( 1, 0, 0.5 )
end
local function onFail()
print(āTwitter login attempt failed or was cancelled by user.ā)
myText:removeSelf( )
myText = nil
myText = display.newText( āTwitter login attempt failed or was cancelled by user.ā , display.contentCenterX, 5, native.systemFontBold, 12 )
myText:setFillColor( 1, 0, 0.5 )
end
local function logInEvent( event )
Ā Ā if ( āendedā == event.phase ) then
Ā Ā Ā Ā print( āButton was pressedā )
Ā Ā Ā Ā twitter.login(onSuccess, onFail)
Ā Ā end
end
local button1 = widget.newButton(
Ā Ā {
Ā Ā Ā Ā left = 100,
Ā Ā Ā Ā top = 100,
Ā Ā Ā Ā id = ābutton1ā,
Ā Ā Ā Ā label = āTwitter loginā,
Ā Ā Ā Ā onEvent = logInEvent
Ā Ā }
)
ends up with
ERROR: Runtime error
?:0: attempt to concatenate field āscreenNameā (a nil value)
stack traceback:
[C]: ?
?: in function ā?ā
?: in function <?:164>