MediaSFU React Native (Expo)
    Preparing search index...

    Variable PollModalConst

    PollModal: React.FC<PollModalOptions> = ...

    PollModal - Interactive polling and voting interface

    PollModal is a React Native component that provides a complete polling system for meetings. Hosts/co-hosts can create polls with multiple options, participants can vote, and results are displayed in real-time with vote counts and percentages.

    Key Features:

    • Poll creation with custom question and multiple options (host/co-host only)
    • Real-time voting for participants
    • Live vote count and percentage display
    • Poll history view (all active and inactive polls)
    • End poll functionality (host/co-host only)
    • Single vote per participant enforcement
    • Socket.io synchronization for instant updates
    • Position-configurable modal (5 positions)

    UI Customization: This component can be replaced via uiOverrides.pollModal to provide a completely custom polling interface.

    Configuration options

    Rendered poll modal

    // Host creating and managing polls
    import React, { useState } from 'react';
    import { PollModal } from 'mediasfu-reactnative-expo';
    import { io } from 'socket.io-client';

    const socket = io('https://your-server.com');
    const [showPolls, setShowPolls] = useState(false);

    const activePoll = {
    id: 'poll-1',
    question: 'What time works best?',
    options: ['Morning', 'Afternoon', 'Evening'],
    status: 'active',
    voters: { 'user1': 0, 'user2': 2 },
    votes: [1, 0, 1],
    };

    return (
    <PollModal
    isPollModalVisible={showPolls}
    onClose={() => setShowPolls(false)}
    member="host-user"
    islevel="2" // Host - can create/end polls
    polls={[activePoll]}
    poll={activePoll}
    socket={socket}
    roomName="meeting-room-123"
    handleCreatePoll={handleCreatePoll}
    handleEndPoll={handleEndPoll}
    handleVotePoll={handleVotePoll}
    updateIsPollModalVisible={setShowPolls}
    showAlert={showCustomAlert}
    />
    );
    // Participant voting in polls
    return (
    <PollModal
    isPollModalVisible={isVisible}
    onClose={handleClose}
    member="participant-user"
    islevel="0" // Participant - can only vote
    polls={allPolls}
    poll={currentPoll}
    socket={socketConnection}
    roomName={roomId}
    handleCreatePoll={handleCreatePoll}
    handleEndPoll={handleEndPoll}
    handleVotePoll={handleVotePoll}
    updateIsPollModalVisible={setIsVisible}
    position="center"
    backgroundColor="#e8f5e9"
    />
    );
    // Using custom UI via uiOverrides
    const config = {
    uiOverrides: {
    pollModal: {
    component: MyCustomPollInterface,
    injectedProps: {
    theme: 'dark',
    allowAnonymousVoting: false,
    },
    },
    },
    };

    return <MyMeetingComponent config={config} />;