paygilant_plugin 4.2.10
paygilant_plugin: ^4.2.10 copied to clipboard
Paygilant Plugin exposes a dart interface, which wraps the native SDK, and enables a smooth integration with the Flutter development environment.
paygilant_plugin #
Paygilant Plugin exposes a dart interface, which wraps the native SDK, and enables a smooth integration with the Flutter development environment. The application executes within plugins targeted to each supported platform (Android or iOS), and relies on standards-compliant API bindings to access the framework’s capabilities.
Getting Started #
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, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Installation #
flutter pub add paygilant_plugin
There are no Podfile, Gradle or Package changes to make, and you do not add the Paygilant SDK yourself: the plugin brings the native SDK with it, and its version is the one that ships with the plugin release.
On iOS, add the Access WiFi Information capability to your app target and App ID, and declare the permissions you
ask for in Info.plist.
How the iOS SDK is installed #
The CocoaPods trunk stops accepting new pod versions on 2026-12-02, so the plugin no longer depends on the trunk
PaygilantSDK pod. Which path is used depends on your Flutter configuration:
| Flutter iOS setup | iOS SDK comes from |
|---|---|
Swift Package Manager enabled (flutter config --enable-swift-package-manager, Flutter 3.24+) |
Swift Package Manager: the plugin's ios/paygilant_plugin/Package.swift depends on PaygilantSDK-SPM at the exact SDK version |
| CocoaPods (default) | The plugin's podspec downloads the prebuilt PaygilantSDK.xcframework of the same version from the PaygilantSDK-SPM release, verifies its SHA-256 checksum and vendors it during pod install |
Practical consequences:
- The first iOS build needs access to GitHub (
pod installor SwiftPM fetches the SDK from there). - Do not add your own
PaygilantSDKpod or Swift package to the app: it would conflict with the one the plugin brings. - The minimum iOS version is 12.0 on both paths.
Usage #
import 'package:paygilant_plugin/paygilant_plugin.dart';
Future<void> startPaygilant() async {
// 1. Initialize once at app start with the server URL Paygilant gave you.
try {
await PaygilantPlugin.init('https://YOUR_PAYGILANT_SERVER_URL', toAskPermissions: true);
} catch (e) {
final message = e.toString();
final policyNotApproved = message.contains('SET_APPROVE_POLICY_TO_TRUE') ||
message.contains('setApprovePolicy method to true'); // Android / iOS
if (!policyNotApproved) {
// A real failure (for example no connection to the server): handle it in your app.
return;
}
// 2. The privacy policy was not accepted yet, so nothing was sent. Show your own policy UI and, once the
// user accepts, approve it. The session starts then; there is no need to call init again.
final accepted = await showYourPrivacyPolicyDialog(); // your own UI
if (!accepted) return;
await PaygilantPlugin.setApprovePolicy(true);
}
// 3. Session ID for your backend calls.
final sessionId = await PaygilantPlugin.getSessionId;
}
You can also call setApprovePolicy(true) before init if your app already has the user's consent.
Other methods: setClientSessionId, askPaygilantPermissions, startUserVerification, and logout (use
setClientSessionId when you manage your own client session IDs).
Updating #
flutter pub upgrade paygilant_plugin # or change the version in pubspec.yaml, then `flutter pub get`
If the iOS build still uses the old SDK, run flutter clean (and, for CocoaPods, delete ios/Podfile.lock and
ios/Pods, then pod install).