Skip to content

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Nov 10, 2019
2 parents 4a9f84e + 54ec8e0 commit cd72cc3
Show file tree
Hide file tree
Showing 10 changed files with 526 additions and 240 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
*.log
.idea/
node_modules/
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,14 @@ $ cordova plugin add cordova-plugin-broadcaster
```Java
final Intent intent = new Intent("didShow");

Bundle b = new Bundle();
b.putString( "data", "test" );
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);
Expand All @@ -63,15 +69,28 @@ LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent);

##### Objective-C
```Objective-C
[[NSNotificationCenter defaultCenter] postNotificationName:@"didShow"
object:nil
userInfo:@{ @"data":@"test"}];
NSDictionary * payload = @{
@"data":@"test",
@"valid": [NSNumber numberWithBool:YES],
@"child": @{ @"name": @"joker" }
};

[[NSNotificationCenter defaultCenter] postNotificationName:@"TEST.EVENT"
object:nil
userInfo:payload];
```
##### Swift
##### Swift 5.x
```swift
let nc = NSNotificationCenter.default
nc.post(name:"didShow", object: nil, userInfo: ["data":"test"])
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)
```

#### BROWSER
Expand Down Expand Up @@ -124,7 +143,7 @@ LocalBroadcastManager.getInstance(this)
}];
```
##### Swift 3.0
##### Swift 5.x
```swift
let nc = NotificationCenter.default
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-broadcaster",
"version": "3.1.1",
"version": "4.0.0",
"description": "Allow send message from Javascript to Native",
"cordova": {
"id": "cordova-plugin-broadcaster",
Expand All @@ -19,15 +19,22 @@
"cordova-ios"
],
"engines": {
"cordovaDependencies": {
"2.2.1": { "cordova": ">3.9.0" },
"2.3.0": { "cordova": ">4.0.0" }
"cordovaDependencies": {
"2.2.1": {
"cordova": ">3.9.0"
},
"2.3.0": {
"cordova": ">4.0.0"
}
}
},
"author": "bsorrentino",
"license": "MIT",
"bugs": {
"url": "https://github.com/bsorrentino/cordova-broadcaster/issues"
},
"homepage": "https://github.com/bsorrentino/cordova-broadcaster#readme"
"homepage": "https://github.com/bsorrentino/cordova-broadcaster#readme",
"devDependencies": {
"@types/cordova": "0.0.34"
}
}
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="cordova-plugin-broadcaster"
version="3.1.1"
version="4.0.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<engines>
Expand Down
Loading

0 comments on commit cd72cc3

Please sign in to comment.