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
25eadc52
Commit
25eadc52
authored
Aug 05, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed hardcoding to final static
parent
2bf4c869
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/ABVFcmListenerService.java
+21
-22
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/ABVFcmListenerService.java
View file @
25eadc52
...
...
@@ -14,10 +14,10 @@ import com.google.firebase.messaging.RemoteMessage;
import
org.json.adf.JSONObject
;
import
java.util.Map
;
import
java.util.Objects
;
import
jp.agentec.abook.abv.bl.common.exception.ABVException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic
;
...
...
@@ -33,7 +33,8 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
private
static
final
String
TAG
=
"ABVFcmListenerService"
;
private
NotificationManager
mNotificationManager
;
private
static
int
mNotificationConnect
=
0
;
private
final
String
INVITE_COLLABORATION
=
"inviteCollaboration<::split>"
;
private
final
String
CHAT_MESSAGE_SEPERATOR
=
"<::split>"
;
private
final
String
INVITE_COLLABORATION
=
"inviteCollaboration"
+
CHAT_MESSAGE_SEPERATOR
;
@Override
public
void
onCreate
()
{
...
...
@@ -61,7 +62,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
// Check pushmessage by chat
String
tempMsg
=
msg
.
get
(
AppDefType
.
PushMessageKey
.
message
);
String
pushMsg
=
""
;
String
pushMsg
;
Long
roomId
=
null
;
String
roomName
=
""
;
String
pushSendLoginId
=
""
;
...
...
@@ -69,20 +70,20 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
Integer
insertId
=
0
;
Integer
messageType
=
0
;
Integer
messageId
=
0
;
String
roomType
=
""
;
String
roomType
;
Log
.
d
(
TAG
,
"tempMsg : "
+
tempMsg
);
if
(
tempMsg
.
indexOf
(
"pushSendLoginId"
)
>
0
)
{
if
(
Objects
.
requireNonNull
(
tempMsg
).
indexOf
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
)
>
0
)
{
JSONObject
json
=
new
JSONObject
(
tempMsg
);
Object
Obj
=
json
.
getString
(
"pushSendLoginId"
);
Object
Obj
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
);
roomId
=
json
.
getLong
(
"roomId"
);
roomName
=
json
.
getString
(
"roomName"
);
pushSendLoginId
=
json
.
getString
(
"pushSendLoginId"
);
pushSendDate
=
json
.
getLong
(
"pushSendDate"
);
pushMsg
=
json
.
getString
(
"message"
);
roomId
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
roomId
);
roomName
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
roomName
);
pushSendLoginId
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
);
pushSendDate
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
pushSendDate
);
pushMsg
=
json
.
getString
(
AppDefType
.
PushMessageKey
.
message
);
//TODO pushメッセージが到着した際、新着メッセージかルーム招待か判別してDB格納が必要
//insertId = json.getString("insertId");
...
...
@@ -98,8 +99,8 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
if
(
pushMsg
.
contains
(
INVITE_COLLABORATION
))
{
roomType
=
Integer
.
toString
(
json
.
getInt
(
"roomType"
));
String
[]
inviteMessage
=
pushMsg
.
split
(
"<::split>"
);
roomType
=
Integer
.
toString
(
json
.
getInt
(
AppDefType
.
ChatPushMessageKey
.
roomType
));
String
[]
inviteMessage
=
pushMsg
.
split
(
CHAT_MESSAGE_SEPERATOR
);
tempMsg
=
getString
(
R
.
string
.
msg_invite_collaboration
);
Intent
pushMsgDialog
=
new
Intent
(
ABVFcmListenerService
.
this
,
ShowPushMessageDailogActivity
.
class
);
pushMsgDialog
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
...
...
@@ -162,16 +163,16 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
long
pushSendDate
=
0
;
Log
.
d
(
TAG
,
"tempMsg : "
+
tempMsg
);
if
(
tempMsg
.
indexOf
(
"pushSendLoginId"
)
>
0
)
{
if
(
Objects
.
requireNonNull
(
tempMsg
).
indexOf
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
)
>
0
)
{
JSONObject
json
=
new
JSONObject
(
tempMsg
);
Object
Obj
=
json
.
getString
(
"pushSendLoginId"
);
Object
Obj
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
);
roomId
=
json
.
getLong
(
"roomId"
);
roomName
=
json
.
getString
(
"roomName"
);
pushSendLoginId
=
json
.
getString
(
"pushSendLoginId"
);
pushSendDate
=
json
.
getLong
(
"pushSendDate"
);
pushMsg
=
json
.
getString
(
"message"
);
roomId
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
roomId
);
roomName
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
roomName
);
pushSendLoginId
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
pushSendLoginId
);
pushSendDate
=
json
.
getLong
(
AppDefType
.
ChatPushMessageKey
.
pushSendDate
);
pushMsg
=
json
.
getString
(
AppDefType
.
PushMessageKey
.
message
);
message
.
put
(
AppDefType
.
PushMessageKey
.
message
,
pushMsg
);
...
...
@@ -247,6 +248,4 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
return
downloadUrl
;
}
}
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