Hi,
SP / Rob, have attached our code once again which is working perfectly on IOS 6 and Android devices.
ui = require(“ui”)
local facebook = require “facebook”
require(“Json”)
local widget = require( “widget” )
local myText
local myText1
local appId = “272502539588566”;
local URL;
local userid;
local scrollViewGlobal = nil
local screenGroupp = display.newGroup()
local friendsGroup = display.newGroup()
function onClick( event )
myText.text = event.phase
if(event.phase == “release”) then
facebook.login( appId, listener, {“publish_stream”} )
end
end
function networkListener( event )
if ( event.isError ) then
myText2.text = “networkListener not called”
else
myText2.text = “networkListener called”
local info = event.response
local response = Json.Decode(event.response)
table.foreach(response,print)
print(#response)
myText.text = response.id
userid = response.id
end
end
function listener( event )
myText.text = event.token
if ( “session” == event.type ) then
if ( “login” == event.phase ) then
myText2.text = event.phase
myText.text = “Token” …event.token
facebook.request(“me”)
myButton.isVisible = false
print(“listeners”)
myText2.text = “listener called”
CorrectScore = 10
_G.CorrectToken = event.token
local URL = "http://tampropack.com/api/createuser.php?token="…_G.CorrectToken…"&score="…CorrectScore
local requestId = network.request( URL,“POST”, networkListener )
end
elseif ( “request” == event.type ) then
local response = Json.Decode( event.response )
local data = response.data
local function showImage( event )
event.target.alpha = 0
event.target.xScale = 0.25
event.target.yScale = 0.25
transition.to( event.target, { alpha = 1.0 , xScale = 1, yScale = 1} )
end
for i=1,#data do
display.loadRemoteImage(“http://graph.facebook.com/”… data[i].id …"/picture",
“GET”,
showImage,
“friend”…i…".png",
system.TemporaryDirectory,
math.random(0,display.contentWidth),
math.random(0,display.contentHeight) )
end
end
end
myButton = ui.newButton {
defaultSrc = “fb.png” , defaultX = “300” , defaultY = “50”,
onEvent = onClick,
id = “myButton”
}
myButton.x = display.contentWidth / 2
myButton.y = display.contentHeight / 2
myText = display.newText( “Hello World!”, 100, 200, native.systemFont, 16 )
myText2 = display.newText( “Hello World!”, 100, 300, native.systemFont, 16 )
The line where we have local response = Json.Decode(event.response) in the function networkListener is returning nil is where we are having issues on IOS7, its working well on IOS 6 and ANdroid devices.
Hope you are able to replicate the issue with the code and help us find a way out.
The Corona Build used is 1262.
Sunil