Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
ff749821
Commit
ff749821
authored
Sep 06, 2021
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
協業招待プッシュメッセージ方法変更
parent
6c803151
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
22 deletions
+113
-22
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
+33
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/ABVFcmListenerService.java
+39
-17
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/PushMessageJSON.java
+41
-4
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
View file @
ff749821
...
@@ -159,6 +159,39 @@ public interface ABookCommConstants {
...
@@ -159,6 +159,39 @@ public interface ABookCommConstants {
Integer
MESSAGE_PAGING_SIZE
=
100
;
Integer
MESSAGE_PAGING_SIZE
=
100
;
}
}
interface
COLLABORATION
{
interface
INVITE_COLLABORATION
{
String
ENG
=
"inviteCollaboration"
;
String
JP
=
"\u5354\u696d"
;
String
KR
=
"\ud611\uc5c5"
;
}
interface
COLLABORATION_AUDIO
{
String
ENG
=
"audio"
;
String
JP
=
"\u901a\u8a71"
;
String
KR
=
"\ud1b5\ud654"
;
}
interface
COLLABORATION_CAMERA
{
String
ENG
=
"image"
;
String
JP
=
"\u5199\u771f"
;
String
KR
=
"\uc0ac\uc9c4"
;
}
interface
COLLABORATION_VIDEO
{
String
ENG
=
"video"
;
String
JP
=
"\u52d5\u753b"
;
String
KR
=
"\uc601\uc0c1"
;
}
interface
COLLABORATION_DOCUMENT
{
String
ENG
=
"document"
;
String
JP
=
"\u6587\u66f8"
;
String
KR
=
"\ubb38\uc11c"
;
}
interface
COLLABORATION_BOARD
{
String
ENG
=
"\ubcf4\ub4dc"
;
String
JP
=
"\u30dc\u30fc\u30c9"
;
String
KR
=
"\ubcf4\ub4dc"
;
}
}
String
FILE_SAVE_PATH
=
"/data/user/0/jp.co.agentec.abookplus.check/files/"
;
String
FILE_SAVE_PATH
=
"/data/user/0/jp.co.agentec.abookplus.check/files/"
;
String
NETWORK_ERROR_PLACE_HOLDER
=
"file:///android_asset/chat/public_new/chat.html"
;
String
NETWORK_ERROR_PLACE_HOLDER
=
"file:///android_asset/chat/public_new/chat.html"
;
...
@@ -171,7 +204,6 @@ public interface ABookCommConstants {
...
@@ -171,7 +204,6 @@ public interface ABookCommConstants {
String
DEFAULT_CHECKSUM
=
"0000000000"
;
String
DEFAULT_CHECKSUM
=
"0000000000"
;
String
PLATFORM_NAME
=
"android"
;
String
PLATFORM_NAME
=
"android"
;
String
CHAT_MESSAGE_SEPERATOR
=
"<::split>"
;
String
CHAT_MESSAGE_SEPERATOR
=
"<::split>"
;
String
INVITE_COLLABORATION
=
"inviteCollaboration"
+
CHAT_MESSAGE_SEPERATOR
;
int
PUSH_MESSAGE_DLG_REQUEST_CODE
=
200
;
int
PUSH_MESSAGE_DLG_REQUEST_CODE
=
200
;
interface
PUSH_MESSAGE_DLG_RESULT
{
interface
PUSH_MESSAGE_DLG_RESULT
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/ABVFcmListenerService.java
View file @
ff749821
...
@@ -145,7 +145,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
...
@@ -145,7 +145,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
// それ以外のActivityの場合の処理
// それ以外のActivityの場合の処理
Intent
pushMsgDialog
=
new
Intent
(
ABVFcmListenerService
.
this
,
ShowPushMessageDailogActivity
.
class
);
Intent
pushMsgDialog
=
new
Intent
(
ABVFcmListenerService
.
this
,
ShowPushMessageDailogActivity
.
class
);
pushMsgDialog
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
pushMsgDialog
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
message
,
getContentText
(
json
.
getMessage
()
));
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
message
,
json
.
getMessage
(
));
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
data
,
json
.
getData
());
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
data
,
json
.
getData
());
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
operationId
,
json
.
getOperationID
());
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
operationId
,
json
.
getOperationID
());
pushMsgDialog
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
json
.
getRoomId
());
pushMsgDialog
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
json
.
getRoomId
());
...
@@ -234,10 +234,12 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
...
@@ -234,10 +234,12 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
String
textMessage
=
json
.
getString
(
AppDefType
.
PushMessageKey
.
message
);
String
textMessage
=
json
.
getString
(
AppDefType
.
PushMessageKey
.
message
);
String
roomType
=
""
;
String
roomType
=
""
;
String
collaborationType
=
""
;
String
collaborationType
=
""
;
if
(
textMessage
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
if
(
textMessage
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
ENG
)
||
textMessage
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
JP
)
||
textMessage
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
KR
)
)
{
roomType
=
Integer
.
toString
(
json
.
getInt
(
AppDefType
.
ChatPushMessageKey
.
roomType
));
roomType
=
Integer
.
toString
(
json
.
getInt
(
AppDefType
.
ChatPushMessageKey
.
roomType
));
String
[]
inviteMessage
=
textMessage
.
split
(
ABookCommConstants
.
CHAT_MESSAGE_SEPERATOR
);
collaborationType
=
CollaborationTypeToNum
(
textMessage
);
collaborationType
=
inviteMessage
[
1
];
}
}
String
roomName
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
roomName
);
String
roomName
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
roomName
);
String
pushMsg
=
json
.
getString
(
AppDefType
.
PushMessageKey
.
message
);
String
pushMsg
=
json
.
getString
(
AppDefType
.
PushMessageKey
.
message
);
...
@@ -250,7 +252,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
...
@@ -250,7 +252,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
long
roomId
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
roomId
);
long
roomId
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
roomId
);
long
pushSendDate
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
pushSendDate
);
long
pushSendDate
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
pushSendDate
);
String
pushSendLoginId
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
);
String
pushSendLoginId
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
);
String
collaobrationInvitedMessage
=
getContentText
(
textMessage
)
;
String
collaobrationInvitedMessage
=
textMessage
;
intent
.
putExtra
(
AppDefType
.
PushMessageKey
.
message
,
collaobrationInvitedMessage
);
intent
.
putExtra
(
AppDefType
.
PushMessageKey
.
message
,
collaobrationInvitedMessage
);
intent
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
roomId
);
intent
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
roomId
);
...
@@ -263,8 +265,39 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
...
@@ -263,8 +265,39 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
return
intent
;
return
intent
;
}
}
public
String
CollaborationTypeToNum
(
String
message
)
{
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_AUDIO
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_AUDIO
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_AUDIO
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
AUDIO
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_CAMERA
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_CAMERA
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_CAMERA
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
CAMERA
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_VIDEO
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_VIDEO
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_VIDEO
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
VIDEO
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_DOCUMENT
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_DOCUMENT
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_DOCUMENT
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
DOCUMENT
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_BOARD
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_BOARD
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_BOARD
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
BOARD
);
}
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
AUDIO
);
}
private
Notification
.
Builder
getNotificationBuilder
(
PendingIntent
pendingIntent
,
Map
<
String
,
String
>
message
)
{
private
Notification
.
Builder
getNotificationBuilder
(
PendingIntent
pendingIntent
,
Map
<
String
,
String
>
message
)
{
String
txtMessage
=
getContentText
(
message
.
get
(
AppDefType
.
PushMessageKey
.
message
)
);
String
txtMessage
=
message
.
get
(
AppDefType
.
PushMessageKey
.
message
);
return
new
Notification
.
Builder
(
this
)
return
new
Notification
.
Builder
(
this
)
.
setDefaults
(
Notification
.
DEFAULT_ALL
)
.
setDefaults
(
Notification
.
DEFAULT_ALL
)
.
setSmallIcon
(
R
.
drawable
.
icon
)
.
setSmallIcon
(
R
.
drawable
.
icon
)
...
@@ -283,15 +316,4 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
...
@@ -283,15 +316,4 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
return
downloadUrl
;
return
downloadUrl
;
}
}
/**
* 通知エリアに表示するテキストを決定する
* @param textMessage プッシュメッセージをJSONOjbcetにした時の、AppDefType.PushMessageKey.message の値
* @return 表示するテキスト
*/
private
String
getContentText
(
String
textMessage
)
{
if
(!
StringUtil
.
isNullOrEmpty
(
textMessage
)
&&
textMessage
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
return
getString
(
R
.
string
.
msg_invite_collaboration
);
}
return
textMessage
;
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/PushMessageJSON.java
View file @
ff749821
...
@@ -87,7 +87,10 @@ public class PushMessageJSON {
...
@@ -87,7 +87,10 @@ public class PushMessageJSON {
public
boolean
isCollaboration
()
{
public
boolean
isCollaboration
()
{
String
message
=
getMessage
();
String
message
=
getMessage
();
if
(
message
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
KR
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -96,13 +99,47 @@ public class PushMessageJSON {
...
@@ -96,13 +99,47 @@ public class PushMessageJSON {
public
String
getCollaborationType
()
{
public
String
getCollaborationType
()
{
try
{
try
{
String
message
=
getMessage
();
String
message
=
getMessage
();
if
(
message
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
ENG
)
||
String
[]
inviteMessage
=
message
.
split
(
ABookCommConstants
.
CHAT_MESSAGE_SEPERATOR
);
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
JP
)
||
return
inviteMessage
[
1
];
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
INVITE_COLLABORATION
.
KR
))
{
return
CollaborationTypeToNum
(
message
);
}
}
return
jsonObject
.
getString
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
);
return
jsonObject
.
getString
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
""
;
return
""
;
}
}
}
}
public
String
CollaborationTypeToNum
(
String
message
)
{
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_AUDIO
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_AUDIO
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_AUDIO
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
AUDIO
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_CAMERA
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_CAMERA
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_CAMERA
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
CAMERA
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_VIDEO
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_VIDEO
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_VIDEO
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
VIDEO
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_DOCUMENT
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_DOCUMENT
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_DOCUMENT
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
DOCUMENT
);
}
else
if
(
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_BOARD
.
ENG
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_BOARD
.
JP
)
||
message
.
contains
(
ABookCommConstants
.
COLLABORATION
.
COLLABORATION_BOARD
.
KR
)
)
{
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
BOARD
);
}
return
String
.
valueOf
(
ABookCommConstants
.
FLAG
.
COLLABORATION_TYPE
.
AUDIO
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment