bsorrentino / cordova-broadcaster

Cordova Plugin to allow message exchange between javascript and native (and viceversa)
MIT License
113 stars 53 forks source link

Description of the plugin is unclear #69

Closed StefanFlaschko closed 11 months ago

StefanFlaschko commented 1 year ago

The description of this plugin is very unclear.

Please add more Information on how to use it, especially I could not find an answer to the following questions:

Is there a list of events which can be used ?

In the example oft the plugin, it says: " window.broadcaster.addEventListener( "didShow", listener);"

What can I use instead of "didShow"?

Is this only for Angular?

The Link to the Android Documentation goes to a deprecated page: https://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html

bsorrentino commented 1 year ago

Hi @StefanFlaschko

What can I use instead of "didShow"?

A: Whatever string you want. It is up to you, "didShow" was just an example.

Is this only for Angular?

A: It is designed to be used in generic javascript. It is framework independent.

The Link to the Android Documentation goes to a deprecated page

A: The Android version of the plugin is designed to use LocalbroadcastManager. For now is not planned to change it. However it still work well.

StefanFlaschko commented 1 year ago

Hey @bsorrentino,

Thanks for the reply. When trying to start my app from Android Studio I get the message:

error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
bsorrentino commented 1 year ago

Thanks @StefanFlaschko for feedback

This error occurs when some plugin has old android support dependencies instead of using the new AndroidX equivalent.

I've to update the plugin to use AndroidX dependencies. Refer to #65

In meanwhile as workaround you can also patch the plugin using jetifier

npm install jetifier
npx jetify
npx cap sync android