Step 6 - Using Store Flow

Overview

The purpose of this guide is for game makers to setup a complete store experience using Beamable.

Here is everything needed to use the Store Flow Feature PrefabFeature Prefab - The drag-and-drop template for a specific Beamable product feature in the "Beamable SDK for Unity". Or watch this video.

Video Series

Part 1 & 2

Part 3

Game Maker User Experience

During development, the game maker's user experience is as follows. There are 3 major parts to StoreStore - A collection of Beamable store listings setup process.

Steps

Follow these steps to get started.

Note: The game maker is to choose either Step 1a or Step 1b. Not both.

Step 1a. Setup Unity IAP

This step assumes a dependency on Unity's UnityIAP solution. There is little or no custom code required for this solution.

A benefit here is fast development.

Step

Detail

  1. Open the Unity Services Window

• Unity → Window → General → Services

  1. Activate the Unity "IAP" Service



• Click the "On" button

Note: After this step, continue per Step 2

Step 1b. Setup Custom IAP

This step assumes no dependency on Unity's UnityIAP solution. There is significant custom code required for this solution.

A benefit here is flexible development.

Steps

Detail

  1. Setup Custom IAP

• See Adding Custom Purchaser for more info

Note: After this step, continue per Step 2

Step 2. Setup Platform

The following assumes a cross-platform mobile project. Adjust the steps according to the specific target platforms as desired.

Step

Detail

  1. Setup IAP for Apple

Choose exactly one of the following solutions

  1. Setup IAP for Apple - developer.apple.com/iap
  2. Setup IAP for Android - learn.buildfire.com/iap
  3. Setup IAP for Steamworks - Integrating Steamworks

🚧

Gotchas

Here are hints to help explain some of the trickier concepts.

• These platform-specific instructions are subject to change because platform development is rapid.
• App Store SKU’s must be properly setup in the App Store(s) before the system will allow the player to complete a Hard CurrencyHard Currency - A currency type rewarded to the player through IAP transactions of real-world money. (Ex. Gems) purchase.

Step 3. Setup Beamable Content

For simplicity, some Beamable data structures may be omitted from this diagram.

For the setup, objects of types StoreStore - A collection of Beamable store listings , ListingListing - A collection of Beamable store items, ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. , and SKUSKU - A Stock Keeping Unit is a unique indicator of a Beamable store item in an platform App Store are needed. In the following steps, one of each type of object is created.

Note: An ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. is a resource archetype, meaning one can be represented in multiple ListingListing - A collection of Beamable store itemss by using a Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values an associated script. See Multiple Listings With Same Item below for more info.

To ease the process, the objects are created in reverse order; starting with the lowest-level concept: SKUSKU - A Stock Keeping Unit is a unique indicator of a Beamable store item in an platform App Store.

Step

Detail

  1. Open the Content Manager

• Unity → Window → Beamable → Open Content Manager

  1. Create the "SKU" content



• Select the content type in the list
• Press the "Create" button
• Populate the content name

  1. Configure the "SKU"



• Populate all fields

  1. Create & Configure the "Item" content



• Select the content type in the list
• Press the "Create" button
• Populate the required fields

6. Create & Configure the "Listing" content



• Select the content type in the list
• Press the "Create" button
• Populate the required fields

Note: Populating optional field too? See Advanced Listings below for more info

  1. Create & Configure the "Store" content



• Select the content type in the list
• Press the "Create" button
• Populate the content name

  1. Select the "Shop Configuration"



• Unity → Window → Beamable → Open Toolbox
• Click the "Config" Button

  1. Open the "Shop" Configuration



• Populate all fields

Note: See Configuration of Item Renderers below for more info

  1. Save the Unity Project

• Unity → File → Save Project


Best Practice: If you are working on a team, commit to version control in this step

  1. Publish the content

• Press the "Publish" button in the Content Manager Window

Step 4a. Setup Beamable UI

Note: The game maker is to choose either Step 4a or Step 4b. Not both.

A benefit here is fast development.

Step

Detail

  1. Add the "Store Flow" Prefab

• See Store Flow for more info

Step 4b. Setup Custom UI

A benefit here is flexible development.

Step

Detail

  1. Add the custom store via C#

• See Adding Custom Store for more info

Advanced

This section contains any advanced configuration options and workflows.

Advanced Listings

The required fields are populated in the Create & Configure the "Listing" content step above.

Here are optional, advanced fields for greater ListingListing - A collection of Beamable store items customization.

Name

Detail

Purchase Limit

• Restrict the total lifetime purchase quantity per-player

Player Stat Requirement

• Restrict the listing to only players with a specific stat value

Example: Available only to players with Strength above 10

Offer Requirement

• Restrict the listing to only players who have purchased another listing

Example: The "Arrows" are available only to players who purchased the "Bow"

Client Data

• Add arbitrary name/value pairs to be sent along with the listing. For advanced use cases

Button Text

• Additional flavor-text

Example: "Buy Today!"

Scheduled Offers

Beamable allows you the ability to schedule particular offers in a store to be available to players starting at a particular date and ending on another date. For example, players will only see a Christmas special offer only during the week of Christmas.” Pairing this to the previously mentioned “SET TIME” cheat and you can be sure that what will be delivered to players is what you’d expect.

The required fields are populated in the Create & Configure the "Listing" content step above.

Here are optional, advanced fields to setup Scheduled Offers for a ListingListing - A collection of Beamable store items.

Name

Detail

Active Period

• Restrict the listing to only after a start date
• Optionally, also give an end date

Limited Time Offers

These are very similar to Scheduled Offers but these are player specific. For example, when a player first sees an offer, that player has N minutes to purchase before the offer is no longer available. This creates a sense of urgency to make sure to “get it before it’s too late!”

The required fields are populated in the Create & Configure the "Listing" content step above.

Here are optional, advanced fields to setup Limited Time Offers for a ListingListing - A collection of Beamable store items.

Name

Detail

Active Duration Seconds

• Restrict the listing to only a limited time-frame after the player sees the listing in the store

Example: "Available for 24 hours from... now."

Active Duration Cool Down Seconds

• This requires "Active Duration Seconds"
• To create Recurring Offers, specify this “cooldown” which defines the period until the offer becomes active again

Example: "Available for 24 hours from... now. After that, available again in 72 hours."

Active Duration Purchase Limit

• This requires "Active Duration Seconds"
• Restrict the purchase quantity per-player per-active-duration

Example: "Available for 24 hours from... now. Maximum 3 purchases allowed."

Multiple Listings With Same Item

An ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. can be singularly represented with an icon as shown above. For example, the data can represent exactly one "Hat".

However an ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. can also be re-instanced multiple times for use in the same game project. For example, the data can represent a category of "Hats" with specific sub-types like "Normal Hat", "Magic Hat", and "Stylish Hat".

A Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values allows for reuse of one Item archetype rather than create new ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each.s for each ListingListing - A collection of Beamable store items. The Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values may define the name, behavior, icon, and more for each instance of the defined ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. archetype.

To create one ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. and for use in multiple ListingListing - A collection of Beamable store itemss follow the steps below.

Step

Detail

  1. Create the Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values class file

• Create a new C# file
• Copy from MyCustomHatLookupTable.cs shown below

Note: This class derives from Unity's ScriptableObject

  1. Create the Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values asset file

• Unity → Asset → Create

  1. Configure the Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values asset file



• Populate all fields

Code

📘

Beamable SDK Examples

This and all examples are available for download at GitHub.com/Beamable_SDK_Examples

Here is the code for step #1 above. It is presented as inspiration, however the actual code needed will vary per the specific needs of the project.

using UnityEngine;
using Beamable;
using Beamable.Common;

namespace Beamable.Examples.Features.StoreFlow
{

  [System.Serializable]
  public struct HatLookupEntry
  {
    public string Name;
    public HatBehaviour Hat;
    public Sprite PreviewSprite;
  }
  
  [CreateAssetMenu(
    fileName = "MyCustomHatLookupTable", 
    menuName = "Beamable/Examples/Features/MyCustomHatLookupTable", 
    order = 0)]
  
  public class MyCustomHatLookupTable : ScriptableObject
  {
    public List<HatLookupEntry> Hats;

    public HatBehaviour GetHatPrefab(string name) => GetHatEntry(name).Hat;

    public HatLookupEntry GetHatEntry(string name) =>
      Hats.FirstOrDefault(entry => 
                          entry.Name.Equals(name,
                          StringComparison.CurrentCultureIgnoreCase));
  }
}

Configuration of Item Renderers

The ShopConfiguration asset file contains references for these renderers.

  • ListingRenderer - This determines the rendering of each ListingListing - A collection of Beamable store items UI within the overall StoreStore - A collection of Beamable store listings UI. The default value is BasicListingRenderer.
  • ObtainRenderer - This determines the rendering of each ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. UI within the overall ListingListing - A collection of Beamable store items UI. The default value is ObtainSummaryListRenderer.
The "Shop" within the Beamable Configuration ManagerThe "Shop" within the Beamable Configuration Manager

The "Shop" within the Beamable Configuration Manager

The defaults are provided automatically for basic functionality. Override as needed for advanced use cases. The default object's source code is viewable and serves as the starting points for creating custom overrides.


Did this page help you?