Sequence Wallet
In order to gain access to the SequenceAPI be sure to #include "Sequence/SequenceAPI.h"
After you've completed initial authentication and have intercepted the credentials either through your UI or ours, to use the Sequence API you'll need to create a [USequenceWallet*]
by using:
/*
Automatically tries to read stored credentials on disk and initialize with them
if none are found returns a TOptional<USequenceWallet*> Pointer without any set Credentials
*/
const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
if (WalletOptional.IsSet() && WalletOptional.GetValue())
{
USequenceWallet * Wallet = WalletOptional.GetValue();
//Use here
}
or
/*
returns a TOptional<USequenceWallet*> Pointer set with the
given Credentials
*/
const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get(Credentials);
if (WalletOptional.IsSet() && WalletOptional.GetValue())
{
USequenceWallet * Wallet = WalletOptional.GetValue();
//Use here
}
or
/*
returns a TOptional<USequenceWallet*> Pointer set with the
given Credentials & ProviderUrl
*/
const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get(Credentials,"ProviderUrl");
if (WalletOptional.IsSet() && WalletOptional.GetValue())
{
USequenceWallet * Wallet = WalletOptional.GetValue();
//Use here
}
Once you have your [USequenceWallet]
you can feel free to call any of the functions Supplied by the object, as the register call is now automatically done for you.
USequenceWallet, Static Access & Persistence
USequenceWallet
is now a Subsystem of GameInstance
, what this means is not only can you access it from anywhere as if it was a static variable in your C++ code. But it also persists for the lifetime of your game. That is no data is reset when a level is changed in your games!