Skip to content

Commit

Permalink
Fixed userid bug in prebuilt (#1601)
Browse files Browse the repository at this point in the history
* Fixed userid bug in prebuilt

* Updated intial userName text

* Added userId

* released sample app version 1.5.63 (363) 🍀

* Update packages/hmssdk_flutter/example/lib/main.dart

Co-authored-by: ygit <[email protected]>

---------

Co-authored-by: ygit <[email protected]>
  • Loading branch information
Decoder07 and ygit authored Oct 9, 2023
1 parent f82a419 commit cc26baf
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ class MeetingStore extends ChangeNotifier
if (roomConfig == null) {
//We use this to get the auth token from room code
dynamic tokenData = await _hmsSDKInteractor.getAuthTokenByRoomCode(
roomCode: Constant.roomCode, endPoint: Constant.tokenEndPoint);
userId: Constant.prebuiltOptions?.userId,
roomCode: Constant.roomCode,
endPoint: Constant.tokenEndPoint);

///If the tokenData is String then we set the authToken in the roomConfig
///and then we join the room
Expand Down
3 changes: 2 additions & 1 deletion packages/hms_room_kit/lib/src/preview/preview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ class PreviewPage extends StatefulWidget {

class _PreviewPageState extends State<PreviewPage> {
late MeetingStore _meetingStore;
TextEditingController nameController = TextEditingController();
late TextEditingController nameController;
bool isJoiningRoom = false;
bool isHLSStarting = false;

@override
void initState() {
super.initState();
nameController = TextEditingController(text: widget.name);
}

@override
Expand Down
4 changes: 3 additions & 1 deletion packages/hms_room_kit/lib/src/preview/preview_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ class PreviewStore extends ChangeNotifier
{required String userName, required String roomCode}) async {
//We use this to get the auth token from room code
dynamic tokenData = await hmsSDKInteractor.getAuthTokenByRoomCode(
roomCode: roomCode, endPoint: Constant.tokenEndPoint);
userId: Constant.prebuiltOptions?.userId,
roomCode: roomCode,
endPoint: Constant.tokenEndPoint);

if ((tokenData is String?) && tokenData != null) {
roomConfig = HMSConfig(
Expand Down
4 changes: 2 additions & 2 deletions packages/hms_room_kit/lib/src/screen_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _ScreenControllerState extends State<ScreenController> {
await _hmsSDKInteractor.build();
_previewStore = PreviewStore(hmsSDKInteractor: _hmsSDKInteractor);
HMSException? ans = await _previewStore.startPreview(
userName: "", roomCode: Constant.roomCode);
userName: widget.options?.userName??"", roomCode: Constant.roomCode);

///If preview fails then we show the error dialog
///with the error message and description
Expand Down Expand Up @@ -156,7 +156,7 @@ class _ScreenControllerState extends State<ScreenController> {
value: _previewStore,
child: PreviewPage(
roomCode: Constant.roomCode,
name: "",
name: widget.options?.userName??"",
options: widget.options,
))
: PreviewPermissions(
Expand Down
4 changes: 2 additions & 2 deletions packages/hmssdk_flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
applicationId "live.hms.flutter"
minSdkVersion 21
targetSdkVersion 33
versionCode 361
versionName "1.5.61"
versionCode 362
versionName "1.5.62"
}

signingConfigs {
Expand Down
4 changes: 2 additions & 2 deletions packages/hmssdk_flutter/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.62</string>
<string>1.5.63</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -48,7 +48,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>362</string>
<string>363</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
1 change: 1 addition & 0 deletions packages/hmssdk_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class _HomePageState extends State<HomePage> {
roomCode: Constant.roomCode,
options: HMSPrebuiltOptions(
endPoints: endPoints,
userId: "user_flutter", // pass your custom unique user identifier here
iOSScreenshareConfig: HMSIOSScreenshareConfig(
appGroup: "group.flutterhms",
preferredExtension:
Expand Down

0 comments on commit cc26baf

Please sign in to comment.