This is an implementation of the HAPTIK's SDK library in Flutter.
Installation of SDK
To Integrate Haptik SDK, you must obtain the following credentials to get started:
- Client ID/Account ID (Required): Unique Haptik identification number associated with your account.
- Business ID (Required): Unique business identification number.
- Base URL (Required): Link pointing to specific server environment (Different for Staging and Production)
- Auth Type: authentication type to be used for user registration. Required only for custom signup.
- Auth ID:authentication type to be used for user registration. Required only for custom signup.
Add Haptik SDK in your flutter project
Depend on it
Run this command with flutter:
flutter pub add haptik_sdk
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
Setting up credentials and environment for Flutter plugin
The Haptik SDK will take in the required credentials in your flutter project through the android part. You'll have to add to in the strings.xml folder which resides in the following path: android/app/main/res/values If you don't have strings.xml in values folder, then you can even add the file yourself In strings.xml :
How to publish this flutter plugin
All flutter plugins can be published to pub.dev. Inside your flutter plugin file, run the following commands in the terminal: To check if the package is ready to be published:
flutter pub publish --dry-run
If all the checks are passed, run this command to publish the plugin to pub.dev:
flutter pub publish
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.