Does Corona SDK support Amazon GameCircle?

Any news on the Amazon GameCircle plugin for Corona?  My game is languishing in the doldrums of Amazon’s sub-basement without it…

Stephen Lewis - Same issue with us. We have programmed our game for the Fire TV which can be played using remote and controller… Just waiting for the Amazon GameCircle to incorporate. Could anyone implement it before? any information about it will be helpful for us to complete it…

prmobiapp - you should be able to do this since your forum label says you are an enterprise customer.  you may want to talk to w.j. francis - earlier in this thread he mentioned doing it in enterprise.  just not available as a standard corona plugin at the moment

Jflowers45 @ Thanks for your quick response. I will try reaching to w.j. francis to get some help with it.

w.j. francis @ Could you please guide us how to implementing the Amazon GameCircle in our game? Thanks!

@prmobiapp

You can download the source code I wrote here.  It includes a readme and a sample app.  You’ll still have to set up your own Amazon GC account and copy the apikey file they generate into your project’s asset directory.

http://www.thingerjiggy.com/downloads/AGC.zip

@ w.j.francis - Thanks for the information. We will try it out and let you know for any further help!

w.j.francis - We tried amazon AGC.zip file and we have successfully built apk file and installed.Then open the installed apk file  when click the Initialize Amazon GC text it showed error alert box like ERROR:CANNOT_INITIALIZE.So Please help us ,how to solve this issue.

@prmbiapp

Do you still have the demo app pointing at my test Amazon game center / credentials?  You will have to create your own, and modify the code to use the IDs created for your leaderboards and achievements.  If you load the code to an actual device you can use ADB and logcat to get a specific failure message from the Amazon GC SDK.

Game center isn’t required to submit apps/games to Amazon, just for the promotion they are running.

w.j.francis - I am trying to integrate GameCircle with my apps. now i created a new profile for apps and followed the instructions for that profile, but I half-suspect that profiles may be causing the errors. I did grab the latest SDK and I’m testing against the Android emulator.

The error is related to the API key. I’ve double-checked the MD5 I used and it seems correct. Could it be something with my emulator?

08-21 20:23:05.512: I/com.amazon.identity.auth.device.appid.AbstractAppIdentifier(17662): getAppInfo : packageName=com.crazy.crazyrocket

08-21 20:23:05.512: I/com.amazon.identity.auth.device.appid.AbstractAppIdentifier(17662): Finding API Key for com.crazy.crazyrocket

08-21 20:23:05.513: I/com.amazon.identity.auth.device.utils.ThirdPartyResourceParser(17662): Attempting to parse API Key from assets directory

08-21 20:23:05.516: I/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): Begin decoding API Key for packageName=com.crazy.crazyrocket

08-21 20:23:05.531: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(17662): APIKey:<obscured>

08-21 20:23:05.532: I/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662):  num sigs = 1

08-21 20:23:05.533: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(17662): Signature checking.:<obscured>

08-21 20:23:05.533: D/OpenSSLLib(17662): OpensslErr:Module:13(114:155); file:external/openssl/crypto/asn1/asn1_lib.c ;Line:142;Function:ASN1_get_object

08-21 20:23:05.534: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(17662): Fingerpirint checking:<obscured>

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): Failed to decode: Decoding fails: certificate fingerprint can’t be verified!

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): java.lang.SecurityException: Decoding fails: certificate fingerprint can’t be verified!

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.amazon.identity.auth.device.appid.APIKeyDecoder.verifyPayload(APIKeyDecoder.java:332)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.amazon.identity.auth.device.appid.APIKeyDecoder.doDecode(APIKeyDecoder.java:127)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.amazon.identity.auth.device.appid.APIKeyDecoder.decode(APIKeyDecoder.java:91)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.amazon.identity.auth.device.appid.AbstractAppIdentifier.getAppInfo(AbstractAppIdentifier.java:85)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager.<init>(AmazonAuthorizationManager.java:123)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.amazon.ags.api.AmazonGamesClient.initialize(AmazonGamesClient.java:144)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.crazy.crazyrocket.MainActivity.onResume(MainActivity.java:30)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1197)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.app.Activity.performResume(Activity.java:5343)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2993)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.os.Handler.dispatchMessage(Handler.java:110)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.os.Looper.loop(Looper.java:193)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at android.app.ActivityThread.main(ActivityThread.java:5292)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at java.lang.reflect.Method.invokeNative(Native Method)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at java.lang.reflect.Method.invoke(Method.java:515)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)

08-21 20:23:05.535: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(17662): at dalvik.system.NativeStart.main(Native Method)

08-21 20:23:05.537: E/GameCircleClient(17662): Unable to read api key.  GameCircle requires an api key to be included in ‘assets/api_key.txt’.  GameCircle will not initialize.

08-21 20:23:05.537: E/GameCircleClient(17662): java.lang.IllegalArgumentException: Invalid API Key

08-21 20:23:05.537: E/GameCircleClient(17662): at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager.<init>(AmazonAuthorizationManager.java:126)

08-21 20:23:05.537: E/GameCircleClient(17662): at com.amazon.ags.api.AmazonGamesClient.initialize(AmazonGamesClient.java:144)

08-21 20:23:05.537: E/GameCircleClient(17662): at com.crazy.crazyrocket.MainActivity.onResume(MainActivity.java:30)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1197)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.app.Activity.performResume(Activity.java:5343)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2993)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.os.Handler.dispatchMessage(Handler.java:110)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.os.Looper.loop(Looper.java:193)

08-21 20:23:05.537: E/GameCircleClient(17662): at android.app.ActivityThread.main(ActivityThread.java:5292)

08-21 20:23:05.537: E/GameCircleClient(17662): at java.lang.reflect.Method.invokeNative(Native Method)

08-21 20:23:05.537: E/GameCircleClient(17662): at java.lang.reflect.Method.invoke(Method.java:515)

08-21 20:23:05.537: E/GameCircleClient(17662): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)

08-21 20:23:05.537: E/GameCircleClient(17662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)

08-21 20:23:05.537: E/GameCircleClient(17662): at dalvik.system.NativeStart.main(Native Method)

08-21 20:23:05.537: D/ActivityThread(17662): ACT-AM_ON_RESUME_CALLED ActivityRecord{425abe20 token=android.os.BinderProxy@425ab5f8 {com.crazy.crazyrocket/com.crazy.crazyrocket.MainActivity}}

08-21 20:23:05.538: V/PhoneWindow(17662): DecorView setVisiblity: visibility = 0 ,Parent =ViewRoot{42643a58 com.crazy.crazyrocket/com.crazy.crazyrocket.MainActivity,ident = 0}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{425b41a0 V.E… R…I. 0,0-480,800}

08-21 20:23:05.539: D/ActivityThread(17662): ACT-RESUME_ACTIVITY handled : 1 / android.os.BinderProxy@425ab5f8

08-21 20:23:05.540: V/InputMethodManager(17662): onWindowFocus: null softInputMode=288 first=false flags=#1810100

08-21 20:23:05.540: V/InputMethodManager(17662): START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView{425b41a0 V.E… R…I. 0,0-480,800} ic=null tba=android.view.inputmethod.EditorInfo@426c8720 controlFlags=#100

08-21 20:23:05.986: D/OpenGLRenderer(17662): prepareDirty (0.00, 0.00, 480.00, 800.00) opaque 1 <0x60a23008>

08-21 20:23:05.986: D/OpenGLRenderer(17662): finish <0x60a23008>

@prmobiapp

From your logs it looks like your app is not finding the api key at runtime.  Amazon GC SDK requires this be in a resource file (boo).

08-21 20:23:05.537: E/GameCircleClient(17662): Unable to read api key.  GameCircle requires an api key to be included in ‘assets/api_key.txt’.  GameCircle will not initialize.

I guess this could be an emulator problem but I doubt it.  Use the DDMS file browser in ADT to connect to your emulator and browse the /assets directory for the api_key.txt file.  For a Corona SDK app, you can include this file just by dropping it in the same directory as your main.lua file before building.  The Amazon GC console generates the file for you. Check out the sample in my ZIP file if you are unsure of the directory structure.

w.j.francis -  I included in correct directory file for the api_key.txt(assets/api key.txt) and more times checked , but not get proper output. So any other solution is there please reply as soon as possible.

w.j.francis - In-App Purchasing is not working, i followed with the response link: http://docs.coronalabs.com/plugin/amazon.iap/index.html. I found the plugins-3rd-party  folder in corona Enterprise, but not there is inside these two plugins (in-app-purchasing-1.0.3.jar,

plugin.amazon.iap.jar).So how can i get please reply.

@prmobiapp

I can’t say for sure why the GC SDK doesn’t find your api_key.txt file, only that according to their logs it is not.  I highly recommend using the DDMS tool and looking at the actual file system on the deployed device / emulator, as things don’t always end up where you think they will.  Just for example, if you look at my api_key.txt file, included in the zip file I sent you, you will see that it is in the base Corona folder along side the icons and main.lua.  These files when deployed to the device get put in the /assets folder.  So if you specified /assets/api_key.txt locally, when deployed the key would end up in /assets/assets/api_key.txt and thus not be found by Amazon’s SDK which only looks in one place for the file.

With regards to your second question I didn’t write the IAP plugin nor have I used it so I am afraid I can’t be much help.

w.j.francis - i also checked your api_key.txt file and i changed my package com.crazy.crazyrocket  to your package com.mycompany.app and i added your api_key.txt to assets folder like you said but it’s seem same error. and one more thing i changed your package com.mycompany.app to my package com.crazy.crazyrocket and added your api_key.txt but now this time i got error package mismatch  at runtime on LogCat.

Note: package mismatch means my package com.crazy.crazyrocket and your api_key.txt prased or decoded package com.mycompany.app at runtime on LogCat.

so when i used my package and another person api_key.txt it say package mismatch but when i used my package and my api_key.txt it say errors.

Please help me to solve this problems.

@prmobiapp

In that case I’d recommend breaking apart your APK and examining the contents of the assets folder inside the APK itself.  You can do this just by renaming the .APK file to .ZIP (in case you weren’t aware).  Items in the assets folder should not get tampered with so you should see your API key in tact.  Maybe seeing the directory structure this way will lend some hint as to what is going on.

David - any news on whether Amazon delivered their end of the deal yet?

Unfortunately no update. However, we did some changes on our side very recently that may also fix the issue (without requiring a change to the GC SDK) and we are trying to get them to test with it. Hopefully will know more soon.

Hey everyone - 2 developers have now successfully implemented GameCircle with the plugin. We are still waiting for the person who made the plugin to clean up a few things in the documentation. But it is definitely working well.

So if anyone here wants early access, just shoot me a quick email: david AT coronalabs.com

Excellent!!  Very glad to hear - I’d love to get my hands on this ASAP, but I don’t have Enterprise, only Pro…  will have to wait until a daily build has it.  David - any idea how soon the plugin and docs will be integrated into the next daily build?   Thanks.

Nate