Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@exxili/capacitor-ios-background-push

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@exxili/capacitor-ios-background-push

Handles iOS Silent Push notifications for Capacitor apps, enabling background updates, processing, and seamless integration with standard push notifications.

unpublished
latest
Source
npmnpm
Version
0.0.21
Version published
Maintainers
1
Created
Source

@exxili/capacitor-ios-background-push

🚧 Alpha Release - Work in Progress Note: The plugin is currently working, Still work in progress - as/when i get time i will update this to include tests

Please note that this plugin is currently under active development and may be subject to changes or updates.

A Capacitor plugin designed to handle iOS Silent Push notifications, enabling background updates, processing, and seamless integration with standard push notifications.

⚠️ iOS-specific Support

This plugin is specifically designed for iOS and does not support Android. It handles Silent Push notifications on iOS devices, providing a seamless integration with standard push notifications.

🚀 Getting Started

Follow the steps below to integrate the plugin into your Capacitor project:

  • Install the plugin using npm:
npm install @exxili/capacitor-ios-background-push
  • Sync your Capacitor project:
npx cap sync
  • Import the plugin in your project and use it to listen for remote notifications:
import { IOSBackgroundPush } from '@exxili/capacitor-ios-background-push';

// Add a listener for silent push notifications
IOSBackgroundPush.addListener('SilentNotificationReceived', (data) => {
  console.log('Silent push notification received:', data);
});
  • Update your AppDelegate.swift file in your iOS project to handle Silent Push notifications. Add the following method to your AppDelegate class:
import UIKit
import Capacitor
import ExxiliCapacitorIosBackgroundPush

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    // ... other existing code ...

    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
        NotificationCenter.default.post(name: .didReceiveRemoteNotificationForIOSBackgroundPush, object: nil, userInfo: [
            "userInfo": userInfo,
            "completionHandler": completionHandler
        ])
    }
}

API

addListener('SilentNotificationReceived', ...)

addListener(eventName: 'SilentNotificationReceived', listenerFunc: (data: { data: any; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when a silent push notification is received.

ParamType
eventName'SilentNotificationReceived'
listenerFunc(data: { data: any; }) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Interfaces

PluginListenerHandle

PropType
remove() => Promise<void>

Keywords

capacitor

FAQs

Package last updated on 20 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts