{"id":32305943,"url":"https://github.com/peerwaya/flutter_voip_push_notification","last_synced_at":"2025-10-23T06:58:42.302Z","repository":{"id":47149024,"uuid":"213143411","full_name":"peerwaya/flutter_voip_push_notification","owner":"peerwaya","description":"Flutter VoIP Push Notification - Currently iOS \u003e= 8.0 only","archived":false,"fork":false,"pushed_at":"2022-09-30T08:42:48.000Z","size":75,"stargazers_count":28,"open_issues_count":12,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-23T06:58:37.191Z","etag":null,"topics":["callkit","flutter","ios","pushkit","voip","webrtc"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peerwaya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-06T09:48:36.000Z","updated_at":"2024-03-17T05:02:29.000Z","dependencies_parsed_at":"2022-08-02T18:16:00.730Z","dependency_job_id":null,"html_url":"https://github.com/peerwaya/flutter_voip_push_notification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peerwaya/flutter_voip_push_notification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerwaya%2Fflutter_voip_push_notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerwaya%2Fflutter_voip_push_notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerwaya%2Fflutter_voip_push_notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerwaya%2Fflutter_voip_push_notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peerwaya","download_url":"https://codeload.github.com/peerwaya/flutter_voip_push_notification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peerwaya%2Fflutter_voip_push_notification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280577139,"owners_count":26354074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["callkit","flutter","ios","pushkit","voip","webrtc"],"created_at":"2025-10-23T06:58:41.185Z","updated_at":"2025-10-23T06:58:42.289Z","avatar_url":"https://github.com/peerwaya.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter VoIP Push Notification\n[![pub package](https://img.shields.io/pub/v/flutter_voip_push_notification.svg)](https://pub.dartlang.org/packages/flutter_voip_push_notification)\nFlutter VoIP Push Notification - Currently iOS \u003e= 8.0 only\n\n## Motivation\n\nSince iOS 8.0 there is an execellent feature called **VoIP Push Notification** ([PushKit][1]), while [firebase_messaging][3] does not support voip push notification which is only available on iOS \u003e= 8.0 which is the reason for this plugin.\n\nTo understand the benefits of **Voip Push Notification**, please see [VoIP Best Practices][2].\n\n**Note 1**: This plugin works for only iOS. You can use [firebase_messaging][3] for Android by [sending high priority push notification][5]\n\n**Note 2** This This plugin was inspired by [react-native-voip-push-notification][4] and [firebase_messaging][3]\n\n### iOS\n\nThe iOS version should be \u003e= 8.0 since we are using [PushKit][1].\n\n#### Enable VoIP Push Notification and Get VoIP Certificate\n\nPlease refer to [VoIP Best Practices][2].\n\n**Note**: Do NOT follow the `Configure VoIP Push Notification` part from the above link, use the instruction below instead.\n\n\n#### AppDelegate.swift\n\n\n```swift\n\n...\n\nimport PushKit                     /* \u003c------ add this line */\nimport flutter_voip_push_notification      /* \u003c------ add this line */\n...\n\n@UIApplicationMain\n@objc class AppDelegate: FlutterAppDelegate, PKPushRegistryDelegate {\n\n    ...\n\n    /* Add PushKit delegate method */\n\n    // Handle updated push credentials\n    func pushRegistry(_ registry: PKPushRegistry,\n                      didReceiveIncomingPushWith payload: PKPushPayload,\n                      for type: PKPushType,\n                      completion: @escaping () -\u003e Void){\n        // Register VoIP push token (a property of PKPushCredentials) with server\n        FlutterVoipPushNotificationPlugin.didReceiveIncomingPush(with: payload, forType: type.rawValue)\n    }\n\n    // Handle incoming pushes\n    func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {\n        // Process the received push\n        FlutterVoipPushNotificationPlugin.didUpdate(pushCredentials, forType: type.rawValue);\n    }\n\n    ...\n}\n```\n\n#### AppDelegate.m Modification\n\n\n```objective-c\n\n...\n\n#import \u003cPushKit/PushKit.h\u003e                    /* \u003c------ add this line */\n#import \"FlutterVoipPushNotificationPlugin.h\"      /* \u003c------ add this line */\n\n...\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n\n...\n\n/* Add PushKit delegate method */\n\n// Handle updated push credentials\n- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {\n  // Register VoIP push token (a property of PKPushCredentials) with server\n  [FlutterVoipPushNotificationPlugin didUpdatePushCredentials:credentials forType:(NSString *)type];\n}\n\n// Handle incoming pushes\n- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {\n  // Process the received push\n  [FlutterVoipPushNotificationPlugin didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];\n}\n\n...\n\n@end\n\n```\n\n## Usage\nAdd `flutter_voip_push_notification` as a [dependency in your pubspec.yaml file](https://flutter.io/using-packages/).\n\n### Example\n\n\n```dart\n\nimport 'package:flutter/material.dart';\nimport 'package:flutter/material.dart';\nimport 'dart:async';\nimport 'package:flutter_voip_push_notification/flutter_voip_push_notification.dart';\n\nvoid main() =\u003e runApp(MyApp());\n\nclass MyApp extends StatefulWidget {\n  @override\n  _MyAppState createState() =\u003e _MyAppState();\n}\n\nclass _MyAppState extends State\u003cMyApp\u003e {\n  String _pushToken = '';\n  FlutterVoipPushNotification _voipPush = FlutterVoipPushNotification();\n  @override\n  void initState() {\n    super.initState();\n    configure();\n  }\n\n  // Configures a voip push notification\n  Future\u003cvoid\u003e configure() async {\n    // request permission (required)\n    await _voipPush.requestNotificationPermissions();\n\n    // listen to voip device token changes\n    _voipPush.onTokenRefresh.listen(onToken);\n\n    // do configure voip push\n    _voipPush.configure(onMessage: onMessage, onResume: onResume);\n  }\n\n  /// Called when the device token changes\n  void onToken(String token) {\n    // send token to your apn provider server\n    setState(() {\n      _pushToken = token;\n    });\n  }\n\n  /// Called to receive notification when app is in foreground\n  ///\n  /// [isLocal] is true if its a local notification or false otherwise (remote notification)\n  /// [payload] the notification payload to be processed. use this to present a local notification\n  Future\u003cdynamic\u003e onMessage(bool isLocal, Map\u003cString, dynamic\u003e payload) {\n    // handle foreground notification\n    print(\"received on foreground payload: $payload, isLocal=$isLocal\");\n    return null;\n  }\n\n  /// Called to receive notification when app is resuming from background\n  ///\n  /// [isLocal] is true if its a local notification or false otherwise (remote notification)\n  /// [payload] the notification payload to be processed. use this to present a local notification\n  Future\u003cdynamic\u003e onResume(bool isLocal, Map\u003cString, dynamic\u003e payload) {\n    // handle background notification\n    print(\"received on background payload: $payload, isLocal=$isLocal\");\n    showLocalNotification(payload);\n    return null;\n  }\n\n  showLocalNotification(Map\u003cString, dynamic\u003e notification) {\n    String alert = notification[\"aps\"][\"alert\"];\n    _voipPush.presentLocalNotification(LocalNotification(\n      alertBody: \"Hello $alert\",\n    ));\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: Scaffold(\n        appBar: AppBar(\n          title: const Text('Plugin example app'),\n        ),\n        body: Center(\n          child: Text('Received Voip Push token: $_pushToken\\n'),\n        ),\n      ),\n    );\n  }\n}\n\n```\n\n[1]: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/PushKit_Framework/index.html\n[2]: https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html\n[3]: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging\n[4]: https://github.com/react-native-webrtc/react-native-voip-push-notification\n[5]: https://developers.google.com/cloud-messaging/concept-options#setting-the-priority-of-a-message\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeerwaya%2Fflutter_voip_push_notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeerwaya%2Fflutter_voip_push_notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeerwaya%2Fflutter_voip_push_notification/lists"}