Skip to content

Commit cb6587b

Browse files
authored
chore(dogfooding): enhanced dogfooding readme (#765)
* enhanced dogfooding readme * example app readme
1 parent ba031c0 commit cb6587b

File tree

10 files changed

+177
-60
lines changed

10 files changed

+177
-60
lines changed

dogfooding/README.md

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,87 @@
1-
# dogfooding
1+
# Dogfooding App
22

3-
A new Flutter project.
3+
The Dogfooding App is built using the [Stream Video Flutter](https://pub.dev/packages/stream_video_flutter) package, designed to showcase both core and advanced features of the package. It also serves as an internal testing tool for the Stream team.
4+
5+
For a more basic example of how to use the Stream Video Flutter package, check out the [example app here](https://github.com/GetStream/stream-video-flutter/tree/main/packages/stream_video_flutter/example).
6+
7+
## Features
8+
9+
- **Video Calls**: Test various aspects of video call functionality.
10+
- Create or join a video meeting.
11+
- Make direct calls to other users with ringing.
12+
13+
- **Screen Sharing**: Experience seamless screen sharing between participants.
14+
15+
- **Picture-in-Picture (PiP)**: Test Picture-in-Picture mode on both iOS and Android devices.
16+
17+
- **Chat Integration**: Send and receive messages during calls.
18+
19+
- **Testing Ground**: Used by Stream developers for feature validation and bug testing.
420

521
## Getting Started
622

7-
This project is a starting point for a Flutter application.
23+
To set up and run the app, follow these steps:
24+
25+
1. Clone the repo and install the dependencies
26+
First, clone the repository to your local machine and install the required Flutter packages:
27+
28+
```bash
29+
git clone https://github.com/GetStream/stream-video-flutter.git
30+
cd stream-video-flutter/dogfooding
31+
flutter pub get
32+
```
33+
34+
2. (iOS setup) Open iOS project in Xcode
35+
36+
```bash
37+
cd ios
38+
open Runner.xcworkspace
39+
```
40+
41+
3. (iOS setup) Update the Bundle Identifier and Configure Signing
42+
43+
- In Xcode, go to the Signing & Capabilities tab.
44+
- Under Team, select your own development team.
45+
- Update the bundle identifier for both Runner and ScreenSharing targets to something unique:
46+
- Example: `com.yourname.StreamDogfooding`
47+
- Example (ScreenSharing): com.yourname.StreamDogfooding.ScreenSharing
48+
- Update the App Group for both targets:
49+
- Remove the existing group.
50+
- Create a new app group based on your updated bundle identifier.
51+
- Example: `group.com.yourname.StreamDogfooding`
52+
53+
4. Run the app
54+
Once the setup is complete, you can run the app using Flutter:
55+
56+
```bash
57+
## Ensure you're in the dogfooding directory
58+
flutter run
59+
```
60+
61+
The app should now launch on your connected device or simulator.
62+
63+
:::note
64+
When logging in with an email address, note that the user_id for the created user will automatically replace the `@` and `.` characters with underscores (`_`).
65+
66+
For example, if you log in with `[email protected]`, the corresponding `user_id` will be `test_test_com`.
67+
68+
This is crucial to keep in mind, especially when testing direct calls, as you'll need to reference the correct `user_id`.
69+
:::
70+
71+
## License
72+
73+
```
74+
Copyright (c) 2014-2024 Stream.io Inc. All rights reserved.
875
9-
A few resources to get you started if this is your first Flutter project:
76+
Licensed under the Stream License;
77+
you may not use this file except in compliance with the License.
78+
You may obtain a copy of the License at
1079
11-
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
80+
https://github.com/GetStream/stream-video-android/blob/main/LICENSE
1381
14-
For help getting started with Flutter development, view the
15-
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
82+
Unless required by applicable law or agreed to in writing, software
83+
distributed under the License is distributed on an "AS IS" BASIS,
84+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
85+
See the License for the specific language governing permissions and
86+
limitations under the License.
87+
```

dogfooding/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,9 @@
574574
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
575575
CODE_SIGN_ENTITLEMENTS = ScreenSharing/ScreenSharing.entitlements;
576576
CODE_SIGN_IDENTITY = "Apple Development";
577-
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
578-
CODE_SIGN_STYLE = Manual;
577+
CODE_SIGN_STYLE = Automatic;
579578
CURRENT_PROJECT_VERSION = 1;
580579
DEVELOPMENT_TEAM = "";
581-
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = EHV7XZLAHA;
582580
ENABLE_USER_SCRIPT_SANDBOXING = YES;
583581
GCC_C_LANGUAGE_STANDARD = gnu17;
584582
GENERATE_INFOPLIST_FILE = YES;
@@ -598,7 +596,6 @@
598596
PRODUCT_BUNDLE_IDENTIFIER = io.getstream.video.flutter.dogfooding.ScreenSharing;
599597
PRODUCT_NAME = "$(TARGET_NAME)";
600598
PROVISIONING_PROFILE_SPECIFIER = "";
601-
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.getstream.video.flutter.dogfooding.ScreenSharing";
602599
SKIP_INSTALL = YES;
603600
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
604601
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -814,7 +811,7 @@
814811
CODE_SIGN_IDENTITY = "Apple Development";
815812
CODE_SIGN_STYLE = Automatic;
816813
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
817-
DEVELOPMENT_TEAM = EHV7XZLAHA;
814+
DEVELOPMENT_TEAM = "";
818815
ENABLE_BITCODE = NO;
819816
INFOPLIST_FILE = Runner/Info.plist;
820817
INFOPLIST_KEY_CFBundleDisplayName = "Flutter Dogfooding";

dogfooding/lib/app/app_content.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ class _StreamDogFoodingAppContentState
152152
},
153153
),
154154
);
155+
156+
// UNCOMMENT THIS TO SHOW IN-APP INCOMING SCREEN
157+
// _compositeSubscription.add(streamVideo.state.incomingCall.listen((call) {
158+
// if (call == null) return;
159+
160+
// // Navigate to the call screen.
161+
// final extra = (
162+
// call: call,
163+
// connectOptions: null,
164+
// );
165+
166+
// _router.push(CallRoute($extra: extra).location, extra: extra);
167+
// }));
155168
}
156169

157170
_observeFcmMessages() {

dogfooding/lib/di/injector.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Future<void> _backgroundVoipCallHandler() async {
3838
user: User(info: userCredentials.userInfo),
3939
userToken: userCredentials.token.rawValue,
4040
options: const StreamVideoOptions(
41-
logPriority: Priority.info,
41+
logPriority: Priority.verbose,
4242
muteAudioWhenInBackground: true,
4343
muteVideoWhenInBackground: true,
4444
),
@@ -192,7 +192,7 @@ StreamVideo _initStreamVideo(
192192
user: user,
193193
tokenLoader: tokenLoader,
194194
options: const StreamVideoOptions(
195-
logPriority: Priority.info,
195+
logPriority: Priority.verbose,
196196
muteAudioWhenInBackground: true,
197197
muteVideoWhenInBackground: true,
198198
),

dogfooding/lib/screens/call_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class _CallScreenState extends State<CallScreen> {
246246
call: call,
247247
localParticipant: localParticipant,
248248
screenShareConstraints: const ScreenShareConstraints(
249-
useiOSBroadcastExtension: false,
249+
useiOSBroadcastExtension: true,
250250
),
251251
enabledScreenShareBackgroundColor:
252252
AppColorPalette.primary,

dogfooding/pubspec.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ dependencies:
3636
stream_video_screen_sharing: ^0.5.3
3737
uni_links: ^0.5.1
3838

39+
dependency_overrides:
40+
stream_video:
41+
path: ../packages/stream_video
42+
stream_video_flutter:
43+
path: ../packages/stream_video_flutter
44+
stream_video_push_notification:
45+
path: ../packages/stream_video_push_notification
46+
stream_video_screen_sharing:
47+
path: ../packages/stream_video_screen_sharing
48+
3949
dev_dependencies:
4050
build_runner: ^2.4.6
4151
envied_generator: ^0.3.0+3
Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,52 @@
1-
# example
1+
# Stream Video Flutter Example App
22

3-
An example project for the stream_video_flutter package.
3+
This is an example app built using the [Stream Video Flutter](https://pub.dev/packages/stream_video_flutter) package, designed to showcase both core features of the package. It's a great starting point to explore how the Stream Video SDK works in real-world scenarios.
4+
5+
For a more advanced example of how to use the Stream Video Flutter package, check out the [dogfooding app here](https://github.com/GetStream/stream-video-flutter/tree/main/dogfooding).
6+
7+
## Features
8+
9+
- **Video Calls**: Test various aspects of video call functionality.
10+
- Create or join a video meeting (with or without a Lobby).
11+
- Make direct calls to other users (without CallKit integration - only in-app ringing screen)
412

513
## Getting Started
614

7-
This project is a starting point for a Flutter application.
15+
To set up and run the app, follow these steps:
16+
17+
1. Clone the repo and install the dependencies
18+
First, clone the repository to your local machine and install the required Flutter packages:
19+
20+
```bash
21+
git clone https://github.com/GetStream/stream-video-flutter.git
22+
cd stream-video-flutter/packages/stream_video_flutter/example
23+
flutter pub get
24+
```
25+
26+
2. Run the app
27+
Once the setup is complete, you can run the app using Flutter:
28+
29+
```bash
30+
## Ensure you're in the example directory
31+
flutter run
32+
```
33+
34+
The app should now launch on your connected device or simulator.
35+
36+
## License
37+
38+
```
39+
Copyright (c) 2014-2024 Stream.io Inc. All rights reserved.
840
9-
A few resources to get you started if this is your first Flutter project:
41+
Licensed under the Stream License;
42+
you may not use this file except in compliance with the License.
43+
You may obtain a copy of the License at
1044
11-
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
45+
https://github.com/GetStream/stream-video-android/blob/main/LICENSE
1346
14-
For help getting started with Flutter development, view the
15-
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
47+
Unless required by applicable law or agreed to in writing, software
48+
distributed under the License is distributed on an "AS IS" BASIS,
49+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50+
See the License for the specific language governing permissions and
51+
limitations under the License.
52+
```

packages/stream_video_flutter/example/lib/app.dart

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import 'dart:async';
44
import 'dart:convert';
55

6+
import 'package:example/stream_video_sdk.dart';
67
import 'package:firebase_core/firebase_core.dart';
78
import 'package:firebase_messaging/firebase_messaging.dart';
89
import 'package:flutter/material.dart';
@@ -30,58 +31,58 @@ Future<void> _onFirebaseBackgroundMessage(RemoteMessage message) async {
3031
final authRepository = await AuthRepository.getInstance();
3132
final credentials = authRepository.getCredentials();
3233
if (credentials == null) return;
33-
/*final client = await StreamVideoSdk.initialize(
34+
35+
final client = await StreamVideoSdk.initialize(
3436
apiKey: credentials.apiKey,
3537
user: credentials.userInfo,
3638
userToken: credentials.token,
3739
);
38-
final handled = await client.handleVoipPushNotification(message.data);
39-
if (!handled) {
40-
}
41-
*/
4240

41+
client.observeCallDeclinedCallKitEvent();
42+
43+
await _handlePushNotification(message);
44+
45+
await StreamVideo.reset(disconnect: true);
46+
}
47+
48+
Future<bool> _handlePushNotification(RemoteMessage message) async {
4349
try {
4450
final payload = message.data;
4551
// Only handle messages from stream.video
4652
final sender = payload['sender'] as String?;
4753
if (sender != 'stream.video') {
4854
debugPrint('Not a stream.video message');
49-
return;
55+
return false;
5056
}
5157

5258
// Only handle ringing calls.
5359
final type = payload['type'] as String?;
5460
if (type != 'call.ring' && type != 'call.missed') {
5561
debugPrint('Not a call.ring or call.missed message');
56-
return;
62+
return false;
5763
}
5864

5965
// Return if the payload does not contain a call cid.
6066
final callCid = payload['call_cid'] as String?;
6167
if (callCid == null) {
6268
debugPrint('No call cid in payload');
63-
return;
69+
return false;
6470
}
6571

66-
final receiverId = payload['receiver_id'] as String?;
67-
if (receiverId != credentials.userInfo.id) {
68-
debugPrint(
69-
'Not a call for this user($receiverId != ${credentials.userInfo.id})',
70-
);
71-
return;
72-
}
7372
final createdByDisplayName = payload['created_by_display_name'] as String?;
7473
if (createdByDisplayName == null) {
7574
debugPrint('No created_by_display_name in payload');
76-
return;
75+
return false;
7776
}
7877

7978
await showNotification(callCid, type, createdByDisplayName);
79+
return true;
8080
} catch (e, stk) {
8181
debugPrint('Error handling remote message: $e');
8282
debugPrint(stk.toString());
83+
84+
return false;
8385
}
84-
await StreamVideo.reset(disconnect: true);
8586
}
8687

8788
final ln.FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
@@ -176,7 +177,7 @@ class _MyAppState extends State<MyApp> {
176177

177178
Future<bool> _onFirebaseForegroundMessage(RemoteMessage message) async {
178179
debugPrint('[onFirebaseForegroundMessage] message: ${message.toMap()}');
179-
return StreamVideo.instance.handleVoipPushNotification(message.data);
180+
return _handlePushNotification(message);
180181
}
181182

182183
@override
@@ -191,7 +192,7 @@ class _MyAppState extends State<MyApp> {
191192
final lightAppTheme = StreamVideoTheme.light();
192193

193194
return MaterialApp(
194-
title: 'Stream Video UI Example',
195+
title: 'Stream Video Example',
195196
theme: ThemeData(
196197
textTheme: GoogleFonts.robotoMonoTextTheme(),
197198
extensions: <ThemeExtension<dynamic>>[lightAppTheme],

0 commit comments

Comments
 (0)