Broadcaster

Contents

This plugin adds exchanging events between native code and your app.

https://github.com/bsorrentino/cordova-broadcaster

Stuck on a Cordova issue?

Installation

Community Enterprise
ionic cordova plugin add cordova-plugin-broadcaster npm install @ionic-native/broadcaster
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More   or   Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/broadcaster

Supported Platforms

  • Android
  • iOS
  • Browser

Usage

import { Broadcaster } from '@ionic-native/broadcaster/ngx';

constructor(private broadcaster: Broadcaster) { }

...

// Listen to events from Native
this.broadcaster.addEventListener('eventName').subscribe((event) => console.log(event));

// Send event to Native
this.broadcaster.fireNativeEvent('eventName', {}).then(() => console.log('success'));