Commit 87f38391 by Kim Peace

Fixed chat-deb with chat-deb-foriOS.js

parent 95d6a023
const NATIVE_KEY_IOS = {
getBeforeRoomType: "getBeforeRoomType",
getRoomType: "getRoomType",
removeFavoriteUser: "removeFavoriteUser",
addFavoriteUser: "addFavoriteUser",
removeFavoriteGroup: "removeFavoriteGroup",
addFavoriteGroup: "addFavoriteGroup",
getCollaborationJoinFlg: "getCollaborationJoinFlg",
getUserInfoList: "getUserInfoList",
createContentView: "createContentView",
getToMoveGroupId: "getToMoveGroupId",
getJoinCollaborationType: "getJoinCollaborationType",
getHostRequestFlg: "getHostRequestFlg",
getRoomList: "getRoomList",
getMyInfo: "getMyInfo",
getMessages: "getMessages",
getFavoriteUsersNotInRoom: "getFavoriteUsersNotInRoom",
getFavoriteUsers: "getFavoriteUsers",
getFavoriteGroups: "getFavoriteGroups",
getMyGroupUsers: "getMyGroupUsers",
getGroupInfo: "getGroupInfo",
getGroupInfoForAddUser: "getGroupInfoForAddUser",
getSelectedUserList: "getSelectedUserList",
getNameCardData: "getNameCardData",
getMyGroupShopMemberByName: "getMyGroupShopMemberByName",
getMyGroupShopMemberNotInRoomByName: "getMyGroupShopMemberNotInRoomByName",
getAllGroupShopMemberByName: "getAllGroupShopMemberByName",
getAllGroupShopMemberNotInRoomByName: "getAllGroupShopMemberNotInRoomByName",
getGroupByName: "getGroupByName",
getUsersInRoom: "getUsersInRoom",
getArchiveList: "getArchiveList",
getArchiveByName: "getArchiveByName",
getArchiveDetail: "getArchiveDetail",
searchMessages: "searchMessages",
getMyGroupUsersNotInRoom: "getMyGroupUsersNotInRoom",
getUserInfo: "getUserInfo",
getUserListByLoginId: "getUserListByLoginId",
};
// ios用
function callNativeApp(iosKey, jsonData) {
console.log("callNativeApp called");
var result;
try {
var key = iosKey;
var data = jsonData;
var payload = { key: key, data: data };
// payloadの形 {"type":"SJbridge","data":{"name":"abc","role":"dev"}}
// resにObjective-cからのレスポンスが返る
result = prompt(JSON.stringify(payload));
console.log(result);
} catch (err) {
console.log("The native context does not exist yet");
}
return result;
}
CHAT_DB.getBeforeRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getBeforeRoomType, {});
}
};
CHAT_DB.getRoomType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getRoomType, {}), 10);
}
};
CHAT_DB.removeFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteUser = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteUser, {
shopMemberId: shopMemberId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.removeFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.removeFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.addFavoriteGroup = function (groupId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
var result = callNativeApp(NATIVE_KEY_IOS.addFavoriteGroup, {
groupId: groupId,
});
if (result == "true") {
return true;
} else {
return false;
}
}
};
CHAT_DB.getCollaborationJoinFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getCollaborationJoinFlg, {});
}
};
CHAT_DB.getUserInfoList = function (shopMemberId) {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getUserInfoList, {
shopMemberId: shopMemberId,
});
}
};
CHAT_DB.createContentView = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.createContentView, {}));
}
};
CHAT_DB.getToMoveGroupId = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return callNativeApp(NATIVE_KEY_IOS.getToMoveGroupId, {});
}
};
CHAT_DB.getJoinCollaborationType = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(
callNativeApp(NATIVE_KEY_IOS.getJoinCollaborationType, {}),
10
);
}
};
CHAT_DB.getHostRequestFlg = function () {
// Androidは実装不要
if (CHAT_UTIL.isIOS()) {
return parseInt(callNativeApp(NATIVE_KEY_IOS.getHostRequestFlg, {}), 10);
}
};
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