- Home /
How to implement Amazon Gamecircle
I downloaded the gamecircle api of amazon from asset store and I am following this tutorial from amazon https://developer.amazon.com/appsandservices/apis/engage/gamecircle/docs/unity-setup
I am stuck at section 1 step 3. The codes are in c# ( I use JS) and I really can't understand what to do next. Any help is appreciated. Thanks...
Answer by psycocrusher · Nov 18, 2014 at 07:00 PM
I used this for and older version of the plugin but it should be almost the same.
private var usesLeaderboards : boolean = true;
private var usesAchievements : boolean = true;
private var usesWhispersync : boolean = false;
function Start () {
AGSClient.Init (usesLeaderboards, usesAchievements, usesWhispersync);
//Will return true if service is ready
var isServiceReady : boolean = AGSClient.IsServiceReady();
//To show Leaderboards use this:
AGSLeaderboardsClient.ShowLeaderboardsOverlay();
//To show achievements:
AGSAchievementsClient.ShowAchievementsOverlay();
//To submit scores, replace with your variables:
AGSLeaderboardsClient.SubmitScore("YourLeaderboard",YourVariableToSubmit);
//To unlock achievements:
AGSAchievementsClient.UpdateAchievementProgress("YourAchievement",100);
}
function OnEnabled(){
AGSClient.ServiceReadyEvent += serviceReadyHandler;
AGSClient.ServiceNotReadyEvent += serviceNotReadyHandler;
}
function OnDisabled(){
AGSClient.ServiceReadyEvent -= serviceReadyHandler;
AGSClient.ServiceNotReadyEvent -= serviceNotReadyHandler;
}
function serviceNotReadyHandler (error : String){
Debug.Log("Service is not ready");
}
function serviceReadyHandler (){
Debug.Log("Service is ready");
}
$$anonymous$$any thanks Sir for this code. I still don't understand Section 2 step 2 from the above link. Do you have the code to implement that?
@Srimasis, that's not code, that's the manifest file. It's X$$anonymous$$L and specific to YOUR game hosted on amazon.
@Landern Thanks but how to add the package name is step 2
@Srimasis, using your keyboard, type in what you see(or whats missing from the activity) in your manifest, the package name is generally something like "com.somecompany.sub.sub.gamename", you're choice, probably has to be unique.
@Srimasis, it is typically created during the build temporarly. however, you can add a "Android$$anonymous$$anifest.xml" to Assets->Plugins->Android folder and it will be included, what you put in there will be merged when you build the apk.
During the build, i think it's in Temp\StagingArea, the manifest being used by default, you may be able to use that as a starting manifest.
Answer by VicCorvalan · Feb 11, 2015 at 01:52 PM
Hello, I wrote a tutorial of how to implement GameCircle in Unity3d using Social API... I think is more easier that way... you can take a look in my post
Sorry, tumblr changed the URL of my blog... this is the http://bewarefish-blog.tumblr.com/post/110631442536/integrating-amazon-gamecircle-with-unity3d-v46
But some people reported that is not working anymore... the problem that I face was that in my device sometimes I wasn't able to log in... I have to restart my device and open my app again to make it work...
This line of code did the trick for me! I couldn't find it anywhere else but in that post. Thanks!
Social.Active = GameCircleSocial.Instance;
It seems to be fine in Unity 5.6.1f1, using the latest Unity's Social API and Amazon's GameCircle SD$$anonymous$$.
Your answer
![](https://koobas.hobune.stream/wayback/20220613171813im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I prompt for login in the Social API? (GameCircle) 0 Answers
How can I use Taget API Level 28 in Unity 5.6.x? 0 Answers
Convert C# to JS 0 Answers