Game does not connect, WarpClient.GetInstance () returns null.

0 votes
I've recently started looking at the AppWarp SDK to build a synchronous game. However when I run my game, the "Game does not connect, " return a value only on the first Update(). Then it keeps returning null on every subsequent update() run. Basically the game does not connect. I used my API key and secret in the sample code. And it works perfectly there. My code is exactly the same as the sample, but doesn't work. Please help me understand if I'm missing something.
asked Jul 11, 2017 in Unity by mariam.d (10 points)

2 Answers

0 votes

Hello Mariam,

Are you calling following method in your update method:

WarpClient.GetInstance().Update();

Please check out this link for more info. If this is not the case , could you please share following information:
1. On which platform you are testing?
2. Version of the SDK you are using
3. Is it also not working when you are testing on unity editor?
4. Can you share your sample files where you have integated AppWarp?
 
It will help us to debug the problem in better way.
 
Thanks.
answered Jul 11, 2017 by rajeev.etc (1,660 points)
0 votes
Thanks Rajeev.
 
I realized that the issue occured because I was switching scenes instantly. Hence, I always got a null value.
 
To describe the issue in detail, in the first scene of my game, I load a game object for which I use DontDestroyOnLoad (gameObject); because I want the game object to persist through all the scenes.
 
It is on this game object that I have added the appwarp class as a component. 
The listener class is not a monobehaviour hence I create it as an object using -
Listener listener = new Listener();
 
This first scene also instantly loads the next scene.
 
Now my assumption was that since a persistant game object has the appwarp component attached to it, the listener which is an object of the appwarp component will also persist throughout the scene changes. However that's not the case and the listener does not execute.
Any clue why this does not happen?
 
I'm currently just running the game in unity editor and not building it for any platform.
The appwarp version is 1.10.1. Unity version is 5.6.
 
Mariam
answered Jul 11, 2017 by mariam.d (10 points)
Hi Mariam,

We have a sample built for scene transition. You can have a look at it here( https://github.com/RajeevRShephertz/AppWarpUnity2ScenesDemo ). It shows the AppWarp integration handling in multiple scenes.
Let me know if you have any query, I will be happy to help you.
Thanks.
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
...