Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
54
Merge Requests
54
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gr-ssv
Sailassist
Commits
b4e5721a
Commit
b4e5721a
authored
Jun 27, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notice未読マーク
parent
734b7525
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
10 deletions
+32
-10
NotificationContentView.swift
...ssist/Sailassist/Alert/View/NotificationContentView.swift
+3
-1
ChatView.swift
Seilassist/Sailassist/Chat/ChatView.swift
+3
-3
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+14
-6
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+1
-0
MainTabView.swift
Seilassist/Sailassist/Tab/MainTabView.swift
+11
-0
No files found.
Seilassist/Sailassist/Alert/View/NotificationContentView.swift
View file @
b4e5721a
...
...
@@ -47,7 +47,9 @@ struct NotificationContentView: View {
.
font
(
FontStyle
.
SupplementText2
.
font
)
}
.
padding
(
EdgeInsets
(
top
:
17
,
leading
:
30
,
bottom
:
17
,
trailing
:
30
))
.
onAppear
{
SharingData
.
pushHistory
.
viewCnt
=
0
}
}
}
...
...
Seilassist/Sailassist/Chat/ChatView.swift
View file @
b4e5721a
...
...
@@ -43,14 +43,14 @@ struct ChatView: View {
.
onAppear
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onAppear"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
center
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
}
}
.
onChange
(
of
:
message
.
messages
.
count
)
{
newValue
in
withAnimation
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onChange"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
center
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
}
}
}
...
...
@@ -59,7 +59,7 @@ struct ChatView: View {
guard
!
value
.
isEmpty
else
{
return
}
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onReceive"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
center
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
}
}
}
...
...
Seilassist/Sailassist/SailassistApp.swift
View file @
b4e5721a
...
...
@@ -309,8 +309,8 @@ class ChatHubConnectionDelegate: HubConnectionDelegate {
extension
AppDelegate
:
UNUserNotificationCenterDelegate
{
// フォアグラウンド状態で通知を受信して表示する
func
userNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
willPresent
notification
:
UNNotification
,
withCompletionHandler
completionHandler
:
@escaping
(
UNNotificationPresentationOptions
)
->
Void
)
{
willPresent
notification
:
UNNotification
,
withCompletionHandler
completionHandler
:
@escaping
(
UNNotificationPresentationOptions
)
->
Void
)
{
let
userInfo
=
notification
.
request
.
content
.
userInfo
if
!
userInfo
.
isEmpty
{
guard
let
arrAPS
=
userInfo
[
"aps"
]
as?
[
String
:
Any
]
else
{
...
...
@@ -331,6 +331,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
print
(
debug
:
"called
\(
subtitle
)
\(
strTitle
)
\(
strBody
)
"
)
let
message
=
GetMessage
()
message
.
start
()
//送信先名称が同一の場合は通知を出さない
if
subtitle
==
Preferences
.
UserName
{
return
...
...
@@ -360,8 +363,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
// バックグラウンド状態で通知を受信して表示する
func
userNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
@escaping
()
->
Void
)
{
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
@escaping
()
->
Void
)
{
let
userInfo
=
response
.
notification
.
request
.
content
.
userInfo
print
(
debug
:
userInfo
)
if
!
userInfo
.
isEmpty
{
...
...
@@ -382,22 +385,27 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
let
strBody
=
arrAlert
[
"body"
]
as?
String
??
""
//送信先名称
print
(
debug
:
"called
\(
subtitle
)
\(
strTitle
)
\(
strBody
)
"
)
// let message = GetMessage()
// message.start()
let
message
=
GetMessage
()
message
.
start
()
case
"sailassist"
:
print
(
debug
:
"sailassist"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
case
"bam"
:
print
(
debug
:
"bam"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
case
"route"
:
print
(
debug
:
"route"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
case
"emergency"
:
print
(
debug
:
"emergency"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
default
:
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
b4e5721a
...
...
@@ -370,6 +370,7 @@ class SharingData{
class
PushHistory
:
ObservableObject
{
@Published
var
pushHistoryData
:
Dictionary
<
Int
,
ResPushHistory
>
=
[:]
@Published
var
focusPushHistory
:
Int
?
=
nil
@Published
var
viewCnt
:
Int
=
0
//未読数
func
setPushHistory
(
key
:
Int
,
value
:
ResPushHistory
)
{
pushHistoryData
.
updateValue
(
value
,
forKey
:
key
)
...
...
Seilassist/Sailassist/Tab/MainTabView.swift
View file @
b4e5721a
...
...
@@ -105,6 +105,7 @@ struct CustomTabBar: View {
@ObservedObject
var
my
=
SharingData
.
my
@ObservedObject
var
message
=
SharingData
.
message
@ObservedObject
var
location
=
SharingData
.
location
@ObservedObject
var
pushHistory
=
SharingData
.
pushHistory
var
body
:
some
View
{
VStack
(
spacing
:
0
){
...
...
@@ -141,6 +142,16 @@ struct CustomTabBar: View {
.
cornerRadius
(
60
)
}
}
//チャットTab上の既読マーク
if
tab
==
Tab
.
task
{
if
pushHistory
.
viewCnt
!=
0
{
Rectangle
()
.
foregroundColor
(
.
red
)
.
frame
(
width
:
12
,
height
:
12
)
.
cornerRadius
(
60
)
}
}
}
Text
(
tab
.
title
)
...
...
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