Skip to content

Commit 399c735

Browse files
authored
Merge pull request #1583 from GetStream/develop
Next Release
2 parents 3098841 + 75561fd commit 399c735

File tree

72 files changed

+3208
-438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3208
-438
lines changed

.github/workflows/sample-distribution.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
branches:
66
- develop
7+
8+
concurrency:
9+
group: sample-distribution
10+
cancel-in-progress: true
11+
712
jobs:
813
build_and_deploy_ios_testflight_qa:
914
runs-on: [macos-latest]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Component for rendering the Audio Attachment
2+
3+
| Type | Default |
4+
| --------- | ------------------------------------------------------------------- |
5+
| Component | [`AudioAttachment`](../../../../ui-components/audio_attachment.mdx) |

docusaurus/docs/reactnative/contexts/messages_context.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ title: MessagesContext
66
import AdditionalTouchableProps from '../common-content/core-components/channel/props/additional_touchable_props.mdx';
77
import Attachment from '../common-content/core-components/channel/props/attachment.mdx';
88
import AttachmentActions from '../common-content/core-components/channel/props/attachment_actions.mdx';
9+
import AudioAttachment from '../common-content/core-components/channel/props/audio_attachment.mdx';
910
import Card from '../common-content/core-components/channel/props/card.mdx';
1011
import CardCover from '../common-content/core-components/channel/props/card_cover.mdx';
1112
import CardFooter from '../common-content/core-components/channel/props/card_footer.mdx';
@@ -254,6 +255,10 @@ Upserts a given message in local channel state. Please note that this function d
254255

255256
<AttachmentActions />
256257

258+
### <div class="label description">_forwarded from [Channel](../core-components/channel.mdx#audioattachment)_ props</div> AudioAttachment {#audioattachment}
259+
260+
<AudioAttachment />
261+
257262
### <div class="label description">_forwarded from [Channel](../core-components/channel.mdx#card)_ props</div> Card {#card}
258263

259264
<Card />

docusaurus/docs/reactnative/core-components/channel.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import AdditionalTouchableProps from '../common-content/core-components/channel/
2626
import AttachButton from '../common-content/core-components/channel/props/attach_button.mdx';
2727
import Attachment from '../common-content/core-components/channel/props/attachment.mdx';
2828
import AttachmentActions from '../common-content/core-components/channel/props/attachment_actions.mdx';
29+
import AudioAttachment from '../common-content/core-components/channel/props/audio_attachment.mdx';
2930
import Card from '../common-content/core-components/channel/props/card.mdx';
3031
import CardCover from '../common-content/core-components/channel/props/card_cover.mdx';
3132
import CardFooter from '../common-content/core-components/channel/props/card_footer.mdx';
@@ -688,6 +689,10 @@ Callback function to set the [ref](https://reactjs.org/docs/refs-and-the-dom.htm
688689

689690
<AttachmentActions />
690691

692+
### AudioAttachment
693+
694+
<AudioAttachment />
695+
691696
### Card
692697

693698
<Card />

docusaurus/docs/reactnative/guides/push_notifications_v2.mdx

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,36 @@ const App = () => {
139139
// Register FCM token with stream chat server.
140140
const registerPushToken = async () => {
141141
const token = await messaging().getToken();
142-
await client.addDevice(token, 'firebase');
142+
const push_provider = 'firebase';
143+
const push_provider_name = 'MyRNAppFirebasePush'; // name an alias for your push provider (optional)
144+
client.setLocalDevice({
145+
id: token,
146+
push_provider,
147+
// push_provider_name is meant for optional multiple providers support, see: https://getstream.io/chat/docs/react/push_providers_and_multi_bundle
148+
push_provider_name,
149+
});
150+
await AsyncStorage.setItem('@current_push_token', token);
151+
152+
const removeOldToken = async () => {
153+
const oldToken = await AsyncStorage.getItem('@current_push_token');
154+
if (oldToken !== null) {
155+
await client.removeDevice(oldToken);
156+
}
157+
};
143158

144159
unsubscribeTokenRefreshListener = messaging().onTokenRefresh(async newToken => {
145-
await client.addDevice(newToken, 'firebase');
160+
await Promise.all([
161+
removeOldToken(),
162+
client.addDevice(newToken, push_provider, USER_ID, push_provider_name),
163+
AsyncStorage.setItem('@current_push_token', newToken),
164+
]);
146165
});
147166
};
148167

149168
const init = async () => {
150-
await client.connectUser({ id: USER_ID }, USER_TOKEN);
151-
152169
await requestPermission();
153170
await registerPushToken();
171+
await client.connectUser({ id: USER_ID }, USER_TOKEN);
154172

155173
setIsReady(true);
156174
};
@@ -222,12 +240,6 @@ If you had migrated from push v1 to v2, the v1 template is copied to the notific
222240
223241
Since the `notification` field is present on iOS, it is automatically picked up by the Firebase SDK and displayed to the user when the app is not in the foreground.
224242
225-
:::info
226-
227-
If you want to customize the notification dynamically on the iOS app without customizing the payload or increment the badge number on every push, you will need to implement a [`Notification Service Extension`](https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension) in the native language.
228-
229-
:::
230-
231243
### Android
232244
233245
To listen to notifications in the background, you can use the [`setBackgroundMessageHandler`](https://rnfirebase.io/messaging/usage#background--quit-state-messages) method.
@@ -448,15 +460,42 @@ The `notification_template` is a JSON object that includes the keys relevant to
448460
449461
:::
450462
463+
### Show badge number on the iOS app
464+
465+
We can show the number of unread messages in the app's badge by adding the `badge` key to the `apn_template` using the JavaScript SDK like below:
466+
467+
```js
468+
const client = StreamChat.getInstance(‘api_key’, ‘api_secret’);
469+
470+
const apn_template = `{
471+
"aps" : {
472+
"alert": {
473+
"title": "{{ sender.name }} @ {{ channel.name }}",
474+
"body": "{{ truncate message.text 2000 }}"
475+
},
476+
"badge": {{ unread_count }},
477+
"mutable-content": 1,
478+
"category": "stream.chat"
479+
},
480+
}`;
481+
482+
client.updateAppSettings({
483+
firebase_config: {
484+
apn_template,
485+
}
486+
});
487+
```
488+
451489
### Make iOS Payload Data Only
452490
453491
If the iOS payload is made to be data only, then `setBackgroundMessageHandler` can be used to display notifications using Notifee. The payload can be customized using the JavaScript SDK like below:
454492
455493
```js
456494
const client = StreamChat.getInstance(‘api_key’, ‘api_secret’);
495+
457496
const apn_template = `{
458497
"aps": {
459-
"content-available": 1
498+
"content-available": 1
460499
}
461500
}`;
462501

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
id: 'audio-attachment'
3+
title: 'AudioAttachment'
4+
---
5+
6+
Component to render the Audio Attachment controls within the [MessageList](./message_list.mdx) and [MessageInput](./message_input.mdx).
7+
8+
This is the default component provided to the prop [`AudioAttachment`](../core-components/channel.mdx#audioattachment) on the `Channel` component.
9+
10+
## Props
11+
12+
### <div class="label required">required</div> **item**
13+
14+
| Type |
15+
| -------------------------------------------- |
16+
| object(duration, progress, paused, id, file) |
17+
18+
### <div class="label required">required</div> **onLoad**
19+
20+
| Type |
21+
| ------------------------------------------- |
22+
| `(index: string, duration: number) => void` |
23+
24+
### <div class="label required">required</div> **onProgress**
25+
26+
| Type |
27+
| ----------------------------------------------------------------- |
28+
| `(index: string, currentTime?: number, hasEnd?: boolean) => void` |
29+
30+
### <div class="label required">required</div> **onPlayPause**
31+
32+
| Type |
33+
| ------------------------------------------------- |
34+
| `(index: string, pausedStatus?: boolean) => void` |
35+
36+
### testID
37+
38+
| Type |
39+
| ------ |
40+
| string |

examples/ExpoMessaging/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ SPEC CHECKSUMS:
536536
EXSharing: 328228a9f14503cfdec68892796478a7a15b8d4d
537537
EXSplashScreen: 21669e598804ee810547dbb6692c8deb5dd8dbf3
538538
FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971
539-
FBReactNativeSpec: 244d2780a858c4f0972d17e1d6a0cad15e32fbbc
539+
FBReactNativeSpec: de8769e567b4274ba4a943fafbfe2f7e8fab89a8
540540
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
541541
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
542542
RCTRequired: d34bf57e17cb6e3b2681f4809b13843c021feb6c

examples/ExpoMessaging/yarn.lock

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,27 @@
18641864
xcode "^3.0.1"
18651865
xml2js "0.4.23"
18661866

1867+
"@expo/config-plugins@^4.0.14":
1868+
version "4.1.5"
1869+
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-4.1.5.tgz#9d357d2cda9c095e511b51583ede8a3b76174068"
1870+
integrity sha512-RVvU40RtZt12HavuDAe+LDIq9lHj7sheOfMEHdmpJ/uTA8pgvkbc56XF6JHQD+yRr6+uhhb+JnAasGq49dsQbw==
1871+
dependencies:
1872+
"@expo/config-types" "^45.0.0"
1873+
"@expo/json-file" "8.2.36"
1874+
"@expo/plist" "0.0.18"
1875+
"@expo/sdk-runtime-versions" "^1.0.0"
1876+
"@react-native/normalize-color" "^2.0.0"
1877+
chalk "^4.1.2"
1878+
debug "^4.3.1"
1879+
find-up "~5.0.0"
1880+
getenv "^1.0.0"
1881+
glob "7.1.6"
1882+
resolve-from "^5.0.0"
1883+
semver "^7.3.5"
1884+
slash "^3.0.0"
1885+
xcode "^3.0.1"
1886+
xml2js "0.4.23"
1887+
18671888
"@expo/config-types@^43.0.1":
18681889
version "43.0.1"
18691890
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-43.0.1.tgz#3e047dccb371741a540980eaff26fb0c95039c30"
@@ -1874,6 +1895,11 @@
18741895
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-44.0.0.tgz#d3480fe2c99f9e895dae4ebba58b74ed72d03e26"
18751896
integrity sha512-d+gpdKOAhqaD5RmcMzGgKzNtvE1w+GCqpFQNSXLliYlXjj+Tv0eL8EPeAdPtvke0vowpPFwd5McXLA90dgY6Jg==
18761897

1898+
"@expo/config-types@^45.0.0":
1899+
version "45.0.0"
1900+
resolved "https://registry.yarnpkg.com/@expo/config-types/-/config-types-45.0.0.tgz#963c2fdce8fbcbd003758b92ed8a25375f437ef6"
1901+
integrity sha512-/QGhhLWyaGautgEyU50UJr5YqKJix5t77ePTwreOVAhmZH+ff3nrrtYTTnccx+qF08ZNQmfAyYMCD3rQfzpiJA==
1902+
18771903
"@expo/[email protected]", "@expo/config@^6.0.6":
18781904
version "6.0.19"
18791905
resolved "https://registry.yarnpkg.com/@expo/config/-/config-6.0.19.tgz#26a7f7ffb6419cc6e6d4205b3c7764aa9ecb551a"
@@ -1957,6 +1983,15 @@
19571983
json5 "^1.0.1"
19581984
write-file-atomic "^2.3.0"
19591985

1986+
1987+
version "8.2.36"
1988+
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-8.2.36.tgz#62a505cb7f30a34d097386476794680a3f7385ff"
1989+
integrity sha512-tOZfTiIFA5KmMpdW9KF7bc6CFiGjb0xnbieJhTGlHrLL+ps2G0OkqmuZ3pFEXBOMnJYUVpnSy++52LFxvpa5ZQ==
1990+
dependencies:
1991+
"@babel/code-frame" "~7.10.4"
1992+
json5 "^1.0.1"
1993+
write-file-atomic "^2.3.0"
1994+
19601995
"@expo/metro-config@~0.2.6":
19611996
version "0.2.8"
19621997
resolved "https://registry.yarnpkg.com/@expo/metro-config/-/metro-config-0.2.8.tgz#c0fd56723e2fb9bb352e788e8f8fe0e218aaf663"
@@ -1986,6 +2021,15 @@
19862021
base64-js "^1.2.3"
19872022
xmlbuilder "^14.0.0"
19882023

2024+
2025+
version "0.0.18"
2026+
resolved "https://registry.yarnpkg.com/@expo/plist/-/plist-0.0.18.tgz#9abcde78df703a88f6d9fa1a557ee2f045d178b0"
2027+
integrity sha512-+48gRqUiz65R21CZ/IXa7RNBXgAI/uPSdvJqoN9x1hfL44DNbUoWHgHiEXTx7XelcATpDwNTz6sHLfy0iNqf+w==
2028+
dependencies:
2029+
"@xmldom/xmldom" "~0.7.0"
2030+
base64-js "^1.2.3"
2031+
xmlbuilder "^14.0.0"
2032+
19892033
"@expo/prebuild-config@^3.0.15":
19902034
version "3.1.0"
19912035
resolved "https://registry.yarnpkg.com/@expo/prebuild-config/-/prebuild-config-3.1.0.tgz#9fa10f12745ecaa6d3d4957ba97142edb8747a85"
@@ -3009,15 +3053,10 @@ camelcase@^6.0.0:
30093053
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
30103054
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
30113055

3012-
caniuse-lite@^1.0.30001219:
3013-
version "1.0.30001232"
3014-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001232.tgz#2ebc8b6a77656fd772ab44a82a332a26a17e9527"
3015-
integrity sha512-e4Gyp7P8vqC2qV2iHA+cJNf/yqUKOShXQOJHQt81OHxlIZl/j/j3soEA0adAQi8CPUQgvOdDENyQ5kd6a6mNSg==
3016-
3017-
caniuse-lite@^1.0.30001317:
3018-
version "1.0.30001317"
3019-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001317.tgz#0548fb28fd5bc259a70b8c1ffdbe598037666a1b"
3020-
integrity sha512-xIZLh8gBm4dqNX0gkzrBeyI86J2eCjWzYAs40q88smG844YIrN4tVQl/RhquHvKEKImWWFIVh1Lxe5n1G/N+GQ==
3056+
caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001317:
3057+
version "1.0.30001341"
3058+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001341.tgz"
3059+
integrity sha512-2SodVrFFtvGENGCv0ChVJIDQ0KPaS1cg7/qtfMaICgeMolDdo/Z2OD32F0Aq9yl6F4YFwGPBS5AaPqNYiW4PoA==
30213060

30223061
capture-exit@^2.0.0:
30233062
version "2.0.0"
@@ -3682,6 +3721,13 @@ expo-asset@~8.4.6:
36823721
path-browserify "^1.0.0"
36833722
url-parse "^1.4.4"
36843723

3724+
expo-av@^11.2.3:
3725+
version "11.2.3"
3726+
resolved "https://registry.yarnpkg.com/expo-av/-/expo-av-11.2.3.tgz#254242dae76e3cd60ef9d9c33618e4a12d37aa33"
3727+
integrity sha512-ptTe96s33Ct0eOsOmNTvtaWFx4B0SDkQmDfPbiuX/C2afqbLQf8geEopw7BRO8ZZl7Qe3qBMH6YLHXKTkZkTyQ==
3728+
dependencies:
3729+
"@expo/config-plugins" "^4.0.14"
3730+
36853731
expo-av@~10.2.0:
36863732
version "10.2.1"
36873733
resolved "https://registry.yarnpkg.com/expo-av/-/expo-av-10.2.1.tgz#c08bce464d673d0e90c68cac082bfb75a9437f25"

examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
CLANG_ENABLE_MODULES = YES;
515515
CODE_SIGN_ENTITLEMENTS = SampleApp/SampleAppDebug.entitlements;
516516
CODE_SIGN_IDENTITY = "iPhone Developer";
517-
CURRENT_PROJECT_VERSION = 141;
517+
CURRENT_PROJECT_VERSION = 147;
518518
DEVELOPMENT_TEAM = EHV7XZLAHA;
519519
ENABLE_BITCODE = NO;
520520
INFOPLIST_FILE = SampleApp/Info.plist;
@@ -545,7 +545,7 @@
545545
CODE_SIGN_ENTITLEMENTS = SampleApp/SampleAppRelease.entitlements;
546546
CODE_SIGN_IDENTITY = "iPhone Distribution";
547547
CODE_SIGN_STYLE = Manual;
548-
CURRENT_PROJECT_VERSION = 141;
548+
CURRENT_PROJECT_VERSION = 147;
549549
DEVELOPMENT_TEAM = EHV7XZLAHA;
550550
INFOPLIST_FILE = SampleApp/Info.plist;
551551
LD_RUNPATH_SEARCH_PATHS = (

0 commit comments

Comments
 (0)