Skip to content

Commit

Permalink
Additional logging & pubnub origin
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-konshin committed Apr 28, 2020
1 parent 5659f76 commit 7ab75bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api-test/package.json
Expand Up @@ -3,6 +3,6 @@
"name": "@ringcentral/sdk-api-test",
"private": true,
"dependencies": {
"soap": "0.23.0"
"soap": "0.31.0"
}
}
3 changes: 3 additions & 0 deletions demo/src/core.html
Expand Up @@ -103,6 +103,9 @@ <h1>
renewHandicapMs: 14 * 60 * 1000 // set quicker subscription refresh
});

subscription.on(subscription.events.status, function(msg) {
console.log(msg);
});
subscription.on(subscription.events.notification, function(msg) {
cb(msg.body);
});
Expand Down
2 changes: 1 addition & 1 deletion subscriptions/package.json
Expand Up @@ -18,7 +18,7 @@
"start:webpack": "npm run build:webpack -- --watch"
},
"dependencies": {
"pubnub": "4.21.6"
"pubnub": "^4.27.6"
},
"devDependencies": {
"@ringcentral/sdk": "*",
Expand Down
5 changes: 4 additions & 1 deletion subscriptions/src/subscription/Subscription.ts
Expand Up @@ -30,6 +30,7 @@ export enum events {
subscribeError = 'subscribeError',
automaticRenewSuccess = 'automaticRenewSuccess',
automaticRenewError = 'automaticRenewError',
status = 'status',
}

export default class Subscription extends SDK.EventEmitter {
Expand Down Expand Up @@ -337,10 +338,12 @@ export default class Subscription extends SDK.EventEmitter {
ssl: true,
restore: true,
subscribeKey: subscriberKey,
origin: 'ringcentral.pubnubapi.com',
keepAlive: true,
});

this._pubnub.addListener({
status: statusEvent => {},
status: statusEvent => this.emit(this.events.status, statusEvent),
message: m => this._notify(m.message),
});
}
Expand Down

0 comments on commit 7ab75bd

Please sign in to comment.