Client
.NET/Unity C++/Unreal/Cocos2d-x JavaScript/Cocos2d-js Godot 3 Godot 4 Java/Android Defold cURL REST Swift Dart/Flutter
Server
TypeScript Go Lua
Unlockables Read more about the Unlockables system in Hiro here .
Create a random unlockable
# Create a random unlockable to assign to a slot (or overflow) unless there are no slots.
1
2
const unlockablesList = await hiroClient . unlockablesCreate ( session );
console . log ( unlockablesList );
Get in progress unlockables
# Get the unlockables which are currently in progress for the player.
1
2
const unlockablesList = await hiroClient . unlockablesGet ( session , request );
console . log ( unlockablesList );
Start an unlock
# Start the unlock timer for an unlockable in the specified slot.
1
2
3
4
5
const request = new UnlockablesRequest ();
request . instance_id = "unlockable_instance_1" ;
const unlockablesList = await hiroClient . unlockablesUnlockStart ( session , request );
console . log ( unlockablesList );
Purchase an unlockable
# Purchase an unlockable with soft currency based on the remainder cost calculated by the offset left to wait.
1
2
3
4
5
const request = new UnlockablesRequest ();
request . instance_id = "unlockable_instance_1" ;
const unlockablesList = await hiroClient . unlockablesPurchaseUnlock ( session , request );
console . log ( unlockablesList );
Purchase a new unlockable slot
# Purchase a new slot to be used to store unlockables.
1
2
const unlockablesList = await hiroClient . unlockablesPurchaseSlot ( session );
console . log ( unlockablesList );
Claim an unlockable
# Claim an unlockable whose start timer has completed or completion was fast tracked with a purchase.
1
2
3
4
5
const request = new UnlockablesRequest ();
request . instance_id = "unlockable_instance_1" ;
const unlockablesList = await hiroClient . unlockablesClaim ( session , request );
console . log ( unlockablesList );