Skip to content

Commit

Permalink
Introducing pcode
Browse files Browse the repository at this point in the history
  • Loading branch information
fareed069417 committed Dec 14, 2022
1 parent 88c172d commit 55490cf
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const conferenceOptions = {
avatar: 'https://picsum.photos/200',
}
token: '',
pcode: '',
audioMuted: false,
videoMuted: false
};
Expand Down Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,6 +27,10 @@ public String getToken() {
return token;
}

public String getPcode() {
return pcode;
}

public Bundle getFeatureFlags() {
return featureFlags;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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());
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions ios/MeetHourUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"contributors": [],
"homepage": "https://github.com/v-empower/react-native-meet-hour-sdk",
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface MeetHourConferenceOptions {
serverUrl?: string;
userInfo?: MeetHourUserInfo;
token?: string;
pcode?: string;
subject?: string;
audioOnly?: boolean;
audioMuted?: boolean;
Expand Down

0 comments on commit 55490cf

Please sign in to comment.