Using OneSignal with Flutter Using OneSignal with Flutter flutter flutter

Using OneSignal with Flutter


EDIT:

There is an official plugin now for OneSignalhttps://github.com/OneSignal/OneSignal-Flutter-SDK


Unfortunately, there is no plugin for flutter to use OneSignal. You can write one yourself, though.

Since OneSignal exists for iOS and Android, what you have to do is write a communication between flutter and respective platforms.

If you decide to just implement the features for yourself, even pure platform channels can be viable.

Flutter plugin is just a wrapper to extract usage of platform channel that are platform dependent into a library.

IF you are using IntelliJ, after starting with plugin template on new project, in Tools -> Flutter you have an option to open the native iOS/Android code in Xcode/Android Studio. That should help to start things up.

open in


There is an official Flutter package!

Add it as a dependency to your pubspec.yaml file:

dependencies:  onesignal_flutter: ^2.6.2  # Verify that this is the latest version

Full setup instructions can be found here.