snipe_sdk_flutter

Creator: coderz1093

Last updated:

0 purchases

snipe_sdk_flutter Image
snipe_sdk_flutter Images

Languages

Categories

Add to Cart

Description:

snipe sdk flutter

SnipeSDK Documentation #
Introduction #
Welcome to the SnipeSDK documentation! The SnipeSDK is a Dart library that provides a convenient way to interact with the Snipe API for token management, event tracking, and other related functionalities. This documentation will guide you through the setup, available methods, and usage examples of the SnipeSDK.
Getting Started #
Installation #
To use the SnipeSDK in your Dart project, add the following dependency to your pubspec.yaml file:
dependencies:
snipe_sdk_flutter: ^0.0.1
copied to clipboard
Then, run:
flutter pub get
copied to clipboard
Or:
flutter pub add snipe_sdk_flutter
copied to clipboard
Initialization #
Before using the SnipeSDK, you need to initialize it with your API key using the init method:
import 'package:snipesdk/snipesdk.dart';

void main() {
SnipeSdk snipeSdk = SnipeSdk();
snipeSdk.init("your_api_key_here");
}
copied to clipboard
Methods #
1. signUp(String hash) #
This method allows you to sign up a user with a given hash.
try {
String output = await snipeSdk.signUp("user_hash");
print("Sign up response: $output");
} catch (error) {
print("Error: $error");
}
copied to clipboard
2. trackEvent(...) #
This method allows you to track an event with various parameters such as eventId, snipeId, transactionAmount, partialPercentage, and debitTokens.
try {
dynamic response = await snipeSdk.trackEvent(
eventId: "event_id",
snipeId: "user_snipe_id",
transactionAmount: 100,
partialPercentage: 50,
debitTokens: [{"token_id": "token1", "value": 20}],
);
print("Track event response: $response");
} catch (error) {
print("Error: $error");
}
copied to clipboard
3. getTokenHistory(String snipeId) #
This method retrieves the token history for a specific user.
try {
dynamic response = await snipeSdk.getTokenHistory("user_snipe_id");
print("Token history response: $response");
} catch (error) {
print("Error: $error");
}
copied to clipboard
4. getTokenDetails(String snipeId) #
This method retrieves details of all tokens associated with a specific user.
try {
dynamic response = await snipeSdk.getTokenDetails("user_snipe_id");
print("Token details response: $response");
} catch (error) {
print("Error: $error");
}
copied to clipboard
5. getCoinData(String snipeId) #
This method retrieves coin data for a specific user.
try {
dynamic response = await snipeSdk.getCoinData("user_snipe_id");
print("Coin data response: $response");
} catch (error) {
print("Error: $error");
}
copied to clipboard
6. getStreaks(String snipeId) #
This method retrieves streaks for a specific user.
try {
dynamic response = await snipeSdk.getStreaks("user_snipe_id");
print("Streaks response: $response");
} catch (error) {
print("Error: $error");
}
copied to clipboard
Conclusion #
Congratulations! You've successfully integrated the SnipeSDK into your Dart project. This documentation should serve as a helpful guide for utilizing the available methods and understanding their parameters. If you encounter any issues or have further questions, feel free to reach out to the Snipe support team. Happy coding!

License

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

Files In This Product:

Customer Reviews

There are no reviews.