Skip to Content

Install

pub.dev

flutter pub add onesygnal

This is a Flutter plugin, not a pure-Dart package — it ships native Android (Kotlin) and iOS (Swift) code alongside the Dart API, and flutter pub get pulls both in automatically. There’s nothing to add to pubspec.yaml beyond the dependency itself.

Native-side setup

None required for the API key. The natives normally read the key from AndroidManifest.xml (<meta-data>) / Info.plist, and also expose a setApiKey() override — on Flutter, setApiKey() is the only way to configure it; there’s no manifest/plist entry to add. Confirmed by the SDK’s own example app, which ships with no API-key entries in either AndroidManifest.xml or Info.plist and sets the key purely in Dart:

await OneSygnal().setApiKey('YOUR_API_KEY');

Beyond that, no AndroidManifest.xml or Info.plist changes are needed to use the SDK — the native plugin registers itself through Flutter’s normal plugin-registration mechanism (GeneratedPluginRegistrant), and surveys render as a native window overlay that doesn’t require an Activity/ViewController handoff from your app.

Platform floors

See the SDK overview for the exact Dart/Flutter/Android/iOS version floors this plugin requires.