After perform insertJSONDocument I wait 2min and perform insertJSONDocument again then I get "Please check your network connection" message.
I get this error message only in the device (it works in the simulator)
SDK: Corona SDK
Plataform: Samsung S3
Code Example:
require("App42-Lua-API.Operator")
require("App42-Lua-API.Permission")
require("App42-Lua-API.GeoOperator")
require("App42-Lua-API.OrderByType")
require("App42-Lua-API.Operator")
local JSON = require("App42-Lua-API.JSON")
local queryBuilder = require("App42-Lua-API.QueryBuilder")
local App42API = require("App42-Lua-API.App42API")
local ACL = require("App42-Lua-API.ACL")
local function insertDoc( event )
local dbName = "places"
local collectionName = "myplaces"
local json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}"
local App42CallBack = {}
App42API:initialize("xxx","xxx")
local storageService = App42API:buildStorageService()
print("insert")
storageService:insertJSONDocument(dbName, collectionName, json,App42CallBack)
function App42CallBack:onSuccess(object)
print("dbName is "..object:getDbName())
print("collectionName is "..object:getCollectionName())
print("DocId is "..object:getJsonDocList():getDocId())
print("Created At is "..object:getJsonDocList():getCreatedAt())
print("Updated At is "..object:getJsonDocList():getUpdatedAt())
end
function App42CallBack:onException(exception)
print("Message is : "..exception:getMessage())
print("App Error code is : "..exception:getAppErrorCode())
print("Http Error code is "..exception:getHttpErrorCode())
print("Detail is : "..exception:getDetails())
end
end
insertDoc()
timer.performWithDelay( 120000, insertDoc )
Console:
V/Corona (28780): > Class.forName: network.LuaLoader
V/Corona (28780): < Class.forName: network.LuaLoader
V/Corona (28780): Loading via reflection: network.LuaLoader
I/Corona (28780): Platform: GT-I9300 / ARM Neon / 4.3 / Mali-400 MP / OpenGL ES 2.0 / 2015.2646
V/Corona (28780): > Class.forName: plugin.fuse.LuaLoader
V/Corona (28780): > Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (28780): < Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (28780): Loading via reflection: CoronaProvider.licensing.google.LuaLoader
I/Corona (28780): insert
I/Corona (28780): dbName is places
I/Corona (28780): collectionName is myplaces
I/Corona (28780): DocId is 55dd93b7e4b0749cc5d69511
I/Corona (28780): Created At is 2015-08-26T10:23:51.951Z
I/Corona (28780): Updated At is 2015-08-26T10:23:51.951Z
I/Corona (28780): insert
E/Corona (28780): ERROR: null
I/Corona (28780): Message is : Please check your network connection
I/Corona (28780): App Error code is : null
I/Corona (28780): Http Error code is null
I/Corona (28780): Detail is : null
Thank you.
Best Regards.