How to use the react-native-im-easemob.IMConstant.MessageType function in react-native-im-easemob

To help you get started, we’ve selected a few react-native-im-easemob examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaoxiaosong / react-native-im / plugin / easemob / MoreBoardAction.ts View on Github external
export default function () {
    type ActionItem = [string, Typings.Action.MoreBoard.GeneralResult, number];
    const moreboardActions: ActionItem[] = [
        ['photo', StandardMessage.MoreBoard.takePhoto, IMConstant.MessageType.image],
        ['camera', StandardMessage.MoreBoard.takeCamera, IMConstant.MessageType.image],
        ['video', StandardMessage.MoreBoard.takeVideo, IMConstant.MessageType.video],
        ['location', StandardMessage.MoreBoard.chooseLocation, IMConstant.MessageType.location],
    ];
    moreboardActions.forEach(([action, handle, messageType]) => {
        Model.Action.MoreBoard.registerDefault(action, {...handle, messageType});
    });
    // 默认值设置
    Delegate.component.MoreBoard.defaultProps.getItems = () =>
        ['photo', 'camera', 'video', 'location'];
}
github gaoxiaosong / react-native-im / plugin / easemob / MoreBoardAction.ts View on Github external
export default function () {
    type ActionItem = [string, Typings.Action.MoreBoard.GeneralResult, number];
    const moreboardActions: ActionItem[] = [
        ['photo', StandardMessage.MoreBoard.takePhoto, IMConstant.MessageType.image],
        ['camera', StandardMessage.MoreBoard.takeCamera, IMConstant.MessageType.image],
        ['video', StandardMessage.MoreBoard.takeVideo, IMConstant.MessageType.video],
        ['location', StandardMessage.MoreBoard.chooseLocation, IMConstant.MessageType.location],
    ];
    moreboardActions.forEach(([action, handle, messageType]) => {
        Model.Action.MoreBoard.registerDefault(action, {...handle, messageType});
    });
    // 默认值设置
    Delegate.component.MoreBoard.defaultProps.getItems = () =>
        ['photo', 'camera', 'video', 'location'];
}
github gaoxiaosong / react-native-im / plugin / easemob / DisplayAction.ts View on Github external
export default function () {
    const displayActions = [
        [[], StandardMessage.Display.GeneralBubble],
        [IMConstant.MessageType.text, StandardMessage.Display.TextBubble],
        [IMConstant.MessageType.image, StandardMessage.Display.ImageBubble],
        [IMConstant.MessageType.location, StandardMessage.Display.LocationBubble],
        [IMConstant.MessageType.video, StandardMessage.Display.VideoBubble],
        [IMConstant.MessageType.voice, StandardMessage.Display.VoiceBubble],
    ];
    displayActions.forEach(function ([messageType, handleFunc]) {
        Model.Action.Display.registerDefault(messageType, handleFunc);
    });
}
github gaoxiaosong / react-native-im / plugin / easemob / AbstractAction.ts View on Github external
export default function () {
    const abstractActions = [
        [[], () => ''],
        [IMConstant.MessageType.text, StandardMessage.Abstract.TextAbstract],
        [IMConstant.MessageType.image, StandardMessage.Abstract.ImageAbstract],
        [IMConstant.MessageType.location, StandardMessage.Abstract.LocationAbstract],
        [IMConstant.MessageType.video, StandardMessage.Abstract.VideoAbstract],
        [IMConstant.MessageType.voice, StandardMessage.Abstract.VoiceAbstract],
        [IMConstant.MessageType.file, StandardMessage.Abstract.FileAbstract],
    ];
    abstractActions.forEach(function ([messageType, abstractFunc]) {
        Model.Action.Abstract.registerDefault(messageType, abstractFunc);
    });
}
github gaoxiaosong / react-native-im / plugin / easemob / SendAction.ts View on Github external
export default function () {
    type ActionItem = [
        number,
        (params: Typings.Action.Send.Params) => Typings.Action.Send.Result
        ];
    const sendActions: ActionItem[] = [
        [IMConstant.MessageType.text, sendText],
        [IMConstant.MessageType.image, sendImage],
        [IMConstant.MessageType.location, sendLocation],
        [IMConstant.MessageType.video, sendVideo],
        [IMConstant.MessageType.voice, sendVoice],
        [IMConstant.MessageType.file, sendFile],
    ];
    sendActions.forEach(([type, func]) => {
        Model.Action.Send.registerSpecial(
            type,
            (_?: Typings.Action.Send.State) => true,
            func,
            Specials.PRIORITY.LOW
        );
    });
}
github gaoxiaosong / react-native-im / plugin / message / display / ImageBubble.tsx View on Github external
        const images = messages.filter(({type}) => type === IMConstant.MessageType.image).reverse();
        const currentIndex = images.findIndex(image => image.messageId === messageId);
github gaoxiaosong / react-native-im / plugin / easemob / SendAction.ts View on Github external
export default function () {
    type ActionItem = [
        number,
        (params: Typings.Action.Send.Params) => Typings.Action.Send.Result
        ];
    const sendActions: ActionItem[] = [
        [IMConstant.MessageType.text, sendText],
        [IMConstant.MessageType.image, sendImage],
        [IMConstant.MessageType.location, sendLocation],
        [IMConstant.MessageType.video, sendVideo],
        [IMConstant.MessageType.voice, sendVoice],
        [IMConstant.MessageType.file, sendFile],
    ];
    sendActions.forEach(([type, func]) => {
        Model.Action.Send.registerSpecial(
            type,
            (_?: Typings.Action.Send.State) => true,
            func,
            Specials.PRIORITY.LOW
        );
    });
}
github gaoxiaosong / react-native-im / plugin / easemob / DisplayAction.ts View on Github external
export default function () {
    const displayActions = [
        [[], StandardMessage.Display.GeneralBubble],
        [IMConstant.MessageType.text, StandardMessage.Display.TextBubble],
        [IMConstant.MessageType.image, StandardMessage.Display.ImageBubble],
        [IMConstant.MessageType.location, StandardMessage.Display.LocationBubble],
        [IMConstant.MessageType.video, StandardMessage.Display.VideoBubble],
        [IMConstant.MessageType.voice, StandardMessage.Display.VoiceBubble],
    ];
    displayActions.forEach(function ([messageType, handleFunc]) {
        Model.Action.Display.registerDefault(messageType, handleFunc);
    });
}
github gaoxiaosong / react-native-im / plugin / easemob / ParseAction.ts View on Github external
function convertLocation(message: Typings.Message.Origin) {
    return convertBasicMessage(
        message,
        IMConstant.MessageType.location,
        {
            latitude: message.body.latitude,
            longitude: message.body.longitude,
            address: message.body.address,
            name: message.ext ? message.ext.name : '',
        }
    );
}
github gaoxiaosong / react-native-im / plugin / easemob / AbstractAction.ts View on Github external
export default function () {
    const abstractActions = [
        [[], () => ''],
        [IMConstant.MessageType.text, StandardMessage.Abstract.TextAbstract],
        [IMConstant.MessageType.image, StandardMessage.Abstract.ImageAbstract],
        [IMConstant.MessageType.location, StandardMessage.Abstract.LocationAbstract],
        [IMConstant.MessageType.video, StandardMessage.Abstract.VideoAbstract],
        [IMConstant.MessageType.voice, StandardMessage.Abstract.VoiceAbstract],
        [IMConstant.MessageType.file, StandardMessage.Abstract.FileAbstract],
    ];
    abstractActions.forEach(function ([messageType, abstractFunc]) {
        Model.Action.Abstract.registerDefault(messageType, abstractFunc);
    });
}