Aus öffentlichen Paketdaten erstellte Orientierung.
Ein Flutter-Plugin zur Verarbeitung von VoIP-Push-Benachrichtigungen, der derzeit iOS 8.0 und höher unterstützt. Es ermöglicht Echtzeit-Kommunikations-Apps, Benachrichtigungen auch dann zu erhalten, wenn die App beendet ist, wodurch eine zuverlässige Anrufverbindung gewährleistet wird. Das Paket integriert sich in den Apple Push Notification Service (APNs), um stille VoIP-Benachrichtigungen zu übermitteln, sodass die App im Hintergrund aktiviert werden kann, um eingehende Anrufe zu empfangen. Speziell für Voice-over-IP-Anwendungen wie VoIP-Anrufe oder Messaging-Plattformen entwickelt, die eine sofortige Benachrichtigungslieferung erfordern. Funktioniert nahtlos innerhalb des Flutter-Ekosystems mit minimaler Einrichtung. Keine Unterstützung für Android im Moment.
Anwendungsfälle
Echtzeit-VoIP-Anruf-Apps
Hintergrundrufbenachrichtigungen
Behandlung von stillen Push-Benachrichtigungen
App-Aufwachen bei eingehenden Anrufen
Sprachkommunikationsplattformen
Hauptmerkmale
iOS-spezifischer VoIP-Push-Support
Stille Benachrichtigungszustellung
Hintergrund-App-Aktivierung
Apple APNs-Integration
Minimale Konfiguration erforderlich
Geeignet für
VoIP-Anwendungsentwickler
Echtzeitkommunikations-Apps
iOS-fokussierte Flutter-Projekte
Anrufweiterleitungssysteme
Apps, die zuverlässige Hintergrundbenachrichtigungen benötigen
Hinweise
Kein Android-Unterstützung
Erfordert iOS 8.0 oder höher
APNs-Zertifikat-Einrichtung erforderlich
Beschränkt auf VoIP-Anwendungsfälle
Abhängig von Apples Push-Infrastruktur
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Flutter VoIP Push Notification
Flutter VoIP Push Notification - Currently iOS >= 8.0 only
Motivation
Since iOS 8.0 there is an execellent feature called VoIP Push Notification (PushKit), while firebase_messaging does not support voip push notification which is only available on iOS >= 8.0 which is the reason for this plugin.
To understand the benefits of Voip Push Notification, please see VoIP Best Practices.
import'package:flutter/material.dart';
import'package:flutter/material.dart';
import'dart:async';
import'package:flutter_voip_push_notification/flutter_voip_push_notification.dart';
voidmain() => runApp(MyApp());
classMyAppextendsStatefulWidget{
@override_MyAppStatecreateState() => _MyAppState();
}
class_MyAppStateextendsState<MyApp> {
String _pushToken = '';
FlutterVoipPushNotification _voipPush = FlutterVoipPushNotification();
@overridevoidinitState() {
super.initState();
configure();
}
// Configures a voip push notificationFuture<void> configure() async {
// request permission (required)await _voipPush.requestNotificationPermissions();
// listen to voip device token changes
_voipPush.onTokenRefresh.listen(onToken);
// do configure voip push
_voipPush.configure(onMessage: onMessage, onResume: onResume);
}
/// Called when the device token changesvoidonToken(String token) {
// send token to your apn provider serversetState(() {
_pushToken = token;
});
}
/// Called to receive notification when app is in foreground////// [isLocal] is true if its a local notification or false otherwise (remote notification)/// [payload] the notification payload to be processed. use this to present a local notificationFuture<dynamic> onMessage(bool isLocal, Map<String, dynamic> payload) {
// handle foreground notificationprint("received on foreground payload: $payload, isLocal=$isLocal");
returnnull;
}
/// Called to receive notification when app is resuming from background////// [isLocal] is true if its a local notification or false otherwise (remote notification)/// [payload] the notification payload to be processed. use this to present a local notificationFuture<dynamic> onResume(bool isLocal, Map<String, dynamic> payload) {
// handle background notificationprint("received on background payload: $payload, isLocal=$isLocal");
showLocalNotification(payload);
returnnull;
}
showLocalNotification(Map<String, dynamic> notification) {
String alert = notification["aps"]["alert"];
_voipPush.presentLocalNotification(LocalNotification(
alertBody: "Hello $alert",
));
}
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
home: Scaffold(
appBar: AppBar(
title: constText('Plugin example app'),
),
body: Center(
child: Text('Received Voip Push token: $_pushToken\n'),
),
),
);
}
}