View on GitHub

meta-android-sdk

Render Metaverse Experiences in your own apps

MetaverseSDK / io.gometa.sdk / Meta

Meta

object Meta

The primary entry point to the Metaverse SDK.

To start a storyboard, it is recommended that you first identify the user. This can be done via a unique identifier available to the host app such as the user’s ID, or any other unique stirng passed to Meta.identify. Alternatively, you may chose for the SDK to identify the user via a local unique string which identifies this app instance (this is done by passing null to Meta.identify).

Next, get an intent for a storyboard by calling Meta.getStoryboardIntent and start it via either Context.startActivity, Activity.startActivity, or Activity.startActivityForResult. If started for result, the returned resultCode may be either Activity.RESULT_CANCELED or Activity.RESULT_OK. Additionally, the data field will contain an intent with the following extras:

Types

CloseReason object CloseReason
The various reasons a storyboard’s activity might finish. These are the possible values that may be returned via the Meta.StoryboardResult.CLOSE_REASON key.
StoryboardResult object StoryboardResult
The various keys returned by the storyboard activity’s data Intent.

Functions

getAndClearInventoryDirtyFlag fun getAndClearInventoryDirtyFlag(): Boolean
getInventoryDirtyFlag fun getInventoryDirtyFlag(): Boolean
getStoryboardIntent fun getStoryboardIntent(context: Context, storyboardId: String): Intent
Creates an intent for the storyboard activity for the given storyboard ID.
identify fun identify(userId: String? = null): Unit
Identifies the user in the scope of the provided API key.
initialize fun initialize(context: Context, apiKey: String?): Unit
Initialize the SDK. This method is automatically called when rendering a storyboard, but may be called manually by the host app prior for the purpose of making other API calls such as loadStoryboardSummary.
loadStoryboardSummary fun loadStoryboardSummary(storyboardId: String): LiveData<Result<StoryboardSummary>>
Load the StoryboardSummary for a given storyboard ID. Note that the SDK performs no, caching. It is up the the host app to cache and re-use any data they’d like.