File tree Expand file tree Collapse file tree 5 files changed +17
-13
lines changed
android/src/main/java/com/netease/im Expand file tree Collapse file tree 5 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ React Native的网易云信插件
33## Demo
44[ react-native-chat-demo] ( https://github.com/reactnativecomponent/react-native-chat-demo )
55
6- #### 注意: react-native版本需要0.40.0及以上
6+ #### 注意: react-native版本需要0.47.0及以上NIMSDK版本4.0以上
77
88## 如何安装
99
@@ -215,21 +215,13 @@ import NIM from 'react-native-netease-im';
215215```
216216
217217### API
218- #### NIM.login()
219- ``` javascript
220- // 登录参数
221- {
222- accid: " " , // 云信注册帐号
223- token: " " // 登录的token
224- }
225- ```
226- 返回一个` Promise ` 对象
218+
219+ 参考[ index.js] ( https://github.com/reactnativecomponent/react-native-netease-im/blob/master/index.js )
227220
228221#### 监听会话
229222```
230223NativeAppEventEmitter.addListener("observeRecentContact",(data)=>{
231224 console.log(data); //返回内容android和ios有区别
232225});
233226```
234- 更多接口请参阅` index.js ` ,或者参考Demo
235227
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public static class Link {
8888 public static class Location {
8989 public final static String LATITUDE = "latitude" ;
9090 public final static String LONGITUDE = "longitude" ;
91- public final static String ADDRESS = "address " ;
91+ public final static String ADDRESS = "title " ;
9292 }
9393
9494 public static class MediaFile {
Original file line number Diff line number Diff line change @@ -1945,11 +1945,20 @@ public void onNewIntent(Intent intent) {
19451945
19461946 }
19471947
1948+ public static String status = "" ;
1949+
19481950 @ Override
19491951 public void onHostResume () {
19501952 if (reactContext .getCurrentActivity () != null )
19511953 LogUtil .w (TAG , reactContext .getCurrentActivity ().getClass ().getPackage ().getName ());
19521954 LogUtil .w (TAG , "onHostResume" );
1955+
1956+ if (!TextUtils .isEmpty (status )) {
1957+ WritableMap r = Arguments .createMap ();
1958+ r .putString ("status" , status );
1959+ ReactCache .emit (ReactCache .observeOnKick , r );
1960+ status = "" ;
1961+ }
19531962 }
19541963
19551964 @ Override
Original file line number Diff line number Diff line change 44
55import com .facebook .react .bridge .Arguments ;
66import com .facebook .react .bridge .WritableMap ;
7+ import com .netease .im .RNNeteaseImModule ;
78import com .netease .im .ReactCache ;
89import com .netease .im .uikit .cache .SimpleCallback ;
910import com .netease .im .uikit .cache .TeamDataCache ;
@@ -279,6 +280,7 @@ public void onEvent(LoginSyncStatus loginSyncStatus) {
279280
280281 @ Override
281282 public void onEvent (StatusCode code ) {
283+ RNNeteaseImModule .status = "" ;
282284 if (code != PWD_ERROR && code .wontAutoLogin ()) {
283285 WritableMap r = Arguments .createMap ();
284286 String status = "" ;
@@ -293,6 +295,7 @@ public void onEvent(StatusCode code) {
293295 status = "2" ;
294296 break ;
295297 }
298+ RNNeteaseImModule .status = status ;
296299 r .putString ("status" , status );
297300 ReactCache .emit (ReactCache .observeOnKick , r );
298301 }
Original file line number Diff line number Diff line change 11
22{
33 "name" : " react-native-netease-im" ,
4- "version" : " 2.0.0 " ,
4+ "version" : " 2.0.1 " ,
55 "description" : " 网易云信ReactNative插件" ,
66 "main" : " index.js" ,
77 "scripts" : {
You can’t perform that action at this time.
0 commit comments