Google Play Game Service - Cannot unlock Achievements - android

I have implemented Google Play Game Service into my game by referring to the quick start given by Google.
I have added the achievement ids in my 'id.xml' file. My game has around 10 achievements. The code to unlock my achievements is as follows:
Games.Achievements.unlock(getApiClient(), "achievement_1_0");
where 'achievement_1_0' is the string name of one of my achievements.
My issue is that non of my achievements are getting unlocked, even when the conditions are correct. After viewing my log, I got this E/AchievementAgent(13528): Couldn't find local achievement to update for achievement ID achievement_1_0 from the session filter com.google.android.gms(Session Filter)
Any thoughts on what might have gone wrong? or is it a bug ..???

The code for unlocking an achievement is as follows:
Games.Achievements.unlock(getApiClient(), "your_achievement_id");
Here the achievement id is the id you get while creating achievement in Google Game Services.
That is in Google developer Console->Game Services->Your Application->Achievement
Hope this will help you..

#Anu is 100% correct. You are indeed using an incorrect ID for your achievements. However, using the codes from the Game services console is a very bad way to refer to your achievements (and it is very error prone).
The better way to refer to an achievement is to export your achievement IDs by using the Get resources link at the bottom of the Achievements screen in the Game services console. These are then placed inside a xml file in your apps resources. It seems like this is what you are referring to in your question (the id.xml file), so you may have already completed this step.
Once the xml file is in place you can then refer to your achievements using the descriptive IDs that were exported from the console. Do that as follows:
activity.getBaseContext().getString( R.string.achievement_1_0 );
Use your main Activity for activity and change the achievement_1_0 to the achievement's name attribute from the xml file. NOTE: achievement_1_0 must NOT be a string (i.e. not in quotes as in your current code), since it is referring to a string resource.
Always use this method to refer to your achievements - do not hardcode either the strings or the codes from the console as it will make your code much harder to maintain.

Im get this error debugging an app not in release.
I fix the problem adding my account/email as a new tester.
Google play console > Game Services > Testing > Add tester

Related

Google Wallet Console - Class ID

I am trying to integrate google wallet loyalty cards into my application.
I succesfully tested using the ids from the demo project .
Now I want to prepare for production. I received access for google wallet but I do not know how to complete "class id" . Did not find in any documentation .
Thanks all for your time
You may enter whatever id you want (I didn't find the field restrictions)
and then you use it to set the classId with your issuerId, like this:
objectPayload.classId = `${issuerId}.${classId}`

Amazon IAP Android onProductDataResponse always fails

I am trying to implement a simple subscription IAP on Android using the Amazon SDK. I adjusted their subscription sample app. The code is really simple.
Set <String>productSkus = new HashSet<String>();
productSkus.add("TLS_SKU_MONTHLY" );
productSkus.add( "TLS_SKU" );
PurchasingService.getProductData(productSkus);
But the response from onProductDataResponse() is always fail. I'm not sure why, I cannot find any examples etc to even know if my SKUs are right, in the sample app they looked more like package names than this, but these strings are what I entered on the 'in-app items' on the apps page on Amazon. The app has not been submitted yet, but I need to test and implement IAP before that. Any ideas? I cannot even find a simple tutorial walking through this, and as usual their docs are poor.
edit, noticed im getting these errors that dont even come up on google
Kiwi: DataAuthenticationKeyLoaderV3: Unable to load authentication Key
java.io.FileNotFoundException: AppstoreAuthenticationKey.pem
DATA_AUTH_KEY_LOAD_FAILURE: CERT_NOT_FOUND: null
com.amazon.a.a.o.b.a.a: DATA_AUTH_KEY_LOAD_FAILURE: CERT_NOT_FOUND: null
I'm wondering, is this because I am running on real Android and not an Amazon device like a fire tablet or tv stick?
You should add your own AppstoreAuthenticationKey.pem to the project assets folder. It is not (and should not be) delivered together with the sample.
Basically, you must do a few things:
Login to the Amazon developer console and create your application.
Go to the “Apk Files" tab to download AppstoreAuthenticationKey.pem.
Add this file to the project’s assets folder.
You can get the full instructions from Amazon.
As for devices, yes, you must use an Amazon device. But this should not be the reason why you are getting this exception.

Deeplinking Squareup pos app is not working

The documentation link: https://developer.squareup.com/docs/pos-api/build-mobile-web#step-5-test-your-code suggest straight forward code like this:
<a href="intent:#Intent;
action=com.squareup.pos.action.CHARGE;
package=com.squareup;
S.browser_fallback_url=https://my.website.com/index.html;
S.com.squareup.pos.WEB_CALLBACK_URI=https://my.website.com/index.html;
S.com.squareup.pos.CLIENT_ID=sq0ids-yourClientId;
S.com.squareup.pos.API_VERSION=v2.0;
i.com.squareup.pos.TOTAL_AMOUNT=100;
S.com.squareup.pos.CURRENCY_CODE=USD;
S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CASH;
end">Start Transaction</a>
I tested it and it does not open any link, my devide already have app installed.
When I try this code:
Take a QR code 2
It open play store app with squareup pos app information, I need to directly open the app and not play store screen of the app, is there any way?
*UPDATE:
I got transactions to work after adding S.com.squareup.pos.LOCATION_ID={{ my_location_id }}. The location ID can be found in Square Developer Portal > Locations. Also if the POS app is passcode protected, you have to open and login with passcode before sending transaction.
*END UPDATE
I've been working through this same issue. I still haven't gotten a transaction to work, but have at least gotten the app to open.
Make sure the CLIENT ID is your production application ID. NOT sandbox.
The WEB_CALLBACK_URI needs to match the Web Callback URL defined in your Square Developer Portal > Point Of Sale API.
I hope this helps. If you do figure this out and get transactions to work, please post your solution for me and others who are sure to run into this issue since the documentation is lacking.

GooglePlay Game Service onLeaderboardScoresLoaded always has empty ScoreBuffer

I am using the GooglePlay game service for adding a Leaderboard in my game (actually, several leaderboards). Signing in to GooglePlayGameServices works, as well as submitting a score to a given Leaderboard-id. I checked this using a OnScoreSubmittedListener. The result is ok, the score is there.
When trying to retrieve the top scores for a given id using 'loadTopScores', the OnLeaderboardScoresLoadedListener gets called with STATUS_OK, one entry in the LeaderboardBuffer (I checked this entry, it is the exact same leaderboard-id I previously submitted the score to) and alway zero entries in the LeaderboardScoreBuffer. I could not find a solution to this problem. One thing that seems odd is that in the LeaderboardBuffer entry, the player rank is set to -1. But I couldn't find out what that means.
thanks in advance for any insights on this problem =)
I managed to find the problem myself finally =) It was rather easy. Since the services utilize one's google+ account, you have to set the permissions properly. Under "settings" -> "accounts" -> "google" -> "google+" -> "apps with google sign-in" is an entry for my game. There I had to allow uploading of scores to be public. Once I did that everything works fine for me.

Android In app Billing Item ID

Long things short: If im testing my In-App-Billing apk in the market i always receive "RequestPurchase: RESULT_ITEM_UNAVAILABLE"
Im feeling like a complete idiot atm and ran out of ideas how to fix it.
i call mBillingService.requestPurchase("itemxx", ""), wich works fine with static test.purchased.
But as soon as i upload the signed apk as a draft to the android market it doesnt manage to find my predefined item. Mybe the proper Question at this point is: "How does the ID of the Item in the Market has to be "named" relating to the id you made up in your application.
Can anyone provide me with a hint on what else i can try or look up?
APP: itemxx -> Market: itemxx
APP: itemxx -> Market: package.name.itemxx
APP: package.name.itemxx -> Market: package.name.itemxx
APP: package.name.itemxx -> Market: itemxx
I solved the Problem for me. I use the Sample Code from this resource:
http://www.anddev.org/advanced-tutorials-f21/simple-inapp-billing-payment-t52060.html, thanks for that Mr. #Blundell.
Besides changing the Package-Name to get it up and running it turned out that the ID in the app and in the Market has just to be the same, simple as that.
So i call BillingHelper.requestPurchase(mContext, "item.hacke");
and create an Item for the Application in Android market with the ID item.hacke.
Take care of the following Steps:
Enter the Correct Public Key
Use a different gmail account for your tests than the publisher account and enter the mail address as Test-Account right below the PublicKey
Make sure the item in the market is published. Only the Item not the App.
good luck :D

Categories

Resources