Coder Social home page Coder Social logo

im-js / im.js Goto Github PK

View Code? Open in Web Editor NEW
563.0 36.0 157.0 5.23 MB

一个基于 react-native + mobx + socket.io + node 的仿微信 JS-Wechat

License: MIT License

JavaScript 94.00% Python 1.33% Java 1.07% Objective-C 3.60%
react-native im-js koa2 socket-io nodejs react-native-im react-native-chat react-native-wechat

im.js's People

Contributors

plusmancn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

im.js's Issues

您好 我想请教您个问题

聊天界面的输入框键盘上完成按钮是怎么去掉的啊,我在ios上跑的,我也想把输入框放在键盘顶部,但是键盘上有个完成按钮,而且键盘收起时底输入框不会回到最底下。

下载了你的项目,跑不起来?

报这样的错误?怎么解决,貌似是 socket.io 那里的问题。

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1762): UnableToRe
solveError: Unable to resolve module `G:\React-Native\im.js-master\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js` from `G:\React-Native\im.js-master\node_modules\engine.io-client\l
Bundling `index.android.js`

关于群聊的currentKey该如何制定,求教大神

我现在有一个问题你那个手机端的currentkey是${payload.toAccount}-${payload.FromAccount}`;这样让聊天的列表和和聊天窗口对应的。现在我如果加上群聊的话,我不知道改如何这样对应关系了,求教!,群聊和单聊都通用

参数类型检测和函数返回值检测 用的什么工具

    async modifyUserInfo(field: string, value: string) { // 这里的参数类型检测用的什么工具了
        let url = config.server + `/v1/user/${this.userInfo.userId}/property/${field}`;
        let result = await fetchLocal(url, {
            method: 'PUT',
            body: JSON.stringify({
                value
            })
        });

麻烦问一下 , 上面参数给定类型检测是那个工具里面带的. 觉得挺好的但是找不到哪里能控制

服务端

在哪可以运行您服务器的代码

有没有办法在RN里面创建socketServer?

我使用socket.io-client(非websocket) 连接server(使用Tcp工具模拟server),server端可以看到连接http的包头信息,socket.io一直在reconnecting,无法触发connect函数;
有没有办法在APP开启一个socketServer?

想请教你一个问题 ?

假如websocket 中的服务其地址是可配置的,那下面这个应该怎么写
const chatSocketStore = new ChatSocketStore();
const profileStore = new ProfileStore(chatSocketStore);

export {
chatSocketStore,
profileStore
};

就是ChatSocketStore中地址可以随时改变,改变后我需要吧ChatSocketStore重新new一下,可以给一点思路吗 @plusmancn

我还在弄web版的聊天室,mobx和socket.io如何结合

class TodoStore {
	@observable list = []
	@observable fetched = false
	@action emit = (url) => {
		this.fetched = true
		socket.emit(url)
	}

	@computed get on(){
		socket.on('get list',(json)=>{
			this.fetched = false
			this.list = json.map((index,i)=>{
				return new List(index)
			})
		})
	}
}

mobx正常模式没问题,严格模式下

[mobx] Invariant failed: Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: [email protected]

mobx一直给我报错,我把接收socket.on函数放在外面,接收函数就根本不会触发。想知道你是如何处理好客户端的socket的发送与接收的。。。。
socket的接收是不是应该放在组件里面作为一个时刻可以接收信息的可以被任意随时触发的XXX?

项目运行失败

/Users/mao/Desktop/im.js/node_modules/react-native/React/Base/RCTPlatform.m:22:10: note: previous case defined here
case UIUserInterfaceIdiomPad:
^
2 errors generated.

** BUILD FAILED **

The following build commands failed:
CompileC /Users/mao/Desktop/im.js/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTPlatform.o Base/RCTPlatform.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/ImClient.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/ImClient.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

为什么会报这个错误呢

engine.io-client:Unable to resolve module

访问http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false报如下错误是什么原因?
{
from: "F:\www\RN\im.js\node_modules\engine.io-client\lib\transports\index.js",
to: "F:\www\RN\im.js\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js",
message: "Unable to resolve module F:\www\RN\im.js\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js from F:\www\RN\im.js\node_modules\engine.io-client\lib\transports\index.js: Directory F:\www\RN\im.js\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js doesn't exist",
name: "UnableToResolveError",
type: "UnableToResolveError",
errors: [
{ }
]
}

这个项目是什么时候开始开发的啊

去年在网上没看到,后来自己也是用react-native socket.io redux 来弄的。也是实现了基本好友这些功能,及聊天。真是看到的太晚了撒。 建议把名字改成react-native-im***这样, 起码我当初就没找到这个

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.