Skip to content

Commit acdec29

Browse files
authored
Update README.md
1 parent 1442e16 commit acdec29

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ npm install react-native-azurenotificationhub
5757

5858
![Create Notification Hub](img/CreateNotificationHub.png)
5959

60-
* Take note of the two connection strings that are made available to you in **Settings > Access Policies**, as you will need them to handle push notifications later.
61-
62-
![Get Connection String](img/GetConnectionString.png)
63-
6460
## Android Installation
6561

6662
### Register app with Notification Hub
@@ -218,19 +214,34 @@ namespace ...
218214
}
219215
```
220216

221-
* At this point you can register and unregister from the Azure Notification Hub instance using JavaScript as in the following example:
217+
## iOS Installation
218+
219+
Coming soon.
220+
221+
## JavaScript Configuration
222+
223+
On the [Azure Portal](https://portal.azure.com) page for your notification hub, copy a connection string from **Settings > Access Policies**.
224+
225+
![Get Connection String](img/GetConnectionString.png)
226+
227+
The example below shows how you can register and unregister from Azure Notification Hub in your React component.
222228

223229
```js
224230
const NotificationHub = require('react-native-azurenotificationhub');
225231

232+
const connectionString = '...'; // The Notification Hub connection string
233+
const hubName = '...'; // The Notification Hub name
234+
const senderID = '...'; // The Sender ID from the Cloud Messaging tab of the Firebase console
235+
const tags = [ ... ]; // The set of tags to subscribe to
236+
226237
class myapp extends Component {
227238
register() {
228-
NotificationHub.register({connectionString, hubName})
239+
NotificationHub.register({connectionString, hubName, senderID, tags})
229240
.catch(reason => console.warn(reason));
230241
}
231242

232243
unregister() {
233-
NotificationHub.unregister({connectionString, hubName})
244+
NotificationHub.unregister()
234245
.catch(reason => console.warn(reason));
235246
}
236247

@@ -256,14 +267,6 @@ class myapp extends Component {
256267
}
257268
```
258269
259-
## iOS Installation
260-
261-
Coming soon.
262-
263-
## JavaScript Configuration
264-
265-
Coming soon.
266-
267270
## License
268271
269272
The React Native Azure Notification Hub plugin is provided under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)