Flutter Plugin Integration

Supports iOS, Android

Note:

iOS Simulator can neither subscribe to nor receive push notifications.
Android Emulator works fine though.

Plugin source
Sample
Plugin API Docs
Geozones Plugin API Docs
Message Inbox Plugin API Docs

Prerequisites

1. Create an app on Firebase Cloud Messaging Console. You may use this guide for reference (section Manually add Firebase).

2. Get iOS push certificates by following steps 2.1. to 2.3. of Native iOS Integration guide.

3. Configure the App in Pushwoosh Control Panel. Please follow Android configuration guide for Andriod and Step 2.4. of iOS Integration guide for iOS.

Enable push notifications in your project

First, you need to add the pushwoosh package to your project:

1. Add a dependency to your pubspec.yaml file:

dependencies:
  pushwoosh: ^1.8.0

2. Install the package from the command line:

$ flutter packages get

3. Import the package in your dart code

import 'package:pushwoosh/pushwoosh.dart';

Second, place the google-services.json file into android/app folder in your project directory.

google-services.json

You should've gotten the google-services.json file while creating the app in Firebase console. If you haven't, please consult this thread (section Get a config file for your Android app).

Third, initialize the plugin:

Pushwoosh.initialize({"app_id": "YOUR_APP_ID", "sender_id": "FCM_SENDER_ID"});

To register for push notifications, call the following method:

Pushwoosh.getInstance.registerForPushNotifications();

To process various events, use the corresponding listeners as follows.
Push receipt:

Pushwoosh.getInstance.onPushReceived.listen((event) {
...
});

Push open:

Pushwoosh.getInstance.onPushAccepted.listen((event) {
...
});

All done!

Plugin API

To find more details on using the plugin, please see Plugin API Docs.