I am quite experiences with lua and corona but i completly failed with corona cloud. Guys there is even no sample app inside samples…
To the point, my errors are:
-
Corona Cloud: login response: Facebook ID and Access Token do not match.
-
User authentication token is not present in the request parameters
-
ERROR: Could not load provider (corona) due to the following reason: …rk-corona/ios/…/shared/coronaCloudConfiguration.lua:47: ERROR: one or more required files do not exist in the cloud_assets directory.
Cannot login into Cloud, cannot post score, cannot run dashboard. I just followed
https://github.com/coronalabs/gameNetwork_sample
http://docs.coronalabs.com/guide/cloud/setup/index.html
[lua]
local CC_Access_Key = “123”
local CC_Secret_Key = “123”
local authListener = function( event )
if event.type == “getProfile” then
print( "The user profile: ", event.response )
elseif event.type == “facebookLoggedIn” then
cloud.getProfile()
print( "The user loged using FB: ", event.response )
end
end
local leaderboardsListener = function( event )
if ( event.type == “ScoresSubmitted” ) then
print( “Success”, “Your score was successfully submitted online.”)
end
end
function Bladko.runMeNow()
FB.logMeNow() – this is taken from facebook.login( FB.appId, listener, {“publish_stream” } )
cloud.debugEnabled = true
cloud.init( CC_Access_Key, CC_Secret_Key, authListener )
– set listeners
cloud.leaderboards.setListener( leaderboardsListener )
local function logMeNow()
local loginParams = {}
loginParams.type = “facebook”
loginParams.facebookId = “123123”
loginParams.accessToken = FB.token – this is taken from facebook.login( FB.appId, listener, {“publish_stream” } )
– login to the cloud
cloud.login( loginParams )
end
– wait for FB login
timer.performWithDelay(3000, logMeNow)
end
function Bladko.runMeNow2()
– submit analytics event
local aParams = {}
aParams.event_type = “Session”
aParams.message = “The user logged In”
aParams.name = “logIn”
– send the event
cloud.analytics.submitEvent( aParams )
end
function Bladko.runMeNow3()
local leaderboardID = “1234” --leaderboard ID
cloud.leaderboards.submitHighScore( leaderboardID, 1900 )
end
function Bladko.runMeNow4()
local params = { accessKey = CC_Access_Key, secretKey = CC_Secret_Key, }
gameNetwork.init( “corona”, params )
gameNetwork.show( “dashboard” )
end
function Bladko.runMeNow5()
local leaderboardID = “1234” --leaderboard ID
cloud.leaderboards.getScores( leaderboardID )
end[/lua]
Tom