ring-client-api 13.0.0-beta.3 → 13.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/api.js +7 -4
  2. package/package.json +1 -1
package/lib/api.js CHANGED
@@ -123,14 +123,15 @@ class RingApi extends subscribed_1.Subscribed {
123
123
  }
124
124
  }
125
125
  async registerPushReceiver(cameras, intercoms) {
126
- const credentials = this.restClient._internalOnly_pushNotificationCredentials, pushReceiver = new push_receiver_1.default({
126
+ const credentials = this.restClient._internalOnly_pushNotificationCredentials?.config &&
127
+ this.restClient._internalOnly_pushNotificationCredentials, pushReceiver = new push_receiver_1.default({
127
128
  firebase: {
128
129
  apiKey: 'AIzaSyCv-hdFBmmdBBJadNy-TFwB-xN_H5m3Bk8',
129
130
  projectId: 'ring-17770',
130
131
  messagingSenderId: '876313859327', // for Ring android app. 703521446232 for ring-site
131
132
  appId: '1:876313859327:android:e10ec6ddb3c81f39',
132
133
  },
133
- credentials: credentials?.config ? credentials : undefined,
134
+ credentials,
134
135
  debug: false,
135
136
  }), devicesById = {}, sendToDevice = (id, notification) => {
136
137
  devicesById[id]?.processPushNotification(notification);
@@ -224,8 +225,10 @@ class RingApi extends subscribed_1.Subscribed {
224
225
  (0, util_1.logError)(e);
225
226
  }
226
227
  });
227
- // If we already have credentials, use them immediately
228
- if (credentials) {
228
+ // If we already have credentials and they haven't been changed during registration, use them immediately
229
+ if (credentials &&
230
+ credentials?.fcm?.token ===
231
+ this.restClient._internalOnly_pushNotificationCredentials?.fcm?.token) {
229
232
  onPushNotificationToken.next(credentials.fcm.token);
230
233
  }
231
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ring-client-api",
3
- "version": "13.0.0-beta.3",
3
+ "version": "13.0.0-beta.4",
4
4
  "description": "Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting",
5
5
  "main": "lib/index.js",
6
6
  "exports": {