@@ -224,7 +224,7 @@ public void getMyInfo(Callback callback) {
224224 @ ReactMethod
225225 public void getUserInfo (ReadableMap map , final Callback success , final Callback fail ) {
226226 String username = map .getString (Constant .USERNAME );
227- String appKey = map .getString (Constant .APP_KEY );
227+ String appKey = map .hasKey ( Constant . APP_KEY ) ? map . getString (Constant .APP_KEY ) : "" ;
228228 JMessageClient .getUserInfo (username , appKey , new GetUserInfoCallback () {
229229 @ Override
230230 public void gotResult (int i , String s , UserInfo userInfo ) {
@@ -379,7 +379,7 @@ public void sendMessage(ReadableMap map, final Callback success, final Callback
379379 options .setCustomNotificationEnabled (optionMap .getBoolean ("isCustomNotificationEnabled" ));
380380 }
381381 if (optionMap .hasKey ("notificationTitle" )) {
382- options .setNotificationText (optionMap .getString ("notificationTitle" ));
382+ options .setNotificationTitle (optionMap .getString ("notificationTitle" ));
383383 }
384384 if (optionMap .hasKey ("notificationText" )) {
385385 options .setNotificationText (optionMap .getString ("notificationText" ));
@@ -1125,7 +1125,7 @@ public void downloadVoiceFile(ReadableMap map, final Callback success, final Cal
11251125 mJMessageUtils .handleError (fail , ERR_CODE_MESSAGE , ERR_MSG_MESSAGE );
11261126 return ;
11271127 }
1128- if (msg .getContentType () != ContentType .image ) {
1128+ if (msg .getContentType () != ContentType .voice ) {
11291129 mJMessageUtils .handleError (fail , ERR_CODE_MESSAGE , "Wrong message type" );
11301130 return ;
11311131 }
@@ -1710,10 +1710,10 @@ public void createChatRoomConversation(String roomId, Callback success) {
17101710 */
17111711 @ ReactMethod
17121712 public void getAllUnreadCount (Callback success ) {
1713- WritableMap map = Arguments .createMap ();
1713+ // WritableMap map = Arguments.createMap();
17141714 int count = JMessageClient .getAllUnReadMsgCount ();
1715- map .putInt ("count" , count );
1716- success .invoke (map );
1715+ // map.putInt("count", count);
1716+ success .invoke (count );
17171717 }
17181718
17191719 @ ReactMethod
0 commit comments