Commit e19ac453 by Takatoshi Miura

Merge branch 'origin/ios_collaboration' into 'release_sp3'

ios協業実装

See merge request !96
parents fae1ca86 26f2d5b8
......@@ -191,6 +191,8 @@
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
......@@ -203,7 +205,7 @@
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
......
......@@ -195,6 +195,8 @@
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......@@ -204,7 +206,7 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
......
......@@ -193,6 +193,8 @@
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......@@ -202,7 +204,7 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
......
......@@ -140,6 +140,8 @@
android.getLoginParameter();
android.getGlobalParameter();
} else {
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
async function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
......@@ -149,7 +151,7 @@
IS_MOBILE = isMobile;
IS_ONLINE = isOnline;
if (CHAT_UTIL.isIOS()) {
collaborationJoinFlg = CHAT_DB.getCollaborationJoinFlg();
} else if (CHAT_UTIL.isAndroid()) {
collaborationJoinFlg = android.getCollaborationJoinFlg();
console.log(collaborationJoinFlg);
......
......@@ -321,3 +321,17 @@ CHAT_DB.getContentList = function() {
return JSON.parse(android.getContentList());
}
};
CHAT_DB.getCollaborationJoinFlg = function() {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp("getCollaborationJoinFlg", {});
}
};
CHAT_DB.getUserInfoList = function(shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp("getUserInfoList", {"shopMemberId": shopMemberId});
}
};
......@@ -1303,8 +1303,15 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
beforeDate = message.insertDate;
if (message.messageType == messageType.COMMUNICATIONSTART || message.messageType == messageType.COMMUNICATIONEND) {
var collaborationInfo = JSON.parse(message.message);
var userInCollaboration = JSON.parse(android.getUserInfoList(collaborationInfo.userList));
var collaborationInfo;
var userInCollaboration;
if (CHAT_UTIL.isIOS()) {
collaborationInfo = message.message;
userInCollaboration = JSON.parse(CHAT_DB.getUserInfoList(collaborationInfo.userList));
} else if (CHAT_UTIL.isAndroid()) {
collaborationInfo = JSON.parse(message.message);
userInCollaboration = JSON.parse(android.getUserInfoList(collaborationInfo.userList));
}
userInCollaboration.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
......@@ -2442,7 +2449,7 @@ CHAT_UI.displayExistRoom = function(roomId) {
CHAT_UI.joinCollaboration = function(collaborationType) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS
webkit.messageHandlers.joinCollaboration.postMessage(collaborationType);
} else if (CHAT_UTIL.isAndroid()) {
android.joinCollaboration(collaborationType);
}
......@@ -2450,7 +2457,7 @@ CHAT_UI.joinCollaboration = function(collaborationType) {
CHAT_UI.startCollaboration = function(collaborationType) {
if (CHAT_UTIL.isIOS()) {
//TODO IOS
webkit.messageHandlers.startCollaboration.postMessage(collaborationType);
} else if (CHAT_UTIL.isAndroid()) {
android.startCollaboration(collaborationType);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment