Hi guys,
I am trying to setup fuse in my game, but I am having some problem.
First, I was able to do it via Corona Enterprise, I have an App Id/API Key for the game on the dashboard, but I am trying to use it now with Corona SDK (same app). When I call fuse.init(fuseListener) I get the following error:
provider: fuse
isError: true
response: SERVER_ERROR
type: interstitial
phase: init
I’m using Corona SDK Build: 2015.2647 (2015.6.1)
here is the sample code I’m using:
========================================================
[lua]
local fuseService = {}
local apiKey = “”
– Create your zones here
local zones = { “zone1”, “zone2”, “zone3” }
local fuse = require(“plugin.fuse”)
local function fuseListener(event)
print(event.provider)
print(event.isError)
print(event.response)
print(event.type)
print(event.phase)
end
fuse.init(fuseListener)
– hide the status bar:
display.setStatusBar( display.HiddenStatusBar )
local widget = require( “widget” )
if system.getInfo( “playformName” ) == “Android” then
widget.setTheme( “widget_theme_android” )
else
widget.setTheme( “widget_theme_ios7” )
end
widget.setTheme( “widget_theme_android” )
local buttonHeight = 40
local numberTable = {}
for i=1,100 do
table.insert( numberTable, i, i )
end
local zonePicker = widget.newPickerWheel
{
columns = { {labels = zones, startIndex = 1},
{labels = {“1”, “2”, “3”, “4”}, startIndex = 1},
{labels = numberTable, startIndex = 1} }
}
local function onShowButtonRelease(event)
if event.phase == “ended” then
fuse.show(“interstitial”, {zone = zonePicker:getValues()[1].value})
end
end
local showButton1 = widget.newButton
{
width = display.contentWidth/2,
height = buttonHeight,
fontSize = 12,
label = “Show”,
onRelease = onShowButtonRelease
}
showButton1.x = display.contentWidth/4
showButton1.y = display.contentHeight/2
local function onLoadButtonRelease(event)
if event.phase == “ended” then
–print(event.target.id)
end
end
local loadButton1 = widget.newButton
{
width = display.contentWidth/2,
height = buttonHeight,
fontSize = 12,
label = “Load”,
onRelease = onLoadButtonRelease
}
loadButton1.x = display.contentWidth/4
loadButton1.y = display.contentHeight/2 + showButton1.height
local function onCheckLoadButtonRelease(event)
if event.phase == “ended” then
fuse.checkLoaded(“interstitial”, {zone = zonePicker:getValues()[1].value})
end
end
local checkLoadButton1 = widget.newButton
{
width = display.contentWidth/2,
height = buttonHeight,
fontSize = 12,
label = “Check Loaded”,
onRelease = onCheckLoadButtonRelease
}
checkLoadButton1.x = display.contentWidth/4
checkLoadButton1.y = loadButton1.y + loadButton1.height
local function onRegisterLevelButtonRelease(event)
if event.phase == “ended” then
fuse.register(“level”, {level = tonumber( zonePicker:getValues()[3].value )})
end
end
local registerLevelButton = widget.newButton
{
width = display.contentWidth/2,
height = buttonHeight,
fontSize = 12,
id = “registerLevel”,
label = “Register Level”,
onRelease = onRegisterLevelButtonRelease
}
registerLevelButton.x = display.contentWidth/4
registerLevelButton.y = checkLoadButton1.y + checkLoadButton1.height
local function onRegisterCurrencyButtonRelease(event)
if event.phase == “ended” then
fuse.register(“currency”, {currency = tonumber( zonePicker:getValues()[2].value ), balance = tonumber( zonePicker:getValues()[3].value )})
end
end
local registerCurrencyButton = widget.newButton
{
width = display.contentWidth/2,
height = buttonHeight,
fontSize = 12,
id = “registerCurrency”,
label = “Register Currency”,
onRelease = onRegisterCurrencyButtonRelease
}
registerCurrencyButton.x = display.contentWidth/4
registerCurrencyButton.y = registerLevelButton.y + registerLevelButton.height
return fuseService
[/lua]
=====================================================================================
I have attached the fuse script in this e-mail. Could you please help me?
Thank you very much!