Plugin to implement APNS push notifications on iOS and Firebase on Android.
Why this plugin was made?
Currently, the only available push notification plugin is
firebase_messaging. This means that, even on iOS, you will need to setup firebase and communicate with Google to send push notification. This plugin solves the problem by providing native APNS implementation while leaving configured Firebase for Android.
- Configure firebase on Android according to instructions: https://pub.dartlang.org/packages/firebase_messaging.
- On iOS, make sure you have correctly configured your app to support push notifications, and that you have generated certificate/token for sending pushes.
flutter_apnsas a dependency in your pubspec.yaml file.
createPushConnector()method, configure push service according to your needs.
FirebaseMessaging, so Firebase samples may be useful during implementation.
import 'package:flutter_apns/apns.dart'; final connector = createPushConnector(); connector.configure( onLaunch: _onLaunch, onResume: _onResume, onMessage: _onMessage, ); connector.requestNotificationPermissions()
- Build on device and test your solution using Firebase Console and NWPusher app.