Google Play game service

How do I use the Google Play game service (and the other on iOS) on PlayCanvas?

Hello, @dxed_wesaXWDCWjc and welcome to PlayCanvas!

You can add external scripts, like Google Play SDK and others via the project settings, under External Scripts:

Once added, you can then use them normally in the scripts, like you would without PlayCanvas.

Thank you. But;
Is google play game services have for js ?

Hi @dxed_wesaXWDCWjc,

How do you plan to use google play game services? Are you planning to publish your PlayCanvas game to the Android Store?

1-I use it for saving user accounts and another data
2-Yes,android and ios

Then it’s best to handle all that from your parent wrapper app that will be hosting the webcanvas element to render PlayCanvas.

Isn’t that complicated? After coding the game, in cordova
Add code again without playcanvas editor

Well, I am not sure if there is a way to communicate from the Javascript side with the Google Play Services native runtime running on Android or iOS. That’s for security on the OS side.

PlayCanvas doesn’t offer something like that, but do make a google search in case there is a Javascript library that can help you with that. If there is one, you can definitely use it with PlayCanvas.

Thank you.I apologize for keeping your time busy

1 Like

If you are intending to publish the app stores, you will have to use a ‘bridge’ that runs in the wrapper so that the webview can communicate with the native SDK for those services.

2 Likes

But, How can I do this?

You will have to check with the Cordova community. Some examples of those plugins are https://www.npmjs.com/package/cordova-play-services-version-adapter

Thank you so much. I am grateful.