VoIP 푸시 알림을 처리하기 위한 플러터 플러그인으로, 현재 iOS 8.0 이상을 지원합니다. 실시간 통신 앱이 앱이 종료된 상태에서도 푸시 알림을 수신할 수 있게 해주며, 신뢰할 수 있는 통화 연결을 보장합니다. 이 패키지는 Apple의 푸시 알림 서비스(APNs)와 통합되어 소리 없는 VoIP 알림을 전달하여 백그라운드에서 앱을 활성화해 오는 통화를 받을 수 있도록 합니다. 즉각적인 알림 전달이 필요한 VoIP 통화 또는 메시징 플랫폼과 같은 VoIP 애플리케이션에 특별히 설계되었습니다. 플러터 생태계 내에서 최소한의 설정으로 원활하게 작동합니다. 현재 Android는 지원하지 않습니다.
사용 사례
실시간 VoIP 통화 앱
백그라운드 통화 알림
사일런트 푸시 알림 처리
incoming calls에 대한 앱 웨이크업
음성 통신 플랫폼
주요 기능
iOS 전용 VoIP 푸시 지원
사일런트 알림 전달
백그라운드 앱 활성화
Apple APNs 통합
필요한 최소 구성
적합한 대상
VoIP 애플리케이션 개발자
실시간 통신 앱
iOS 중심의 Flutter 프로젝트
콜 라우팅 시스템
신뢰할 수 있는 백그라운드 알림이 필요한 앱
고려 사항
안드로이드 지원 없음
iOS 8.0 이상 필요
APNs 인증서 설정이 필요합니다
VoIP 사용 사례에 한정
애플의 푸시 인프라에 의존
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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'),
),
),
);
}
}