Friday, August 8, 2014

Catena

I have just released another app: Catena!

Catena is a game with a simple premise:  Tap a tile to make that tile start rotating.  As tiles rotate, they will hit their neighbors, which will make the neighbors rotate.  As you can imagine, this process can explode in a chain reaction of turning tiles.  The goal is to create the biggest possible chain from your initial tap.

In Classic mode, that's all there is to it.  But in Extreme mode, various power-ups will spawn that can drastically effect the course of the game.  For example, one power-up will turn large groups of tiles at once, and another will give you an extra tap to spend as you choose.   And if that's not enough, I've also included Custom mode, where you can control almost every single aspect of the game.   You can change how the tiles are laid out, how often to spawn power-ups, the number of sides that will set off other tiles, etc..  According to my calculations, there are nearly 10 million different combinations of games you can play in custom mode.  Pretty sweet.

I've added some other cool things too:  You can customize the entire look and feel of the game.  Colors, tile styles, and sound effects can all be changed at your leisure.  I've also included Google Play Games Services, so you can earn achievements and post your high scores to leaderboards, as well as the ability to post your scores to Facebook to brag to your friends.

And as with my previous app, Catena is free to download!  So what are you waiting for?

Get it on Google Play

As always, if you download, be sure to rate and review!  I am always open to comments and suggestions.

Wednesday, August 6, 2014

Facebook integration, App Link Hosting

So my goal today was to enable users to share their score on Facebook after each round.  It took me the entire day, but I did finally get it working.  I ran into quite a few problems and I couldn't find any answers online, so, as always, I hope this post can help someone out.

After importing the code with the help of the Getting Started guide, I jumped straight to the Sharing section.  This part of the guide is quite good, and within a few minutes I was able to share a post to my timeline.  And after looking through the documentation for a few minutes, I found that Facebook provides an App Link Hosting API, so you can link back to your app from Facebook.  It's actually really cool; If you are on mobile and you already own the app, clicking the link immediately launches that app.  If you don't have the app installed or you are on an unsupported platform, it launches Google Play to give you a chance to download it.  Unfortunately, the documentation for this feature is much less impressive than the Getting Started guide.  So it took a few hours of digging, Googling, and trial-and-error to figure out exactly what you need to do to set it up.  Looking back, all of the information you need can be found in the documentation, but it's quite spread out and it's not incredibly clear which steps are required.  But I digress...

Okay, so here are the steps to create a new App Link object:
  1. If you haven't yet, follow the Getting Started guide and link your app to a Facebook App.  Under the Settings section, make sure you fill out Package Name and Class Name, and turn on Single Sign On and Deep Linking.
  2. You need to find your App Token.  You can do this by pasting this URL in your browser (replace {app-id} and {app-secret} with the values from the Facebook app page): https://graph.facebook.com/oauth/access_token?client_id={app-id}&client_secret={app-secret}&grant_type=client_credentials
  3. To create the App Link object, you can use cURL from a terminal.  If you don't have cURL, you can use another method.  Replace the fields in this command with the appropriate values:
    {custom-uri} should follow typical URI structure.  You can do really complicated structures if you want, but in my case I only needed one to link to the main activity.  So for example, mine looked like: my-app-name://launch
  4. Take the ID from the response and use it to get the final link: https://fb.me/{app-link-id}  (If that link doesn't work, use the official method to get the URL)

I ran into a few errors while I was figuring all of this out.  So if you get any of these while trying to create the App Link, you might have made the same mistakes I did:


This one was due to using the wrong value for "access_token".  Before I read the access tokens documentation, I tried to use the "Client Token" value from the app page.  Clearly that doesn't work.

I then tried to use the Graph API Explorer to generate a token.  But that generates a User Access token, not an App Access token, so that didn't work either.


This one was due to copy-pasting the wrong App Access token.  Somehow I must have grabbed a sample token or something, because the app ID was 123456789000000, haha.  Not sure how I missed that one.

Anyway, that's about it.  Hopefully this helps someone at some point!