Updated Whisper Push Notifications (markdown)
parent
44fdfdfa63
commit
a252124a23
|
@ -139,15 +139,16 @@ Now, whenever we receive server proposal and willing to accept it, `sendAcceptSe
|
|||
|
||||
```js
|
||||
var acceptServerTopic = '0x04f7dea6'; // ACCEPT_NOTIFICATION_SERVER
|
||||
var sendAcceptServerRequest = function (identity, serverID) {
|
||||
// whenever we are ready to accept server, having a given serverID, we need
|
||||
// to notify it by sending signed (from us) acceptance message.
|
||||
var sendAcceptServerRequest = function (identity, serverId) {
|
||||
// whenever we are ready to accept server, having a given serverId, we need
|
||||
// to notify it by sending signed (from us) and encrypted (using protocol key)
|
||||
// acceptance message.
|
||||
var err = web3.shh.post({
|
||||
from: identity, // it is absolutely important to identify the client, or your acceptance will be dropped
|
||||
to: protocolKey,
|
||||
topics: [acceptServerTopic],
|
||||
payload: '{"server": "' + serverID + '"}',
|
||||
ttl: 20,
|
||||
keyname: keyname
|
||||
payload: '{"server": "' + serverId + '"}',
|
||||
ttl: 20
|
||||
});
|
||||
if (err !== null) {
|
||||
console.log("message NOT sent")
|
||||
|
|
Loading…
Reference in New Issue