![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@osvlabs/cordova-plugin-broadcaster
Advanced tools
Cordova Plugin to allow message exchange between javascript and native (and viceversa).
Broadcaster plugin providing bridge for the following native technologies:
target OS | Native Technology |
---|---|
IOS | NotificationCenter |
Android | LocalBroadcastManager |
date | infos | refs |
---|---|---|
Mar 19, 2020 | Concerning Android I've added support for broadcast Intent to external Apps, receive broadcast Intents from external Apps, Flags & Category on Intent | insipred by navarrojava's fork |
Jan 16, 2018 | I've developed a complete ionic3 sample project using broadcaster | ionic-broadcaster-sample |
Jan 28, 2017 | such plugin has been added to ionic-native distribution | How to is available here |
$ cordova create <PATH> [ID [NAME [CONFIG]]] [options]
$ cd <PATH>
$ cordova platform add [ios|android]
$ cordova plugin add cordova-plugin-broadcaster
console.log( "register didShow received!" );
var listener = function( e ) {
//log: didShow received! userInfo: {"data":"test"}
console.log( "didShow received! userInfo: " + JSON.stringify(e) );
}
window.broadcaster.addEventListener( "didShow", listener);
if( cordova.platformId === "android" ) {
var listener = function( e ) {
//log: didShow received! userInfo: {"data":"test"}
console.log( "CONNECTIVITY_CHANGE: " + JSON.stringify(e) );
}
var isGlobal = true
window.broadcaster.addEventListener( 'android.net.conn.CONNECTIVITY_CHANGE', isGlobal, listener);
}
final Intent intent = new Intent("didShow");
final Bundle child = new Bundle();
child.putString( "name", "joker");
final Bundle b = new Bundle();
b.putString( "data", "test");
b.putBoolean( "valid", true );
b.putBundle( "child", child );
intent.putExtras( b);
LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent);
NSDictionary * payload = @{
@"data":@"test",
@"valid": [NSNumber numberWithBool:YES],
@"child": @{ @"name": @"joker" }
};
[[NSNotificationCenter defaultCenter] postNotificationName:@"TEST.EVENT"
object:nil
userInfo:payload];
let payload:[String:Any] = [
"data":"test",
"valid": true,
"child":[ "name": "joker" ]
]
let nc = NotificationCenter.default
nc.post(name:Notification.Name("didShow"), object: nil, userInfo: payload)
let event = new CustomEvent("didShow", { detail: { data:"test"} } );
document.dispatchEvent( event )
window.broadcaster.fireNativeEvent( "test.event", { item:'test data' }, function() {
console.log( "event fired!" );
} );
if( cordova.platformId === "android" ) {
// send a message with "flags" and "category"
window.broadcaster.fireNativeEvent( "message", { extras:{ item:'test data' }, flags:0, category:'android.intent.category.INFO'}, function() {
console.log( "event fired!" );
});
}
if( cordova.platformId === "android" ) {
// send a global message
var isGlobal = true
window.broadcaster.fireNativeEvent( "GLOBAL_ACTION", isGlobal, { item:'test data' }, function() {
console.log( "event fired!" );
});
}
if( cordova.platformId === "android" ) {
// send a global message with "flags" and "category"
var isGlobal = true
window.broadcaster.fireNativeEvent( "GLOBAL_ACTION", isGlobal, { extras:{ item:'test data' }, flags:0, category:'android.intent.category.INFO'}, function() {
console.log( "event fired!" );
});
}
final BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String data = intent.getExtras().getString("data");
Log.d("CDVBroadcaster",
String.format("Native event [%s] received with data [%s]", intent.getAction(), data));
}
};
LocalBroadcastManager.getInstance(this)
.registerReceiver(receiver, new IntentFilter("test.event"));
}
[[NSNotificationCenter defaultCenter] addObserverForName:@"test.event"
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *notification) {
NSLog(@"Handled 'test.event' [%@]", notification.userInfo[@"item"]);
}];
let nc = NotificationCenter.default
nc.addObserver(forName:Notification.Name(rawValue:"test.event"),
object:nil, queue:nil) {
notification in
print( "\(notification.userInfo)")
}
document.addEventListener( "test.event", ( ev:Event ) => {
console.log( "test event", ev.detail );
});
FAQs
Allow send message from Javascript to Native
The npm package @osvlabs/cordova-plugin-broadcaster receives a total of 0 weekly downloads. As such, @osvlabs/cordova-plugin-broadcaster popularity was classified as not popular.
We found that @osvlabs/cordova-plugin-broadcaster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.