Socket
Socket
Sign inDemoInstall

cordova-plugin-app-event

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-plugin-app-event

Broadcasts UIApplicationDelegate events


Version published
Weekly downloads
869
increased by2.84%
Maintainers
1
Install size
29.1 kB
Created
Weekly downloads
 

Changelog

Source

Version 1.2.2 (25.09.2019)

  • Fix breaks on cordova-ios 5.x

Readme

Source

npm version

Cordova App-Event Plugin

The essential purpose of that plugin is to broadcast iOS-specific application events, so that 3rd party plugins can listen to them.

Its mainly used as an internal dependency for the LocalNotification and Badge plugin. But can be used by any other plugin also. Feel free to submit an PR to broadcast additional events.

As of right now its possible to add observers for these events:

Usage

1. Add and install the plugin as an dependency

Once you have added the plugin as an dependency you can add observers for them.

<!-- plugin.xml -->

<dependency id="cordova-plugin-app-event" />
2. Add the protocol to the plugin's interface

As first the plugin needs to indicate interest to receivce app events by adding the APPAppEventDelegate protocol.

Note: Required for version 1.2.0 or newer!

// MyCordovaPlugin.h

#import "APPAppEventDelegate.h"
#import <Cordova/CDVPlugin.h>

@interface APPLocalNotification : CDVPlugin <APPAppEventDelegate>

@implementation MyCordovaPlugin

...

@end
3. Add implementations for the delegated events

To add an observer you need to implement the UIApplicationDelegate Protocol. Implementations from your AppDelegate class don't get overwritten!

For the didReceiveLocalNotification event you would need to add that method.

// MyCordovaPlugin.m

@implementation MyCordovaPlugin

- (void) didReceiveLocalNotification:(NSNotification*)localNotification
{
    ...
}

@end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

This software is released under the Apache 2.0 License.

© 2013-2017 appPlant GmbH, Inc. All rights reserved

Keywords

FAQs

Last updated on 25 Sep 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc