Sign In Register

How can we help you today?

Start a new topic

Black screen with "Gamespark Preview Mode" text

Hello;

I have been developing a game and decided to use GameSpark services.

Firstly I am using LibGDX framework with Java language for my game and used your android tutorial for connecting to server.


   

public class AndroidLauncher extends AndroidApplication {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();

GSAndroidPlatform.initialise(this, "Api_Key", "Api_Secret", "Credential_Secret", false, true);
initialize(new GameInstance(GSAndroidPlatform.gs()),config);

        initialize(new MyGame(GSAndroidPlatform.gs()), config);
        
    }
...
} 

   

I added the code at the upper side to my AndroidLauncher and send an instance of GS class to my game's main class. After that I tried to connect with an example user;


  

    public MyGame(GS gs) {        
            gs.getRequestBuilder().createAuthenticationRequest()
                .setPassword("pass")
                .setUserName("username")
                .send(new GSEventConsumer<AuthenticationResponse>() {
                    @Override
                    public void onEvent(AuthenticationResponse response) {
                        if (!response.hasErrors()) {
                            String authToken = response.getAuthToken();
                            String displayName = response.getDisplayName();
                            Boolean newPlayer = response.getNewPlayer();
                            GSData scriptData = response.getScriptData();
                            Player switchSummary = response.getSwitchSummary();
                            String userId = response.getUserId();
                            toast = toastFactory.create("Connection Succesful", Toast.Length.LONG);
                        }
                    }
                });
...
}


I have also added internet connection permissions to Android Manifest

 

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

 But after all that I faced black screen wtih "GameSpark Preview Mode" watermark. 

image


At the same time the error ,which at the below, was writing at console


I/System.out: GSConnection. gs.currentUrl: wss://gsp-aas000-se07.gamesparks.net/ws/....

W/System.err: com.neovisionaries.ws.client.OpeningHandshakeException: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 403 INVALID CREDENTIAL TYPE

W/System.err: at com.neovisionaries.ws.client.HandshakeReader.validateStatusLine(HandshakeReader.java:232)

W/System.err: at com.neovisionaries.ws.client.HandshakeReader.readHandshake(HandshakeReader.java:54)

W/System.err: at com.neovisionaries.ws.client.WebSocket.readHandshake(WebSocket.java:3244)

W/System.err: at com.neovisionaries.ws.client.WebSocket.shakeHands(WebSocket.java:3123)

W/System.err: at com.neovisionaries.ws.client.WebSocket.connect(WebSocket.java:2155)

W/System.err: at com.gamesparks.sdk.GSConnection.<init>(GSConnection.java:46)

W/System.err: at com.gamesparks.sdk.GS.NewConnection(GS.java:209)

W/System.err: at com.gamesparks.sdk.GS.ConnectIfRequired(GS.java:197)

W/System.err: at com.gamesparks.sdk.GS.processQueues(GS.java:175)

W/System.err: at com.gamesparks.sdk.GS$GSWorker.run(GS.java:562)

W/System.err: at java.lang.Thread.run(Thread.java:764)


I have googled but cannot find anything useful. Please help me


1 Comment

Hey
I could not find any solution yet. Please help

Login to post a comment