Skip to content

Commit f99c9fb

Browse files
committed
Fix docs for Messaging
1 parent 805c7f4 commit f99c9fb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tutorials/admin/messaging.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Tutorial: Authentication
1+
# Tutorial: Messaging
22

33
MockFirebase replaces most of Firebase's messaging method of the admin API with simple mocks. Messaging methods will always succeed unless an error is specifically specified using [`failNext`](../API.md#failnextmethod-err---undefined).
44

@@ -42,7 +42,7 @@ result.then(function (messageId) {
4242
- [sendMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>](https://firebase.google.com/docs/reference/admin/node/admin.messaging.Messaging.html#send-multicast)
4343

4444
## Set custom message response
45-
In some cases it could be necessary to fake a custom send response (like a [BatchResponse](https://firebase.google.com/docs/reference/admin/node/admin.messaging.BatchResponse.html)). In this cases you can use `firebase.messaging().nextResult(methodName, result)` (similar to `firebase.messaging().failNext(methodName, err)`).
45+
In some cases it could be necessary to fake a custom send response (like a [BatchResponse](https://firebase.google.com/docs/reference/admin/node/admin.messaging.BatchResponse.html)). In this cases you can use `firebase.messaging().respondNext(methodName, result)` (similar to `firebase.messaging().failNext(methodName, err)`).
4646

4747
##### Source
4848

@@ -82,7 +82,7 @@ var batchResponse = {
8282
],
8383
successCount: 1
8484
}
85-
messageService.messaging().nextResult('sendAll', batchResponse);
85+
messageService.messaging().respondNext('sendAll', batchResponse);
8686
var result = messageService.sendAll();
8787
messageService.messaging().flush();
8888
result.then(function (res) {
@@ -93,6 +93,7 @@ result.then(function (res) {
9393

9494
## Assert arguments
9595
If you want to assert the arguments that were passed to any of the send-functions you can register a callback.
96+
The callback receives as argument that contains all arguments that were passed to the send-function.
9697

9798
##### Source
9899

@@ -120,7 +121,7 @@ var messageService = {
120121
```js
121122
MockFirebase.override();
122123
messageService.ref().on('send', function(args) {
123-
console.assert(args.data.foo === 'bar', 'message is coorect');
124+
console.assert(args[0].data.foo === 'bar', 'message is coorect');
124125
});
125126
messageService.send();
126127
messageService.messaging().flush();

0 commit comments

Comments
 (0)