Plugin to implement APNS push notifications on iOS and Firebase on Android.
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.
- Add
flutter_apns
as a dependency in your pubspec.yaml file. - Using
createPushConnector()
method, configure push service according to your needs.PushConnector
closely resemblesFirebaseMessaging
, 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.