Skip to content

建议自定义消息通过msgType.text的方式发送, 通过json传递信息 #27

@NikiLee2016

Description

@NikiLee2016

对react-native-netease-im已经研究两周了, 一直在阅读js端和android端源码, 库质量很高.
但是今天尝试发送自定义消息的时候, 发现报错undefined is not a function, 估计是android库与js端版本不匹配造成的(我用的2.0.8).
而且我之前读云信的官方文档得知发送自定义消息都需要自己配parser, 个人觉得很繁琐, 也不利于库的封装.
所以我刚刚尝试了一下通过msgType.text的形式发送json来实现自定义消息的收发, 效果不错, 大家可以试一试.
PS: 我的项目, ui层都是在rn端写的, 和demo的结构差异很大, demo里面ui层大部分写在了原生端, 那肯定不方便使用我这种方式了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions