This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [teamsMeetingLink, setTeamsMeetingLink] = useState<string>(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install @azure/communication-common @azure/communication-react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace '' with the ACS user identity value | |
const [userId, setUserId] = useState<string>(''); | |
// Replace '' with the ACS token value | |
const [token, setToken] = useState<string>(''); | |
// Replace '' with the Teams meeting link value | |
const [teamsMeetingLink, setTeamsMeetingLink] = useState<string>(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (callAdapter) { | |
return ( | |
<div> | |
<h1>Contact Customer Service</h1> | |
<div className="wrapper"> | |
<CallComposite adapter={callAdapter} /> | |
</div> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (callAdapter) { | |
return ( | |
<div> | |
<h1>Contact Customer Service</h1> | |
<div className="wrapper"> | |
<CallComposite | |
adapter={callAdapter} | |
/> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const callAdapterArgs = useMemo(() => { | |
if (userId && credential && displayName && teamsMeetingLink) { | |
return { | |
userId: fromFlatCommunicationIdentifier(userId) | |
as CommunicationUserIdentifier, | |
displayName, | |
credential, | |
locator: { meetingLink: teamsMeetingLink }, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
const init = async () => { | |
setMessage('Getting Teams meeting link...'); | |
//Call Azure Function to get the meeting link | |
res = await fetch(process.env.REACT_APP_TEAMS_MEETING_FUNCTION as string); | |
let link = await res.text(); | |
setTeamsMeetingLink(link); | |
console.log('Teams meeting link', link); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const newMeeting = `/users/${userId}/calendar/events`; | |
const event = { | |
subject: 'Customer Service Meeting', | |
start: { | |
dateTime: startTime, | |
timeZone: 'UTC' | |
}, | |
end: { | |
dateTime: endTime, |