secrethero_flutter

Last updated:

0 purchases

secrethero_flutter Image
secrethero_flutter Images
Add to Cart

Description:

secrethero flutter

Secret Hero Setup #
Description #
Secret Hero is a sdk designed to add gaming functionalities into your application. This SDK empowers developers to integrate engaging gameplay experiences, including leaderboard tracking and coupon rewards, enhancing user engagement and retention within your app.
Installation #
To integrate the SecretHero library into your project, add the following dependency as follows;
With Flutter:
$ flutter pub add secrethero_flutter
copied to clipboard
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependencies:
secrethero_flutter: "latest_version"
copied to clipboard
Setup #
Initialize Secret Hero #


The initialize function within the SecretHero SDK is responsible for initializing the SDK with specific configuration settings and an listener to handle events and callbacks.


The SecretHeroConfig class is responsible for the configuration initializing the SecretHero SDK.


SecretHero().initialize(secretHeroConfig, secretHeroListener)
copied to clipboard
SecretHeroConfig(
token: "your_token",
userId: "user_id",
displayName: "display_name",
theme: SecretHeroTheme(
primaryColor: "#191D21",
secondaryColor: "#FFFFFF",
highlightColor: "#7B61FF",
buttonColor: "#92FFD7",
));

SecretHero.initialize(config: config, delegate: self)
copied to clipboard

token: A token required for authentication and interaction with the SecretHero SDK.
userId: Represents the user ID associated with the SecretHero session.
displayName: An display name for the user within the SecretHero environment.
theme: SecretHeroTheme class encapsulates various visual attributes, allowing customization of the platform's appearance


The SecretHeroEventListener delegate serves as a callback mechanism within the SecretHero SDK, providing methods to handle various events and responses during the SDK's lifecycle and operations.

final secretHeroListener = SecretHeroEventListener(
onInitialized: () {
print("onInitialized");
},
onInitializeFailed: (errorMessage) {
print("onInitializeFailed $errorMessage");
},
onOpen: () {
print("onOpen");
},
onClose: () {
print("onClose");
},
onEvent: (event) {
print("onEvent $event");
});
copied to clipboard

onInitialized(): Invoked when the SecretHero SDK is successfully initialized.
onInitializeFailed(errorMessage: String) : Triggered upon initialization failure in the SecretHero SDK
onClose() : Called when the SecretHero session is closed or terminated
onOpen() : Executed when the SecretHero session is opened or activated
onEvent() : Executed when the SecretHeroEvent is accrued


The release() function within the SecretHero serves the purpose of releasing and resetting configuration and listeners associated with the SecretHero. Need to be called onDestroy

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.