Advanced

Advanced features of our SDK:

Connect Wallet - Native

The code samples below trigger a wallet connection silently. No UI displays to the user. Your application is responsible for rendering the progress dialog, and for handling errors and allowing the user to cancel the app connect operation.

// Start connect flow
OVSdk.Sdk.AppConnectManager.ConnectWallet("in-game-user-id");

// Cancel currently active connect flow
OVSdk.Sdk.AppConnectManager.CancelConnect();

Load Balance allows Developer's to deeplink users directly into Vessel and prompt a coin purchase. Developers will use this feature under the circumstance they want a user to purchase an NFT but they do not have the sufficient amount of coins to do so:

// Deeplink to balance page
OVSdk.Sdk.WalletPresenter.LoadBalanceInWalletApplication(<wallet address>);

// Deeplink to balance page and prompt a specific purchase amount (i.e. - 70 coins)
OVSdk.Sdk.WalletPresenter.LoadBalanceInWalletApplication(<wallet address>, <coinamount>);

Verify Wallet Address in Vessel Application

Verify wallet address method lets you verify if the wallet address of the user is equal to the one, that he logged with, in the Vessel application. Note, that this method will redirect the user directly to the Vessel application after calling it, or advising him to install Vessel Wallet instead.

OVSdk.Sdk.WalletPresenter.VerifyWalletAddressInWalletApplication("wallet address");

Disconnect a Wallet

Utilizing the following method disconnects a User's concurrently connected wallet and wipes the Vessel SDK state:

OVSdk.Sdk.AppConnectManager.DisconnectCurrentSession();

Setup custom Load Balance logic

After pressing Load Balance button into your Profile page of your Vessel account in custom tab, Vessel SDK checks if custom presenter was used and overrided method could include your own screen to show available IAP products:

OVSdk.CustomPresenter.LoadBalancePresenter = ShowLoadBalance;

private void ShowLoadBalance()
{
    // ...
}

Set callback methods for handling IAP transactions

In order to follow the state of purchase, please use the next interface methods:

OVSdk.Sdk.IapManager.PurchaseProduct();

OVSdk.IapManagerCallbacks.OnPurchaseSuccess += PurchaseSuccess;
OVSdk.IapManagerCallbacks.OnPurchaseCancel += PurchaseCancelled; 
OVSdk.IapManagerCallbacks.OnPurchaseFailure += PurchaseFailed; 

public void PurchaseSuccess(OVSdk.SuccessfulPurchase successfulPurchase)
{
    // ...
}
public void PurchaseCancelled(OVSdk.CancelledPurchase cancelledPurchase)
{
    // ...
}
public void PurchaseFailed(OVSdk.FailedPurchase failedPurchase)
{
    // ...
}

Last updated