Skip to content

WinkMeter/flutter-apns

 
 

Repository files navigation

apns

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.

Usage

  1. Configure firebase on Android according to instructions: https://pub.dartlang.org/packages/firebase_messaging.
  2. On iOS, make sure you have correctly configured your app to support push notifications, and that you have generated certificate/token for sending pushes.
  3. Add flutter_apns as a dependency in your pubspec.yaml file.
  4. Using createPushConnector() method, configure push service according to your needs. PushConnector closely resembles 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()
  1. Build on device and test your solution using Firebase Console and NWPusher app.

About

Flutter Plugin for Push notification servers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 34.2%
  • Dart 33.1%
  • Ruby 23.4%
  • Java 9.3%