I Can't use appwarp and app42 Cloud

0 votes

Hi, I am trying to use both AppWarp and App42 Cloud API on my game. However, once I use require("AppWarp.WarpClient"), I can no longer use storage service. Here is a very simple example I am working with.


local composer = require("composer")
local scene = composer.newScene()
appWarpClient = require("AppWarp.WarpClient")
 
 
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 jsonapi = require("json")
local loadsave = require("loadsave")
 
local App42CallBack = {}
local dbName  = "Players"  
local collectionName = "Yugi"  
local json = "{\"name\":\"Nick\",\"age\":30,\"phone\":\"xxx-xxx-xxx\"}"  
 
App42API:initialize(API_KEY_42,SECRET_KEY_42)  
local storageService = App42API:buildStorageService()  
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  
 
appWarpClient.initialize(API_KEY_42,SECRET_KEY_42)

Nothing difficult. Just trying to get to use both in one file. I am getting the following error however.


C:\Users\Brett\Desktop\Apps\Yu-gi-Oh\AppWarp\WarpUtilities.lua:225: attempt to concatenate local 'user' (a nil value)
 stack traceback:
[C]: in function 'error'
?: in function 'gotoScene'
C:\Users\Brett\Desktop\Apps\Yu-gi-Oh\menu.lua:25: in function '_onEvent'
?: in function '?'
?: in function <?:449>
?: in function <?:205>
 

I have tried using separate API and Secret Keys by making them separate apps, and I have also tried using them in separate scenes. Once the appwarp scene runs, the app42 scene returns the same error.

I have traced down where the issue is occuring, if I remove storageService, the scene loads, but I need storageService, obviously.

When each file is not connected in any way whatsoever, they work perfectly. It seems like Appwarp and App42 Cloud isn't able to be used together, although I read that it can be.
 
What am I doing wrong? Could you sow a working example of them integrated?
 
Thanks.

 

asked Mar 27, 2016 in Corona by brettcomardelle93 (10 points)

2 Answers

0 votes
Hi Brett,

Thanks for sharing the stack trace.You are getting error in AppWarp API.

Will you please share which AppWarp API you are using in which you are getting such kind of error. You can share the API flow as well that will help us to trace the exact problem.

Let me know the details.

 

Thanks

Vishnu Garg
answered Mar 28, 2016 by Vishnu Garg (674 points)
0 votes
In the file "App42-Lua-API/Util.lua" change the function "calculateSignature" to "calculateSignature2" at line 144 where it is declared and at line 134 where it is called.

The issue is that both App42 and AppWarp declared these as global functions and they interfere with each other.

Vishnu, let the developers fix this problem as it inhibits developers from easily buliding realtime multiplayer games in conjunction with the cloud services in Corona SDK.
answered Apr 3, 2017 by joehinkle11 (10 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...