Appstore Blogs

Appstore Blogs

Want the latest?

appstore topics

Recent Posts

Archive

Showing posts tagged with In-App Purchasing

September 18, 2014

Nathan Lam

A common theme that developers often face is deciding which platform they should make their apps available on next. Are the users on this platform engaged enough? Will I be able to make money on this platform? These are only some of the questions that developers face, before investing their time on transferring their apps. For Playtika, a company which builds highly immersive social games, expanding their apps onto as many platforms as possible has become a core strategy.

Playtika’s app Slotomania currently holds the #8 spot worldwide for highest grossed mobile app on iOS and Android. In addition to iOS and Android, Playtika has also launched on the Amazon Appstore, which has proved to be a big success. According to Playtika, the Amazon Appstore provided the team with the highest ARPU (average revenue per user) compared to other platforms and also contained the highest retention rate amongst its competitors. Recently I had the chance to sit down with Elad Kushnir, VP of Business Development, to discuss how their apps were doing in the Amazon Appstore and their experience working with Amazon.

Amazon Appstore offers 70% higher ARPU compared to Google Play and 15% higher than iOS

“The Amazon Appstore does not only make the migration easy from an existing Google Play app, but it also has outperforming KPI’s as well.” says Elad. The team has seen some impressive results since their app has gone live in the store and have done fairly well for themselves in terms of revenue. “When we compared our 2014 data, we noticed that ARPU on Amazon was 70% higher than on Android and 15% higher than on iOS”- Elad Kushnir

 The team credits the unique audience that Amazon brings in and how engaged they are. “When we looked at retention rates for 2nd day and 7th day metrics, the retention was relatively the same across all platforms. However on the 30th day, retention on Amazon Appstore was 10%-20% higher than on iOS and Google Play.” Says Elad.

Playtika Sees 150% Higher Conversion Rates from Players to Payers on the Amazon Appstore Compared to iOS and 170% compared to Google Play

Getting users engaged is only half the battle. With a free app like Slotomania, conversion rates (paying users/ DAU) is crucial in terms of making revenue which is why Playtika is using Amazon’s In-App Purchasing API. So how many of these users are actually purchasing within the game? From Playtika’s data in 2014, they determined that the average user on the Amazon Appstore is 150% more likely to become a paid user than on iOS and 170% more likely than Google Play.

Figure 1In-App Purchasing

From Google Play to Amazon Appstore with Little to No Work

When the team came together to decide on their next platform, they chose the Amazon Appstore immediately. So why did the team decide that Amazon Appstore was the right choice?

“When we were deciding on our next platform, we already had our app on Google Play. We realized that moving our app from Google Play to the Amazon Appstore would be pretty easy since Fire OS is built on Android. Once we started, we got our apps up and running in a couple days and the process itself was seamless. The best part was that it had relatively low development costs.” – Elad Kushnir

From previous tests, we actually found out that more than 75% of the Android apps we tested just work on Kindle Fire with no additional development required. The team has now launched several of their games on the Amazon Appstore and are working on the getting the remaining ones up and running within the next year.

Moving into Fire Phone and Amazon Fire TV

Moving forward Playtika plans to take their apps to the next level by getting them onto Amazon’s newest devices. Their current focus is to get their app on Fire, in which their team is already planning on integrating Fire’s exclusive feature, Dynamic Perspective. In 2015 Playtika is planning to also have their apps on Amazon Fire TV. For now, the Playtika team tells us that they are very happy with how things are going and plan to release even more apps on the Amazon Appstore in the near future.

Learn More about the Tools Used by Playtika

July 08, 2014

Peter Heinrich

In-App Purchasing (IAP) is gaining in popularity with developers as it continues to be a reliable revenue generator for mobile apps and games. It is the basis of Free-to-Play, eliminating up-front costs but allowing customers to purchase upgrades and add-ons they find valuable. The Amazon Appstore platform is designed to manage these transactions, and we have enhanced our In-App purchasing API to make it easier for you to manage the purchases your customers make.

Improved Customer Experience

With this update, the In-App Purchasing API improves the receipt process to provide better visibility into the fulfillment status of your customers’ in-app purchases.

The updated API replaces PurchaseToken with a unique receipt identifier called ReceiptId. The ReceiptId value allows you to:

  • Determine fulfillment status and reconcile transaction records with your Amazon earnings report.
  • Identify duplicate transactions to prevent over-fulfillment of digital content.
  • Receive notification of transactions that cancel orders.

Getting Started

The updated API is backward-compatible, which means that your existing applications will continue to work without modification. We recommend that you migrate to the latest version, though, so that you can benefit from these improvements.

  • If you are adding in-app purchasing to your app for the first time, simply build your project with the Amazon Mobile App SDK, which includes the latest version of the In-App Purchasing API.
  • If your app already uses an older version of the API but you’re not ready to migrate from PurchaseToken to ReceiptId, you can still update to the latest version. Your app will work without modification, so you can prepare for the switch and follow through with the actual migration when you’re ready.
  • If you are ready to use ReceiptId now, simply follow the migration guide available on our Developer Portal.

Additional Resources

For more details on in-app purchasing and how to implement it in your mobile projects, check out our Developer Portal and blog. Dive deep on the new API, or explore related topics such as increasing conversion, digital item sales in desktop and web-based applications, and managing promotions and discounts.

 

April 24, 2014

David Isbitski

Launched in 2010, Soundtracker by South Ventures USA, is described as an app that allows music to connect people by making it easy to discover and play music in real time with friends and anyone nearby. With Soundtracker you can create stations, chat with other users, listen and comment on their latest stations amongst other features. Available on the Amazon Appstore here as well as other platforms, Soundtracker has over 4 million downloads and 1 million active users worldwide across all platforms.

I had the chance to sit down with Daniele Calabrese, CEO and founder, to discuss their experience bringing Soundtracker into the Amazon Appstore and how they’ve managed to leverage different Amazon Mobile Apps APIs to their advantage.

Increasing Opportunity with Limited Work

Even though the app itself is available on various platforms, the reason why Daniele decided to bring the app to Amazon Appstore was simple. The “opportunity with Kindle was too good to pass on since we would be able to create an app for two platforms at once.” Daniele says that early on the team realized that the Android SDK was compatible with Kindle Fire, so they decided to build the apps in tandem. The team found out quickly that “the process in getting Soundtracker into the Amazon Appstore was very easy and the results from it has definitely paid off.”

“Monetization in the Amazon Appstore jumped 100% using Amazon’s In-App Purchasing API and Mobile Ads API in the first month since implementation” – Daniele Calabrese

 

Figure 1- Kindle Fire UI

Leveraging Amazon Mobile Apps SDK to Improve Engagement

Besides using Amazon’s In-App Purchasing and Mobile Ads API, Soundtracker also uses Amazon’s Maps API and Device Messaging API as well. For Soundtracker “being able to monetize and engage your users are the most important factor in choosing a platform” says Daniele. The team credits these specific API’s as “the reason why we were able to be so successful in the Amazon Appstore.” By integrating certain APIs you can also qualify for different programs. Daniele says the team is “excited to be admitted into the Appstore Developer Select program,” which provides the team with 500k mobile ad impressions, Amazon Coins rewards to customers, and more.

Figure 2- Nearby feature and push notification

Since Soundtracker detects where other users are, relative to their current location, notifying other users who are nearby is crucial for engagement. The team decided to use Amazon Device Messaging API and Amazon Maps API to help solve this issue. The device messaging and maps APIs allow users to really engage by integrating interactive maps directly into your app, as well as sending out push notifications from the cloud to the user. When your app relies heavily on social interaction, such as Soundtracker’s feature of commenting or discovering other users’ playlist selections, getting a user’s attention is one of the most important factors. By using these APIs, the team was able to see a consistent lift in engagement.                

“Engagement in the Amazon Appstore increased by 400% in the last 6 months. Number of sessions, length of sessions, and number of tracks streamed per user increased on a weekly basis.”- Daniele Calabrese

So how long did it take for the team to integrate all these APIs? Daniele says “the process for development and testing altogether took only a week and the process was very straight forward”.

Expanding into the Living Room with Amazon Fire TV

According to Daniele, “since performance has been successful with their current app on Kindle Fire” the team plans to expand even more into the Amazon ecosystem. The next step for the team is “integrating with Amazon’s music offering and getting their app on Amazon Fire TV.” Since the team has already qualified for Appstore Developer Select, the team can now qualify for the Appstore Developer Select Amazon Fire TV benefits as well by optimizing for the Amazon Fire TV. This includes enhanced on-device merchandising and a 500k Amazon Coins offer per qualifying app.

“I would recommend Amazon Appstore to other developers. Getting our app on Kindle Fire was very easy and it gives developers a great opportunity to distribute and monetize their apps.” – Daniele Calabrese

 

April 07, 2014

David Isbitski

This quick video will give you an overview of the Amazon In-App Purchasing API.  It will cover how to get started, offer advice on popular In-App items and categories, and cover the process for creating your own In-App SKU catalogs.  Whether you are completely new to In-App Purchasing, or have existing items for sale on other Appstores like Google Play, this video will help point you in the right direction.

March 26, 2014

David Isbitski

Launched in 2012, publisher DJiT describes edjing as the first and only multiplatform track-mixing application on the market. With edjing, customers have been given the opportunity to mix like a professional DJ, record their tracks, and numerous effects and then share them out with friends. Available on the Amazon Appstore here and other platforms, edjing has already registered more than 15 million downloads and is available in more than 170 countries across iOS, Android, Windows and Amazon.

I had a chance to sit down with Jean-Baptiste Hironde, CEO of DJiT, to discuss their experience bringing edjing into the Amazon Appstore ecosystem, what they’ve found Amazon customers like about their app, and what type of success they’ve seen.

Porting to Amazon with a single developer

The process of updating the existing Android version of edjing for the Amazon Appstore was a simplified one and done by a single developer on the team.  “We have been very pleasantly surprised on how easy it was to port the app over to Amazon. We only had few modifications to do in order to adapt to the Amazon environment, especially concerning the In-App Purchases. We just simply had to match our existing In-App Store SKUs with Amazon’s.” recalls Jean-Baptiste.

Figure 1- Mixing tracks in edjing

Amazon’s free In-App Purchasing API allows publishers to sell digital content and subscriptions—such as in-game currency, expansion packs, upgrades, magazine issues and more—for purchase within their mobile apps and games. It includes a fully integrated checkout experience with the Amazon 1-Click settings customers are familiar with.

DJit Experiences Higher ARPD and ARPU in the Amazon Appstore

Edjing chose to have a Freemium business model for the initial release. The app was downloadable for free but customers could buy additional features as in app purchases via the edjing in-app store. Currently this includes selling additional sound effects as well as customizable turntable backgrounds. The Freemium version also implemented an offer wall within the app, to help offer purchasing options to customers who had not bought anything yet.

“The Average Revenue Per Download (ARPD) on Amazon is actually higher than on Android.” – Jean-Baptiste, CEO 

Figure 2- Buying a new Skin via Amazon's In-App Purchasing API

Based on the success with the Freemium model a Premium version of edjing was released. “Amazon monetizes very well, therefore we’re currently offering a Premium version. We actually noticed that though the volume of downloads might be lower than on other platforms, the Average Revenue Per Download (ARPD) is actually much higher than on Android." says Jean-Baptiste.

Soon after being launched edjing was also featured in the Amazon Appstore. According to Jean-Baptiste after being featured, the average daily downloads on the Amazon Appstore for edjing increased by 400% during that time.

“Amazon users spend more time in edjing than any other platform. Close to 25% of edjing for Amazon sessions exceed 30 minutes!” – Jean-Baptiste, CEO

Edjing has also seen a stronger engagement than on competitive platforms.  “Amazon users are very qualitative users. User engagement with edjing on Amazon is higher than on any other platform. In proportion, Amazon users spend more time in edjing than any other platform. Close to 25% of edjing for Amazon sessions exceeds 30 minutes! “In summary, it is so easy to port the app on Amazon that there’s no reason you shouldn’t!” concludes Jean-Baptiste.

You can check out edjing today in the Amazon Appstore including both free and premium versions.  You can find out more about the Amazon In-App Purchasing API here.

-Dave (@TheDaveDev)

 

March 05, 2014

Chengluo

Reaching More Customers and Making More Money Per User

In a previous case study, you heard about the tactics that Big Blue Bubble uses to monetize their free to play (F2P) games. In this study, we’d like to share how June Software increased their app exposure by going from an iOS-only producer to an iOS and Android platform producer, and how their presence in the Amazon Appstore has racked up higher Average Revenue per User (ARPU) than any other app store.

June Software is a small San Francisco based software company founded in 2008. They build casual, arcade games and e-learning games for children. Initially June Software only built games for iOS where they have titles such as Math vs. Zombies and Guess the Movie, which is ranked #3 worldwide and is #1 in Australia.

June + Unity + Amazon Appstore = Less Friction, More Revenue

To grow their customer base, June Software decided to address the Android marketplace. June chose to port their iOS games to Android using Unity. Unity allows them to build their app once and deploy it to multiple app stores, including the Amazon Appstore.

When we asked about their experience on Amazon apps store, June Software Director Products Saurabh Jain said:  “On Amazon, we have seen 2x times the ARPU [we see] from Google Play, and 1.2x [more than] than Apple AppStore. The overall downloads aren’t there yet, but the revenue makes it a very good market for us.”

 

Increasing Time in Games Increases Potential Income

One effective strategy that Saurabh implemented is that they have integrated Amazon IAP and GameCircle features in their games, which increased potential revenue and player engagement. GameCircle includes features such as leaderboards and achievements that keep players engaged and can increase user session time and session frequency, giving uses more opportunities to make IAP purchases. And it works on Android and iOS. This is exactly what June Software needs for their games available for both platforms.

What can you do?

  • To learn more about using Amazon GameCircle in your Unity apps, read this blog post and refer to this documentation.
  • To learn more about using Amazon In-App Purchasing in your Unity apps, read this documentation. To see how Mad Menace Games used the Amazon IAP Plug-In for Unity, read this post.
  • For additional information on Amazon Unity Plug-ins, read this

 

 

January 23, 2014

David Isbitski

Amazon allows you to distribute your web apps and mobile-optimized HTML5 websites to millions of Amazon Appstore customers in nearly 200 countries across the globe.  With Amazon’s In-App Purchasing API for JavaScript you can increase revenue by enabling compelling monetization strategies.  This includes a "freemium" model for your app where the app itself is free but you charge a premium for advanced services or functionality.  Your web app can offer customers in app currency, subscriptions and entitlements all through the secure Amazon checkout process.

Getting Started

The first step in implementing In-App Purchasing in your web apps is to download the Amazon Mobile App SDK, then you will submit a new web app to the portal and then finally add a reference to the Amazon Web API libraries in your html. 

The latest versions of the Amazon Web API libraries are hosted by Amazon for you.  The current urls can always be found in the LATEST_URLS.txt file located in the Amazon Mobile App SDK folder.

<!DOCTYPE html>

<html>

<head>

    <title>Button Tester</title>

    <!-- Use of this sample code involves calling jQuery from Google

                 Hosted Libraries and is subject to the terms located here:

                 https://developers.google.com/speed/libraries/terms

    -->

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>

    <script src="https://amazon-web-app-resources.s3.amazonaws.com/v0/latest/Amazon-Web-App-API.min.js" type="text/javascript"></script>

    <script src="https://amazon-web-app-resources.s3.amazonaws.com/v0/latest/Amazon-Web-App-API-tester.min.js" type="text/javascript"></script>

    <script src="js/buttonclicker.js" type="text/javascript"></script>

    <link rel="stylesheet" href="buttons.css"/>

</head>

Once you have referenced these JavaScript files you will have everything you need to access the Amazon In-App Purchasing API from your web app.

Setting Up Your Catalog

Before you can make any In-App Purchase calls you need to have a catalog of SKUs set for your web app to use.  You can add SKUs to your web app’s catalog by opening the Developer Console, selecting Apps & Services, choosing the web app submission you want to add SKUs to and then clicking on the In-App Items link, which will take you to the list of SKUs currently offered in your web app.

There are three types of SKUs you can offer to your customers.

·         Consumables – This type of purchase is available only on the device it was purchased on.  Some consumable examples include in-game currency or an extra power up in a game.

·         Entitlements – This is content that requires access rights such as unlocking additional game levels or offering specific magazine issues.  Entitlements do not expire, are tied to a customer’s Amazon account and are available on any device they access the content from.

·         Subscriptions – These are entitlements that are bound by a period of time which auto-renews at the end of the period and is tied to the customer’s Amazon account. Subscriptions are available on any device a customer accesses the content from. You are allowed to have multiple subscriptions for purchase within your app.

 

Simply click on the type of SKU you would like to add and you will be taken to a new screen where you can provide information about the SKU.  For example, if I wanted to offer an Entitlement purchase for my World of Warcraft Realm Status app to track a single realm I would click Add an Entitlement and then enter a Title and SKU.

 

Next you will need to enter pricing information for your new SKU.  In this case, I want to sell a Track Single Realm for $1.00.  Amazon gives you the option of setting your own list price for each marketplace or it can match the prices based on your entered base price.

 

You can also enter a detailed description, along with keywords for the Entitlement.  Descriptions can be provided in multiple languages and if no translations are given the default English description will be used.

 

You also need to provide images of the item for users along with the image you want displayed upon a successful purchase.

 

Once you  have completed this, click Save, and then Submit In-App Item.  You will be taken back to our In-App Items screen with the new SKU now listed.  In the upper right corner will be a button to download a JSON Data file. 

This JSON file will include a list of our SKUs that will be used by the SDK Tester Tool when we want to simulate a purchase in our development environment.

 

The SDK Tester Tool is included in the Amazon AVD Launcher emulators or it can be installed on a device via the APK included in the Amazon Mobile App SDK under the /Android/InAppPurchasing/tools.

The Button Clicker example includes a similar JSON file that covers all of the purchasable item types.

Purchase Process Flow

The JavaScript In-App Purchasing API is designed to encapsulate the complexity behind the purchase process while providing a fully featured API. While building your app, it is important to understand which parts of the purchase flow the app must implement, and which parts are handled by the Amazon Services library.

Note: In order to protect customers, we also require that you serve the page of your app that uses In-App Purchasing over  SSL/HTTPS. For more information, please refer to the Making Your Web App Safe documentation

Below is a simplified chart explaining responsibilities during the purchase flow.

 

In-App Purchasing API for JavaScript is comprised of three elements:

  • Amazon Services JavaScript - The class/API that manages the interaction between the application and Amazon's native APIs.
  • Purchase Handlers - The object your application provides to respond to callbacks from the Amazon Services JavaScript. They are registered as an observer to the Amazon Services In-App Purchasing API.
  • Receipt Verification Service - An HTTP service you should use to validate the customer's purchase receipt.

The process workflow between your JavaScript calls and the Amazon Services JavaScript library looks something like this:

 

You can deliver static content stored locally or dynamic content that is updated over time for customers.  For more details about the Purchase Process workflow and the types of deliverable content you refer to the Understanding In-App Purchasing for JavaScript API documentation here.

Implementing and Testing Purchase Calls

Now that you understand the process flow, have referenced the proper JavaScript libraries and have created a list of SKUs (or local JSON file) it’s time to call out to the Amazon Services in your own JavaScript.

Every call you initiate via the Amazon Services JavaScript Libraries results in a response received by the corresponding response handler specified in registerObserver(). Each of these responses makes use of a response object and includes the following:

  • GetUserIdResponse - Provides the app-specific UserID for the user currently logged into the Amazon Client
  • PurchaseUpdatesResponse - Provides a paginated list of receipts and revoked SKUs since the offset passed into the initiating request. Receipts are returned in a set and are unordered.
  • ItemDataResponse - Provides item data, keyed by SKU.
  • PurchaseResponse - Provides status on purchases initiated within your app. Any error for a purchase is automatically managed for you by In-App Purchasing API.

There are also purchase handlers, similar to the In-App Purchasing API for Android that have already been implemented for you inside the Amazon Services JavaScript files.  They include the following:

  • onSdkAvailable(onAvailableResponse) - This gets called when the In-App Purchasing services are ready to be called by your code. Production applications should not grant entitlements when they are run in sandbox mode.
  • onGetUserIdResponse(userIdResponse) - Called in response to GetUserId.
  • onItemDataResponse(itemDataResponse) - Called in response to GetItemData. data.itemData is a hash table of itemData objects keyed by SKU.
  • onPurchaseResponse(purchaseResponse) - Called to report the status of a purchase operation. purchaseResponse.purchaseRequestStatus contains the status of the response. If a prior session of the application shut down before a purchase response could be delivered, this function will be called when a new session of the application registers a purchase hander.
  • onPurchaseUpdateResponse(data) - Called with the list of entitlements that the user has been granted. data.receipts contains a hash table, keyed on SKU, that contains the receipts for the IAPs that have been granted to the user. data.revokedSkus has a list of SKUs that the user can no longer use.

Implementation of the Amazon Services JavaScript library is as follows:

  • Enable the API Tester
  • Register a Purchase Observer
  • Check to see if we are running in developer Sandbox Mode
  • Update any existing Purchases
  • Handle Purchase Responses
  • Store Receipts

For example, the Button-Clicker example starts off by calling an initialize() function which will set up an IAP observer using amzn_w.IAP.registerObserver() and then checks the response object to see if the web app is in debug mode.  If it is an alert box is generated telling the user the app is in development mode.  If not it will check for updated Purchases.

Finally, the function sets up handlers for Purchase Response and Purchase Updates Response objects.

// Setup

function initialize() {
    loadPageState();
    amzn_wa.enableApiTester(amzn_wa_tester);
    refreshPageState();

    // Setup button press handlers
    $("#theButton").click(function() { buttonPressed(); });
    $("#redButton").click(function() { redButtonPressed(); });
    $("#greenButton").click(function() { greenButtonPressed(); });
    $("#blueButton").click(function() { blueButtonPressed(); });

    // Ensure we can call the IAP API
    if (amzn_wa.IAP == null) {
        console.log("Amazon In-App-Purchasing only works with Apps from the Appstore");
    } else {
        // Registers the appropriate callback functions
        amzn_wa.IAP.registerObserver({
                 // Called the the IAP API is available
                'onSdkAvailable': function(resp) {
                    if (resp.isSandboxMode) {
                        // In a production application this should trigger either
                        // shutting down IAP functionality or redirecting to some
                        // page explaining that you should purchase this application
                        // from the Amazon Appstore.
                        //
                        // Not checking can leave your application in a state that
                        // is vulnerable to attacks. See the supplied documention
                        // for additional information.
                        alert("Running in test mode");
                    }

                    // You should call getPurchaseUpdates to get any purchases
                    // that could have been made in a previous run.
                    amzn_wa.IAP.getPurchaseUpdates(state.lastPurchaseCheckTime != null ?
                            state.lastPurchaseCheckTime : amzn_wa.IAP.Offset.BEGINNING);
                },

                // Called as response to getUserId
                'onGetUserIdResponse': function(resp) {},

                // Called as response to getItemData
                'onItemDataResponse': function(data) {},

                // Called as response to puchaseItem
                'onPurchaseResponse': function(data) { onPurchaseResponse(data); },

                // Called as response to getPurchaseUpdates
                'onPurchaseUpdatesResponse': function(resp) { onPurchaseUpdatesResponse(resp);
            }
        });
    }
}

$(function() {
    initialize();
});

Once initialization is done you can make purchase calls by passing in your SKU title.  The example code here is making a call to purchase the more “sample.clicks” SKU.

function buyClicks() {
    if (amzn_wa.IAP == null) {
        alert("You are out of clicks, however Amazon In-App-Purchasing works only with Apps from the Appstore.");
    } else if (confirm("Buy more clicks?")) {
        amzn_wa.IAP.purchaseItem("sample.clicks");
    }

The purchaseItem function will return a response object you need to handle and check for success or failure.

// purchaseItem will cause a purchase response with one receipt
function onPurchaseResponse(e) {
    if (e.purchaseRequestStatus == amzn_wa.IAP.PurchaseStatus.SUCCESSFUL) {
        handleReceipt(e.receipt);
    } else if (e.purchaseRequestStatus == amzn_wa.IAP.PurchaseStatus.ALREADY_ENTITLED) {
        // Somehow we are out of sync with the server, let's refresh from the
        // beginning of time.
        amzn_wa.IAP.getPurchaseUpdates(amzn_wa.IAP.Offset.BEGINNING)
    }
    refreshPageState();
}

If it gets back a status of PurchaseStatus.SUCCESSFUL it will handle the receipt returned in the response object like so: 

// purchaseItem will cause a purchase response with one receipt
function onPurchaseResponse(e) {
    if (e.purchaseRequestStatus == amzn_wa.IAP.PurchaseStatus.SUCCESSFUL) {
        handleReceipt(e.receipt);
    } else if (e.purchaseRequestStatus == amzn_wa.IAP.PurchaseStatus.ALREADY_ENTITLED) {
        // Somehow we are out of sync with the server, let's refresh from the
        // beginning of time.
        amzn_wa.IAP.getPurchaseUpdates(amzn_wa.IAP.Offset.BEGINNING)
    }
    refreshPageState();
}

In this Button-Clicker example we are setting a Boolean value to true based on a successful purchase.  In a real web app you would want to save the purchase receipt to local storage or back to your own cloud storage so you can verify purchase receipts in the future.

Using the SDK Tester App

If you are running in the development Sandbox Mode we mentioned above calls to the Amazon Services will go through the local SDK Tester App instead of to the Amazon Cloud. 

This allows you to simulate purchasing SKUs in your web app without having to spend any actual currency.  You have the option to test a purchase inside the browser itself using the included Amazon Service JavaScript Libraries.

In this scenario you need to ensure your JSON file holding the SKUs is located in the same folder as you web app.  If you want to test the In-App Purchase on a device you can do so using the SDK Tester tool and a JSON file that has been copied to the SD Storage.

For a complete video walkthrough of the purchase process and SDK Tester tool you can watch the following screencast on our Youtube Channel.

Conclusion

By utilizing the Amazon In-App Purchasing API for JavaScript you are able to quickly implement and test purchases through your existing web app.  Customers can take advantage of in app items, subscriptions and entitlements you might offer all through the secure Amazon checkout process.

Be sure to check out our HTML5 Web App materials on the developer portal to get started today!

-Dave (TheDaveDev)

 

 

January 22, 2014

Mike Hines

Note: Effective 08-26-2015 Free App of the Day (FAD) has been replaced with Amazon Underground.

Getting the right exposure for your app is a key ingredient to making it successful. Amazon already has several programs which developers can leverage to help drive visibility to their apps, and developers who want even more visibility think outside the box to tailor their customer experiences to increase engagement with their apps. Tribeplay is one of those game publishers who did just that, by issuing a price discount promotion that drastically increased their revenue.

The team which is based out of China has been building apps since 2012 and created the series of games under the title Dr. Panda that first appeared on iOS and Android. According to Tribeplay, making their Android Apps available on the Amazon Appstore required “little to no extra tweaking.” Tribeplay added that “one of the best things about the Amazon Appstore is that there wasn’t much work to get our apps on there. We already develop for Android, so getting our games on the Amazon Appstore was a real breeze.”

 

 

 

 

The games are available worldwide, but the team wanted to increase sales in Europe so they discounted the price of their apps by more than 50% in select countries. By doing so, Tribeplay saw their gross revenue more than double in UK, Germany, France, Italy, and Spain.

So how did the team accomplish this? Tribeplay ran banners highlighting their price promotion, which caught the attention of customers in the Amazon Appstore. When the Amazon Appstore recognized that their app was trending in customer popularity, Amazon assisted by providing more visibility for the app. “The suite of tools for promotions and sales [that Amazon provides] to help market our apps on the Amazon Appstore more effectively are very valuable.” said Tribeplay, the creators of Dr. Panda. The team saw the app’s sales more than double during the time period, when they increased the visibility of their app. 

Aside from the sales uplift, Dr. Panda was also able to reach a new and unique developer audience on Amazon. “Amazon Appstore is a fantastic platform for us and continues to get better. Through Amazon we’ve been able to reach a whole new demographic and really succeed with them. The fact that the Kindle Fire device line is so integrated to the store has also been a great benefit for both developing and marketing our apps with Amazon customers in mind.” The teams recently joined the Appstore Developer Select program and integrated the Mobile Ads API and are excited to see how the results will turn out. By participating in these programs, the team will receive additional impressions for their app, home page placements, and customized ads for their app in the US.

So how can you increase visibility? Besides having your app perform well, you can ensure your app qualifies for the Appstore Developer Select program, or get your app featured in the Free App of the Day program. If you’re looking for something similar to what Tribeplay did with their promotion, check out the Developer Promotions Console, which allows you to easily discount your apps. Getting your app onto these programs only requires a couple pre-requisites and they all aim at providing visibility for your app. For example, for your app to qualify for the Appstore Developer Select program, it must utilize relevant API’s such as Amazon In-App Purchasing, Amazon Mobile Ads, and Game Circle that all contribute to enhancing the user’s experience in your app. If you need help with these requirements we have a lot of resources available as well. “The Amazon team has always been amazing with their help and advice. Questions we ask are always answered promptly and accurately, and any problems we’ve had have been solved super quickly.” says Tribeplay.

 

January 03, 2014

Amazon Mobile App Distribution Program

Adobe AIR Native Extensions for the In-App Purchasing and GameCircle APIs are now available for mobile app developers. If you create your mobile games using Adobe’stools, you can now use these extensions to rapidly add both In-App Purchasing for virtual goods and GameCircle for leaderboards, achievements, and Whispersync for Games.

The Adobe Gaming SDK enables developers to package ActionScript code into native apps for Kindle Fire, along with other devices. The Gaming SDK and the Adobe Game Developer tools are designed to help developers create rich,interactive experiences expertly and efficiently, supporting popular features such as hardware-accelerated graphics.

Adobe-1
The new AIR Native Extensions are available today for free as part of the Amazon Mobile App SDK. You can download the latest version here. Just follow the simple instructions in the documents to get started. Of course, you’ll also need AIR in order to use the extensions.You can learn more about the Adobe Gaming SDK and Adobe Game Developer Tools  here.

November 14, 2013

David Isbitski

We’re excited to announce a new tool for developers called the Developer Promotion Console (DPC). DPC gives you a self-service way to manage the pricing of all your apps with pricing campaigns. Want to run a 24-hour special holiday sale or discount all of your apps to celebrate the launch of a new game? It’s now much easier.

The Developer Promotion Console is available just in time for the holidays and it’s a great time run a special offer. In 2012, we saw a 50% increase in the number of app downloads during Thanksgiving week as compared to an average week. During ‘Digital Week’ 2012, the week after Christmas, customers purchased and downloaded 600% more apps than any other week during 2012.

What is it?

DPC allows you to create campaigns that run from 24 hours to any amount of time you choose, up to a maximum of 27 consecutive days. Pricing is worldwide so you can set discounts by Amazon marketplace. Best of all, you can run campaigns for the price of your mobile apps and any of your mobile in-app items.


 

What does it include?

Set temporary price drops: Create price drop promotions for your mobile apps and mobile in-app items to incentivize your customers to purchase your products. 

ReportingEasily view your ROI during your price drop promotion. Compare the performance of your promotion with your performance prior to the promotion.

Ease of use: Creating a price drop promotion is simple. Typically, it will take no more than five minutes and three steps to go from start to a scheduled promotion.

How do I get started?

Inside of the developer console, you will see a new tab called ‘Promotions.’ Clicking on the tab will display a new button to create a ‘Price Drop,’ as well as a list of your existing campaigns.

You will be able to set a discount for any of your apps and in-app items available for purchase.

For this example, we are going to create a new campaign for one app and set a price discount for the upcoming Thanksgiving holiday. We start off by giving the campaign a name, in this case the ‘Thanksgiving Holiday Promo’, and then selecting the app (currently blocked out in the image for privacy reasons) that we want to include in the promotion.

We then select the Amazon marketplaces we want the campaign to run in. Since Thanksgiving is a US holiday, we will only run it in the amazon.com marketplace.

Next, we can choose the dates for our campaign, with the minimum being one day and the maximum being 27 consecutive days. We are going to run this campaign for Thanksgiving Day only, on November 28, 2013.


We then click ‘Next’ and define the discount we want to apply to our app. We are going to do a 50% off sale with the price being rounded to the nearest 9. Selecting the amazon.com marketplace from the dropdown shows us that the list price for our app will go from 2.99 USD to 1.49 USD when the campaign is active.

Again, note that the app name in the above screenshot has been hidden in this example for privacy reasons.

Clicking ‘Next’ will give us a final confirmation of our campaign’s details. We have the ability to edit any of the sections before hitting ‘Submit’.

We’re finished. Our campaign is now ready to run on Thanksgiving Day in the amazon.com marketplace, where our app will be available for sale at 50% off.

How much did we increase sales?

Rather than guessing if we made more money with increased sales at a discount, the DPC reports will show us our net results of our campaign sales compared with our normal app pricing.

To view the results of the campaign, we just click on the ‘Promotions’ tab again (the same one we used to create our campaigns), and we will see a list of the campaigns that have run or are planned.

In the above example, we can see that we ran a campaign from October 29th through November 3rd (campaign name hidden for privacy reasons), and we have the option to click ‘View’ to see the results of that campaign.

We can see that during the campaign period, we sold 21 units of our app at 50% off.

The ‘Effect’ column takes the guesswork out of the ROI for our campaign and gives us the net results. Based on sales during the period of time before the campaign ran, we have increased our revenue for the period by 84%, resulting in a nice boost.

We can also click on the CSV icon, which will create a detailed view of daily sales during the campaign period and compare them with previous run rates.

Conclusion

The new Developer Promotion Console helps you manage discounted pricing which can lead to increased sales and customer engagement. Creating a new campaign is easy through the Developer Promotion Console, at no cost to you. With detailed reports that will show you the ROI of your campaign, you can feel more confident experimenting with discounts on your apps and in-app items.
 

-Dave (@TheDaveDev

 

September 06, 2013

Mike Hines

 

Another follow-up in the series of webinars covering Amazon devices, services, and mobile applications, here’s a list of questions we collected during and after our presentation on the Amazon In-App Purchasing API.
 

Q&A

Q: How does amazon recommend implementing restoring IAPs for device re-installs or multiple devices?

A: For Entitlements and Subscriptions, you can use PurchasingManager.initiatePurchaseUpdatesRequest(Offset.BEGINNING); to get all the receipts for the currentUser, and you can validate any receipt against the Receipt Validation Service (not discussed in the Webinar.)
 

Q:Can I host website files on S3 for app program?  How will only legitimate app purchasers access the website? Mobile app program needs more info/examples. e-book publishers can't relate.

A: Yes. IAP does not care where entitled content is fulfilled from. You can fulfill content from an S3 server. Your app would be responsible for validating entitlement or active subscription for currentUser, and then pulling down the S3 content and granting currentUser access to that data.
 

Q: Could you show how it looks visually in some app?

A: See ButtonClicker, a sample in the IAP section of the SDK download
 

Q: I mean specific recommendations implemented inapp purchases with ANE.

A: For information about IAP and Adobe AIR ANE, please visit:
https://developer.amazon.com/sdk/in-app-purchasing/documentation/adobe.html
 

Q: Can one test in-app purchases through emulator?

A: Yes, you can use the SDK Tester to test in-app purchases through emulator. You can learn more about the SDK Tester at:
https://developer.amazon.com/sdk/in-app-purchasing/documentation/testing-iap.html
 

Q: Anything specific for Adobe Air ANE?

A: For information about IAP and Adobe AIR ANE, please visit:
https://developer.amazon.com/sdk/in-app-purchasing/documentation/adobe.html
 

Q: We are looking to restore saved game data using the userID, is this a sensible use for the ID? If so what is the maximum length of this string, does it contain only ASCII characters?

A: Good question. We recommend using the userID (player name and alias) from the GameCircle API. Using this, you can not only get an identifier for saved game data, but you can also sync game state, store high-scores and register achievements.  If you don't want to use GameCircle, getUserID will return an app-specific ID of the currently logged in user, meaning the result will be different for different apps, even on the same device. The UserID will, however, always the same for the same package name, even across devices.
 

Q: What format is the userID field? (length, character encoding, etc)

A: userID is returned as java.lang.String, see API reference for details:
https://developer.amazon.com/sdk/in-app-purchasing/reference/api-reference.html
 

Q: Is there any way we can test a real IAP before launching the app? We have been bitten by minor differences between IAPs made in dev and production environments in the past.

A: Unfortunately it is not currently possible.
 

Q: We submitted our app, but we are told the app crashes, but no device logs are provided to help us identify where it is crashing…how could we get device logs when a crash it detected?

A: I'm sorry to hear that. Please submit a Contact Us with the details of your app:
https://developer.amazon.com/help/contactus.html
 

Q: Can you also add a few more samples of html5 code for us to check so that we know our content will work on multiple devices. 

A: So far, the only HTML5 samples we have are in the SDK. Amazon Mobile App SDK . This is a ZIP file that contains the JavaScript files that are required for your application to access the Amazon services it needs. I recommend using the Web App Tester (free) to test how your content will work. 
 

Q: Will the emulator work on my desktop?

A: Yes, you can learn more about the emulator at:
https://developer.amazon.com/sdk/fire/arch-emulator.html
 

Q: For apps that are html5 with css, you mentioned on Aug 7th press release that we could take mobile websites and turn them into apps.  How do I set that website so that it is secure to purchasers?  

A: We have a quick security overview here: https://developer.amazon.com/sdk/webapps/webappsecurity.html. More detail should really be provided on a case-by-case basis with a developer.
 

Q: Will you accept a .htmlz file?  Or only html5? 

A: They way you submit a web-app is by putting a manifest.xml file at the root of your web app and submitting the path to that manifest, so submitting a file is not required.
 

Q. We submitted our in-app billing application, but it keeps getting rejected because of various reasons.  We are not receiving any device log, so it complicated to debug and resolve.

A. Please submit a Contact Us with the details of your app, our engineers will be able to assist you:
https://developer.amazon.com/help/contactus.html
 

Q. When we complete an IAP item in the dashboard do we submit it before we submit the app or at the same?

A. Entering the IAP items in the developer portal before or at the same time is okay. It's not okay to wait for some time after the app is submitted to add your in-app purchase items to the portal.
 

Don’t miss out on our next webinar event: 
Monetize Your Apps With Physical Goods Using Amazon's Mobile Associates API
on September 17th, 2013 @ 10:00 AM PDT.
Pre-register here!

 

August 30, 2013

Mike Hines

Note: Effective 08-26-2015 Free App of the Day (FAD) has been replaced with Amazon Underground.

Amazon Mobile Ads API developer, Games2Win, Increases Earnings by 733% on Kindle Apps with eCPM up to $2.87

"The $2.87 eCPM we saw through Amazon far exceeded our expectations. Now we're racing to get Amazon integrated in all of our apps across all Android stores," says Mahesh Khambadkone, Co-Founder of Games2Win. See how Games2Win uses the Amazon Mobile Ads API to increase their earning by 733% on their Kindle Fire apps with eCPM up to $2.87. Click here for more monetization tips.

As I was reviewing our catalog of blog posts and thinking about blog posts we should write in the coming weeks, I was impressed by the number of ways Amazon helps developers monetize their apps. I thought it would be a good idea to recap those here!

Programs and Promotions

APIs

(no coding required)

(coding required)

Amazon Coins

In App Purchasing

Free App of the Day

Mobile Ads

Test Drive

Mobile Associates

Personalized Recommendations

Game Circle

 

A|B Testing

To learn more about the items above, please continue reading below.

Reach

No development effort is required to take advantage of Amazon’s reach.

•      In nearly 200 countries - The Amazon Appstore is available in the hottest app-buying markets in the world.

•      The only store on Fire - The Amazon Appstore is the only app store on Kindle Fire, the best selling Android Tablet worldwide.

Programs and Promotions

No development effort is required to take advantage of our programs, but you do need to sign up for Free App of the Day.

•      Amazon Coins – a virtual currency that users can get for up to a 10% discount, but still pay the developer the same as actual currency

•      Free App of the Day – Just tick the checkbox when submitting your app and you will be considered for the program.

•      Test Drive – By removing friction for customers who want to try apps, the more apps they will try. Those customers are more likely to find apps they are excited to download.  In this way, Test Drive helps customers understand the value of premium apps and helps drive downloads of freemium apps. Since Test Drive launched, it has been enabled on over 16,000 apps.

•      Personalized Recommendations – Increases the chance that your app will be seen by its most likely buyers.

Revenue Producing APIs

Development is required to make money with our APIs, and we’re working hard to make that effort as easy as possible. These are the APIs I’d like to talk about now.

In-App Purchasing (IAP): If you wish to sell digital assets like game currency or access to features or data within your app, the In-App Purchase (IAP) API has three good options for you:

Selling lasting items: If you have an app in which users need ownership of something durable, say, a new sword for their dungeon crawler character, you would use an IAP entitlement transaction. If you have a productivity app that has a set of advanced features you want to sell at a premium, you don’t need to have a free and a paid version of your app in the appstore; you need only one free version with an IAP entitlement inside to purchase access to the advanced features.

Delivering content or value over time: You could even collect $0.99 every month for the advanced features of your app if your users would rather subscribe to advanced features. For this, you would use the subscription IAP item. Access to advanced features would be available while the subscription was active, and inactive otherwise. You can also use subscription IAP items so a user can subscribe to a stream of entitled items like magazines. As long as you are subscribed, you get issues that you become entitled to even after your subscription ends.

Consumable items: If you have an app in which the user spends game currency, you would want a consumable IAP transaction. In a consumable IAP transaction, users get a set quantity of something, usually power-ups, hints, un-do actions or coins that they consume during play. Once they are out, they can buy more.

Mobile Ads: If you want to collect revenue by displaying ads on your site, then the Mobile Ads service is for you. You can display a traditional banner advertisement (anywhere on your screen above the fold), you can display expandable interactive ads, and you can even pop up large views displaying our largest ads for an interstitial ad experience.

Mobile Associates: If your app is a natural compliment for a physical good, then you will like the Mobile Associates program and API. If, for example, you have a GPS phone app, you could probably earn some revenue share income by offering hiking or outdoor-related items from the Amazon.com store to your customers. Your revenue-share in the Mobile Associates program varies depending on the category of the item sold, but you can use this API set to sell one item and never have the user exit the context of your app, or you can collect a rev-share on an entire shopping-cart of items that a user will purchase in the Amazon.com UI.

Other APIs

Okay, these APIs don’t generate revenue directly, but they are so important to generating revenue I had to find a way to get them in this post.

A|B Testing: Now you can test to see what makes more money in the real world.

Have you ever wondered if placing an In-App-Purchase dialog box at the beginning of a level or at the end of a level would result in more revenue? Now you can find out which is actually best with real users. You can test any set of conditions and successes to find the combination that is most profitable for you. And you can change the variables and the mix without having to re-submit your app. (works on all Android app stores).

GameCircle: The current version of GameCircle is free, and provides your users with saved game syncing, achievements, and leaderboards that work on most Android apps sold from any Android marketplace. The cross-store capability is nice, but the big take-away here is that games with GameCircle make 83% more average revenue per user than games that don’t.

So it turns out that there are a lot of things Amazon is doing to help you make the most from your app (documentation for the APIs can be found in our dev portal here) It’s easy to start selling your apps on Amazon. Just click here to create a free account today.

August 26, 2013

Mike Hines

Until today, developers have only had three methods to monetize their apps or games: selling them outright, going “freemium” with in-app purchasing or subscriptions, or using mobile ads. Starting now, Amazon has created a new method for developers to monetize: the Amazon Mobile Associates API, currently available for Android (including Kindle Fire). The Mobile Associates API allows developers to sell real products from the millions of items at Amazon, whether physical (i.e. toys, clothing) or digital (i.e. eBooks), from inside their apps or games while earning up to 6% in advertising fees from those purchases. The Mobile Associates API is an extension of Amazon Associates, our successful web-based affiliate program created in 1996, paying advertising fees to hundreds of thousands of affiliates worldwide.

With the Amazon Mobile Associates API, you’re now able to:

Sell a single item from Amazon in your app or game: The boss at the end of a stage in your game is a giant three-headed wolf, sell the popular “Three Wolf Moon” t-shirt from Amazon

Showcase a category of goods from Amazon in your app or game: Your app is based on improving nutrition over time, offer health-related products like vitamins, supplements, etc. or the Kindle edition of The 4-Hour Body by Tim Ferriss from within your app

Bundle a purchase of a physical product from Amazon with digital content within your app: Sell a toy version of one of the characters in your game, then automatically enable them to play as that same character

Here’s how it works: a customer initiates a purchase from within your app and is then presented with a dialog box showing the product details and cost. The customer can then complete the purchase using Amazon’s 1-Click purchasing, and then the items will be shipped directly from Amazon to the customer’s doorstep. You’ll earn up to 6% of the total purchase, added to your app distribution earnings.

Alt12 is the developer of “Pink Pad” and “BabyBump”: “Our custom solution to sell physical products within our apps took us 6 months to develop, and required complex relationships with more than 20 vendors. With the Amazon Mobile Associates API, it took us only 3 days, and provided us a better in-app shopping experience for our customers, while allowing us to offer a greater selection of products.”

Days of Wonder integrated the API into their game “Ticket to Ride”: “Customers are now able to purchase a physical expansion pack of our board game and then are delighted to get the digital version now for free. We can do this through the digital bundling functionality provided by the Amazon Mobile Associates API.”

Integration is simple. Initilize the Mobile Associates API, and tell us what you’re selling--you can choose to supply a specific set of ASINs (Amazon Standard Identification Number), search terms, or use the Amazon Product Advertising API to query a list of ASINs and product information. Then, initiate the purchase. We’ll take care of the rest!

We’ve posted a Quick Start Guide, sample code, and documentation here—start earning more with the Amazon Mobile Associates API today!

 

Want to learn how to integrate the Amazon Mobile Associates API? Don’t miss out on our next live webinar event: 

Mobile Associates Program: What It Is And How It Can Boost Your App Profits
on September 17th, 2013 @ 10:00 AM.
Pre-register here!

 

July 31, 2013

Daniel Winner

On July 9th, the Amazon Apps UK team was very pleased to present at Develop Brighton, one the leading events for the burgeoning UK games community, attended by over 1,600 games industry professionals from CEO’s to Student developers.

On one of the hottest days of the year, Matt Hatherly from the UK Apps team and I enjoyed meeting so many games developers the Hilton Metropole, at the Hotel Du Vin and on Brighton’s famous beach.

During our presentation we took the opportunity to share insights on how to develop, market and monetize mobile games that use In App Purchasing. 

The theme of our talk was that Games publishing is evolving from an art to a science, as so much more data is now available. We shared a number of tips & insights on how to monetize Freemium games, including:

1.     The more time you can keep customers engaged the more money you’ll make.

  • If you create a purchasing hook early on in the game you will take advantage of customers who want to spend on day one
  • Give customers a reason to come back by providing lots of content, depth and regular updates – Customers that come back, come back time and again and carry on spending not only days but weeks after the first download

2.     Finessing your range, selection and pricing of IAP items and the way you communicate to customers makes a big difference to monetization.

  • The more IAP items you offer for sale, the more orders you will get
  • Games with tutorials monetize much better than those without
  • The way you merchandise IAP items also makes a big difference – if you merchandise IAP items like a catalogue (with tiles for each item) your app will monetize better

Thousands of UK based game developers have added their Apps to the Amazon Appstore, including hit Freemium titles from Developers including New Star Games (New Star Soccer), Endemic ( Plague), Stick Sports (Stick Sports Cricket), and we look forward to welcoming many more to the store. 

The UK team will be participating in more Developer events during the course of the year and we hope to connect with more of the UK Games community then.

 

April 23, 2013

derekgeb

Mad Menace Games is the creator of the popular game GraveStompers: Zombie vs Zombie. GraveStompers is a console-style 3rd person shooter with intuitive touch-screen controls in which zombie eradication has never been more exhilarating. One way Mad Menace monetizes their game is through the Amazon In-App Purchasing API to allow users to purchase Ghostface, the villain from the Scream movies. Since the game is built using the Unity game engine, Mad Menace Games uses the free Amazon In-App Purchasing API plug-in for Unity to support their monetization strategy. According to Michael Stragey, GraveStompers lead developer, the Unity plug-in made it extremely easy to accomplish this and release their game on Amazon. In this post, we look at the following 4 steps used by Mad Menace Games for supporting an entitlement in-app purchase in Unity:

  1. Setting up the Amazon In-App Purchasing Unity plug-in and test environment
  2. Launching the Amazon purchase flow
  3. Handling the result of the Amazon purchase flow
  4. Determining if the user previously purchased the entitlement

Step 1: Setting up the Amazon In-App Purchasing Unity plug-in and test environment

To start off, Mad Menace Games had to install and setup the Amazon In-App Purchasing Unity plug-in. To do this for your app, with your Android game open in Unity, you add the Amazon plug-in and support for In-App Purchasing to your environment by completing the following steps:

  1. Right click on Project Pane
  2. Select “Import Package/Custom Package…”
  3. Select the “AmazonIAP.unitypackage” that was downloaded as part of the Amazon Mobile App SDK and click “Open”
  4. From the import dialog click “Import” and this package will be added to your project
  5. Select the “Amazon” menu
  6. Click “Generate AndroidManifest.xml file”
     

There is only one more setup task now that the Unity environment has Amazon In-App Purchasing available and the application specifies this support in its manifest. As a developer, you need to set up your sandboxed test environment for running in-app purchasing transactions. This means you install the AmazonSDKTester.apk from the Amazon Mobile App SDK on your emulator or device and provide a JSON file detailing your IAP items. More details on setting up your test environment can be found here.

Step 2: Launching the Amazon purchase flow

With setup now complete, let’s take a look at the more exciting stuff. After installing the plug-in, Mad Menace Games added the code for supporting the sale of their character “Ghostface”. The first step is to add the code for launching the Amazon purchase flow UI when the user wants to buy the character. This can be easily done with the following code:

AmazonIAP.initiatePurchaseRequest("com.gravestompers.characters.ghostface");

The string “com.gravestompers.characters.ghostface” is the SKU of the Ghostface IAP item specified on the Mobile App Distribution Portal along with being defined in the JSON file for testing. These places are where you also specify things such as the type of in-app item (consumable, entitlement, or subscription), price, title, and description.

Step 3: Handling the result of the Amazon purchase flow

Now with the purchase flow being in place and the user actually able to make a purchase, code is required for handling the result of the purchase flow and providing the user with the actual Ghostface character. The response for this purchase flow will be returned via the AmazonIAPEventListener methods: purchaseFailedEvent and purchaseSuccessfulEvent. Below is an example of what Mad Menace Games’ code may look like for this.

void purchaseFailedEvent( string reason )

{

      // Log the reasons for failure

      Debug.Log( "purchaseFailedEvent: " + reason );

}

 

void purchaseSuccessfulEvent( AmazonReceipt receipt )

{

      // Store receipt and verify it is legitimate with Amazon Receipt Verification Server

      storeAndVerifyReceipt( receipt );

      if (receipt.sku == "com.gravestompers.characters.ghostface")

            unlockGhostfaceChacter();

}

As a best practice, we recommend validating the receipt you receive from a successful purchase via your server that stores these receipts. More information on validation of receipts can be found here.

Step 4: Determining if the user previously purchased the entitlement

After creating a fully functioning purchase experience, there was one final coding task Mad Menace Games had to complete. Once a user owns this character, they should be able to access the character if they uninstall and reinstall the app, clear their app data, or change from playing the app on their phone to playing it on their Kindle Fire HD. To help make life easier for developers, Amazon keeps track of these entitlement in-app purchases. As a developer, you can receive these purchases via the AmazonIAPEventListener’s purchaseUpdatesRequestSuccessfulEvent method. This method will be called anytime there are new entitlements the running app needs to process. Below is an example code snippet:

void purchaseUpdatesRequestSuccessfulEvent( List<string> revokedSkus, List<AmazonReceipt> receipts )

{

  // Process New Receipts

  foreach ( AmazonReceipt receipt in receipts )

  {

   // Store receipt and verify it is legitimate with Amazon Receipt Verification Server

      storeAndVerifyReceipt( receipt );

      if (receipt.sku == "com.gravestompers.characters.ghostface")

        unlockGhostfaceChacter();

  }

}

That is all it took for Mad Menace Games to add Amazon In-App Purchasing support to their GraveStompers Unity game. You can find more information on Amazon In-App Purchasing and the Unity plug-in here.

Want the latest?

appstore topics

Recent Posts

Archive