Search the Community
Showing results for tags 'sign in'.
-
Hello guys, So, I'm trying to implement the Google Play Services inside my game for the players challenge their friends with leaderboards scores and achievements. As I'm using Cordova, I have two ways: plugins or javascript libs. The first one is really old and limited, besides it not work well. And in the other hand we have the JS library of Google Web (REST) that you can find here https://developers.google.com/api-client-library/javascript/start/start-js and here https://developers.google.com/games/services/web/clientsetup. So, I'd tested both and the second is more interesting and complete than the first one. However, I can't load the OAuth2 to start using the REST calls and complete my game logic. Reading about this, I discovered that the webview don't save cookies, and when I have not set the parameter cookie_policy to "none" I get this error: And, when I set cookie_policy to "none", I have this error: I already have setup the lib in index.html <!-- google play games service api --> <script src="https://apis.google.com/js/client.js"></script> And in my MainMenu state, I'm doing the SignIn tests using this code: // google play sign in if (gapi) { console.log('GAPI is loaded'); gapi.client.setApiKey('<api_key>'); gapi.load('client:auth2', function () { gapi.auth2.init({ client_id: '<client_id>', cookie_policy: 'none', scope: 'https://www.googleapis.com/auth/games' }).then(function () { console.log('auth2 success'); }); }); } else { console.error('GAPI is not loaded'); } I would like to know if anyone knows about how to implement GPGS using Cordova?! I'd like to understand what I'm doing wrong! Any help will be great! Thank you!
- 4 replies
-
- google play
- sign in
-
(and 3 more)
Tagged with: