@knocklabs/expo 0.7.0-rc.1 → 0.7.0

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/CHANGELOG.md +40 -0
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @knocklabs/expo
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e8567eb: Add an `enabled` prop to `KnockProvider` (and an `enabled` option to `useAuthenticatedKnockClient`).
8
+
9
+ When `enabled` is `false`, the provider still renders its children but the Knock client sits idle: no identify call, no API requests, no websocket. Set it to `true` and it connects like a login; set it back to `false` and it disconnects and clears its data like a logout. It defaults to `true`, so existing code is unaffected.
10
+
11
+ Use this instead of conditionally mounting `KnockProvider`, for example to wait for a user token that loads asynchronously:
12
+
13
+ ```tsx
14
+ <KnockProvider
15
+ apiKey={apiKey}
16
+ user={{ id: userId }}
17
+ userToken={userToken}
18
+ enabled={Boolean(userId && userToken)}
19
+ />
20
+ ```
21
+
22
+ Also fixed:
23
+
24
+ - `useFeedSettings` no longer calls `GET /v1/users/undefined/feeds/.../settings` when there's no user.
25
+ - `KnockProvider` now disconnects its client (websocket, token-refresh timer, listener) when it unmounts, instead of leaving them running.
26
+
27
+ - e8567eb: Add `useKnockAuthState()` and make Slack, MS Teams, and Expo respond to sign-in changes.
28
+
29
+ - New `useKnockAuthState(knock)` hook re-renders when the user signs in, signs out, or switches.
30
+ - Slack and MS Teams connection status now re-checks when the user changes, instead of checking once and sticking with that result.
31
+ - Expo waits for a signed-in user before registering for push notifications, so logged-out users don't see the OS permission prompt. A notification tapped while logged out no longer tries to update its status.
32
+
33
+ ### Patch Changes
34
+
35
+ - e8567eb: Fix Expo push auto-registration not re-running when the signed-in user changes in place. The auto-register effect now depends on the authenticated `userId`, so switching users on the same `KnockProvider` (where `isAuthenticated` never flips) re-registers the device token against the new user's channel data.
36
+ - Updated dependencies [e8567eb]
37
+ - Updated dependencies [e8567eb]
38
+ - Updated dependencies [e8567eb]
39
+ - @knocklabs/client@0.22.0
40
+ - @knocklabs/react-core@0.14.0
41
+ - @knocklabs/react-native@0.10.0
42
+
3
43
  ## 0.7.0-rc.1
4
44
 
5
45
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/expo",
3
- "version": "0.7.0-rc.1",
3
+ "version": "0.7.0",
4
4
  "author": "@knocklabs",
5
5
  "license": "MIT",
6
6
  "main": "dist/cjs/index.js",
@@ -53,9 +53,9 @@
53
53
  "react-native-gesture-handler": ">=2.0.0"
54
54
  },
55
55
  "dependencies": {
56
- "@knocklabs/client": "^0.22.0-rc.0",
57
- "@knocklabs/react-core": "^0.14.0-rc.0",
58
- "@knocklabs/react-native": "^0.10.0-rc.0",
56
+ "@knocklabs/client": "^0.22.0",
57
+ "@knocklabs/react-core": "^0.14.0",
58
+ "@knocklabs/react-native": "^0.10.0",
59
59
  "react-native-render-html": "^6.3.4",
60
60
  "react-native-svg": "~15.15.3"
61
61
  },