-
Notifications
You must be signed in to change notification settings - Fork 5
Connection
Mansour edited this page Aug 3, 2021
·
2 revisions
In order to work with Poolakey, You need to construct an instance of Payment class:
private Payment payment;SecurityCheck securityCheck = SecurityCheck.Enable("PUBLIC RSA KEY OF YOUR APP");
PaymentConfiguration paymentConfiguration = new PaymentConfiguration(securityCheck);
payment = new Payment(paymentConfiguration);You can also disable local security checks, only if you're using Bazaar's REST API by passing SecurityCheck.Disable object in PaymentConfiguration class.
SecurityCheck securityCheck = SecurityCheck.Disable();You need to connect to the in-app billing service via connect function in Payment class.
Poolaky unity SDK provides two method types for all API implementations :
- Async
- Callback
Using async :
var result = await payment.Connect();
Debug.Log($"{result.message}, {result.stackTrace}");
if (result.status == Status.Success)
{
// Do something ...
}Using callback :
_ = payment.Connect(OnPaymentConnect);
void OnPaymentConnect(Result result)
{
if (result.status == Status.Success)
{
// Do something ...
}
}You have to disconnect from the Poolakey when your game gets destroyed.
void OnApplicationQuit()
{
payment.Disconnect();
}Third Step: Get SKU-Details

