fyno_flutter
A Dart package for communication with native platform code through method channels in Flutter applications developed by Fyno.
Installation
Add the following to your pubspec.yaml
file:
For latest version of the package, refer fyno_flutter
dependencies:
fyno_flutter: <latest_version>
Then run:
dart pub get
Usage
Import the package in your Dart file:
import 'package:fyno_flutter/fyno_flutter.dart';
Initialization
Exception? initResult = FynoFlutter.init(
"your_workspace_id",
"your_token",
"your_user_id",
"your_version",
);
if (initResult == null) {
// Initialization successful
} else {
// Handle initialization error
print("Initialization error: $initResult");
}
Identifying the User
Exception? identifyResult = FynoFlutter.identify("your_user_id");
if (identifyResult == null) {
// User identification successful
} else {
// Handle identification error
print("Identification error: $identifyResult");
}
Registering Push Notifications with Xiaomi Services
Exception? pushRegistrationResult = FynoFlutter.registerPush(
"xiaomi_application_id",
"xiaomi_application_key",
"push_region",
"integration_id",
);
if (pushRegistrationResult == null) {
// Push registration successful
} else {
// Handle push registration error
print("Push registration error: $pushRegistrationResult");
}
Registering Push Notifications with Firebase Cloud Messaging (FCM)
Exception? fcmPushRegistrationResult =
FynoFlutter.registerFCMPush("integration_id");
if (fcmPushRegistrationResult == null) {
// FCM push registration successful
} else {
// Handle FCM push registration error
print("FCM push registration error: $fcmPushRegistrationResult");
}
Merging User Profiles
Exception? mergeResult = FynoFlutter.mergeProfile(
"old_distinct_id",
"new_distinct_id",
);
if (mergeResult == null) {
// User profile merge successful
} else {
// Handle user profile merge error
print("User profile merge error: $mergeResult");
}
Updating Message Status
Exception? updateStatusResult = FynoFlutter.updateStatus(
"callback_url",
"status",
);
if (updateStatusResult == null) {
// User status update successful
} else {
// Handle user status update error
print("User status update error: $updateStatusResult");
}
Resetting User Information
Exception? resetUserResult = FynoFlutter.resetUser();
if (resetUserResult == null) {
// User information reset successful
} else {
// Handle user information reset error
print("User information reset error: $resetUserResult");
}
License
This project is licensed under the 3-Clause BSD License - see the LICENSE file for details.