Skip to content

Commit cd72cc3

Browse files
committed
Merge branch 'release/4.0.0'
2 parents 4a9f84e + 54ec8e0 commit cd72cc3

File tree

10 files changed

+526
-240
lines changed

10 files changed

+526
-240
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
*.log
33
.idea/
4+
node_modules/

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ $ cordova plugin add cordova-plugin-broadcaster
5252
```Java
5353
final Intent intent = new Intent("didShow");
5454

55-
Bundle b = new Bundle();
56-
b.putString( "data", "test" );
55+
final Bundle child = new Bundle();
56+
child.putString( "name", "joker");
57+
58+
final Bundle b = new Bundle();
59+
b.putString( "data", "test");
60+
b.putBoolean( "valid", true );
61+
b.putBundle( "child", child );
62+
5763
intent.putExtras( b);
5864

5965
LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent);
@@ -63,15 +69,28 @@ LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent);
6369

6470
##### Objective-C
6571
```Objective-C
66-
[[NSNotificationCenter defaultCenter] postNotificationName:@"didShow"
67-
object:nil
68-
userInfo:@{ @"data":@"test"}];
72+
NSDictionary * payload = @{
73+
@"data":@"test",
74+
@"valid": [NSNumber numberWithBool:YES],
75+
@"child": @{ @"name": @"joker" }
76+
};
77+
78+
[[NSNotificationCenter defaultCenter] postNotificationName:@"TEST.EVENT"
79+
object:nil
80+
userInfo:payload];
6981
```
7082
71-
##### Swift
83+
##### Swift 5.x
7284
```swift
73-
let nc = NSNotificationCenter.default
74-
nc.post(name:"didShow", object: nil, userInfo: ["data":"test"])
85+
86+
let payload:[String:Any] = [
87+
"data":"test",
88+
"valid": true,
89+
"child":[ "name": "joker" ]
90+
]
91+
92+
let nc = NotificationCenter.default
93+
nc.post(name:Notification.Name("didShow"), object: nil, userInfo: payload)
7594
```
7695

7796
#### BROWSER
@@ -124,7 +143,7 @@ LocalBroadcastManager.getInstance(this)
124143
}];
125144
```
126145
127-
##### Swift 3.0
146+
##### Swift 5.x
128147
129148
```swift
130149
let nc = NotificationCenter.default

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-broadcaster",
3-
"version": "3.1.1",
3+
"version": "4.0.0",
44
"description": "Allow send message from Javascript to Native",
55
"cordova": {
66
"id": "cordova-plugin-broadcaster",
@@ -19,15 +19,22 @@
1919
"cordova-ios"
2020
],
2121
"engines": {
22-
"cordovaDependencies": {
23-
"2.2.1": { "cordova": ">3.9.0" },
24-
"2.3.0": { "cordova": ">4.0.0" }
22+
"cordovaDependencies": {
23+
"2.2.1": {
24+
"cordova": ">3.9.0"
25+
},
26+
"2.3.0": {
27+
"cordova": ">4.0.0"
2528
}
29+
}
2630
},
2731
"author": "bsorrentino",
2832
"license": "MIT",
2933
"bugs": {
3034
"url": "https://github.com/bsorrentino/cordova-broadcaster/issues"
3135
},
32-
"homepage": "https://github.com/bsorrentino/cordova-broadcaster#readme"
36+
"homepage": "https://github.com/bsorrentino/cordova-broadcaster#readme",
37+
"devDependencies": {
38+
"@types/cordova": "0.0.34"
39+
}
3340
}

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<plugin id="cordova-plugin-broadcaster"
3-
version="3.1.1"
3+
version="4.0.0"
44
xmlns="http://apache.org/cordova/ns/plugins/1.0"
55
xmlns:android="http://schemas.android.com/apk/res/android">
66
<engines>

0 commit comments

Comments
 (0)