From 55490cfe4d2a8eb47e2093b28553704e18f5fefa Mon Sep 17 00:00:00 2001 From: fareed069417 Date: Wed, 14 Dec 2022 19:00:54 +0530 Subject: [PATCH] Introducing pcode --- README.md | 4 +++- .../meethour/io/react/sdk/MeetHourModule.java | 4 ++++ .../io/react/sdk/MeetHourViewManager.java | 4 ++++ .../sdk/RNMeetHourConferenceOptions.java | 19 +++++++++++++++++++ ios/MeetHourUtil.swift | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/types.ts | 1 + 8 files changed, 38 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index deeb5ca..41dfc58 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ const conferenceOptions = { avatar: 'https://picsum.photos/200', } token: '', + pcode: '', audioMuted: false, videoMuted: false }; @@ -310,7 +311,8 @@ buildscript { | ------------ | --------- | ------------------- | --------------------------------------------------------------------------------------------------------------- | | room | string | required | Room name for Meet Hour | | serverUrl | string | https://meethour.io | Valid server URL | -| token | string | "" | JWT token | +| token | string | "" | JWT token +| pcode | string | "" | Password of meeting to be passed dynamically | | subject | string | "" | Conference subject (will change the global subject for all participants) | | audioOnly | boolean | false | Controls whether the participant will join the conference in audio-only mode (no video is sent or recieved) | | audioMuted | boolean | false | Controls whether the participant will join the conference with the microphone muted | diff --git a/android/src/main/java/go/meethour/io/react/sdk/MeetHourModule.java b/android/src/main/java/go/meethour/io/react/sdk/MeetHourModule.java index ffdff42..f48a86e 100644 --- a/android/src/main/java/go/meethour/io/react/sdk/MeetHourModule.java +++ b/android/src/main/java/go/meethour/io/react/sdk/MeetHourModule.java @@ -93,6 +93,10 @@ public void launchMeetHourView(ReadableMap options, Promise onConferenceTerminat builder.setToken(options.getString("token")); } + if (options.hasKey("pcode")) { + builder.setPcode(options.getString("pcode")); + } + // Set built-in config overrides if (options.hasKey("subject")) { builder.setSubject(options.getString("subject")); diff --git a/android/src/main/java/go/meethour/io/react/sdk/MeetHourViewManager.java b/android/src/main/java/go/meethour/io/react/sdk/MeetHourViewManager.java index c9941a5..e9e9a15 100644 --- a/android/src/main/java/go/meethour/io/react/sdk/MeetHourViewManager.java +++ b/android/src/main/java/go/meethour/io/react/sdk/MeetHourViewManager.java @@ -113,6 +113,10 @@ public void setOptions(RNMeetHourView view, ReadableMap options) { builder.setToken(options.getString("token")); } + if (options.hasKey("pcode")) { + builder.setPcode(options.getString("pcode")); + } + // Set built-in config overrides if (options.hasKey("subject")) { builder.setSubject(options.getString("subject")); diff --git a/android/src/main/java/go/meethour/io/react/sdk/RNMeetHourConferenceOptions.java b/android/src/main/java/go/meethour/io/react/sdk/RNMeetHourConferenceOptions.java index 925889b..fcbeba9 100644 --- a/android/src/main/java/go/meethour/io/react/sdk/RNMeetHourConferenceOptions.java +++ b/android/src/main/java/go/meethour/io/react/sdk/RNMeetHourConferenceOptions.java @@ -10,6 +10,7 @@ public class RNMeetHourConferenceOptions implements Parcelable { private URL serverURL; private String room; private String token; + private String pcode; private Bundle config; private Bundle featureFlags; private RNMeetHourUserInfo userInfo; @@ -26,6 +27,10 @@ public String getToken() { return token; } + public String getPcode() { + return pcode; + } + public Bundle getFeatureFlags() { return featureFlags; } @@ -38,6 +43,7 @@ public static class Builder { private URL serverURL; private String room; private String token; + private String pcode; private Bundle config; private Bundle featureFlags; @@ -73,6 +79,12 @@ public Builder setToken(String token) { return this; } + public Builder setPcode(String pcode) { + this.pcode = pcode; + + return this; + } + public Builder setAudioMuted(boolean audioMuted) { setConfigOverride("startWithAudioMuted", audioMuted); @@ -151,6 +163,7 @@ public RNMeetHourConferenceOptions build() { options.serverURL = this.serverURL; options.room = this.room; options.token = this.token; + options.pcode = this.pcode; options.config = this.config; options.featureFlags = this.featureFlags; options.userInfo = this.userInfo; @@ -166,6 +179,7 @@ private RNMeetHourConferenceOptions(Parcel in) { serverURL = (URL) in.readSerializable(); room = in.readString(); token = in.readString(); + pcode = in.readString(); config = in.readBundle(); featureFlags = in.readBundle(); userInfo = new RNMeetHourUserInfo(in.readBundle()); @@ -197,6 +211,10 @@ Bundle asProps() { urlProps.putString("jwt", token); } + if (pcode != null) { + urlProps.putString("pcode", pcode); + } + if (userInfo != null) { props.putBundle("userInfo", userInfo.asBundle()); } @@ -224,6 +242,7 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeSerializable(serverURL); dest.writeString(room); dest.writeString(token); + dest.writeString(pcode); dest.writeBundle(config); dest.writeBundle(featureFlags); dest.writeBundle(userInfo != null ? userInfo.asBundle() : new Bundle()); diff --git a/ios/MeetHourUtil.swift b/ios/MeetHourUtil.swift index 8c59ba4..d60dc34 100644 --- a/ios/MeetHourUtil.swift +++ b/ios/MeetHourUtil.swift @@ -34,6 +34,10 @@ struct MeetHourUtil { builder.token = token } + if let pcode = options["pcode"] as? String { + builder.pcode = pcode + } + // Set built-in config overrides if let subject = options["subject"] as? String { builder.subject = subject diff --git a/package-lock.json b/package-lock.json index 485258d..fa5b089 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-meet-hour-sdk", - "version": "3.0.14", + "version": "3.0.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-native-meet-hour-sdk", - "version": "3.0.14", + "version": "3.0.15", "devDependencies": { "@commitlint/config-conventional": "^11.0.0", "@react-native-community/eslint-config": "^2.0.0", diff --git a/package.json b/package.json index c9934c0..9379858 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-meet-hour-sdk", "description": "Meet Hour SDK wrapper for React Native.", - "version": "3.0.14", + "version": "3.0.15", "author": "MeetHour, LLC ", "contributors": [], "homepage": "https://github.com/v-empower/react-native-meet-hour-sdk", diff --git a/src/types.ts b/src/types.ts index facb180..d621d23 100644 --- a/src/types.ts +++ b/src/types.ts @@ -12,6 +12,7 @@ export interface MeetHourConferenceOptions { serverUrl?: string; userInfo?: MeetHourUserInfo; token?: string; + pcode?: string; subject?: string; audioOnly?: boolean; audioMuted?: boolean;