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
0
Merge Requests
0
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
CpjJwWHV
Sailassist
Commits
7d4ad639
Commit
7d4ad639
authored
Nov 20, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
f436dc36
' into develop
parents
07a61c4c
f436dc36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
607 additions
and
29 deletions
+607
-29
Pods-SailAssistTests.canary.xcconfig
...Pods-SailAssistTests/Pods-SailAssistTests.canary.xcconfig
+0
-0
Pods-SailAssistTests.qc.xcconfig
...les/Pods-SailAssistTests/Pods-SailAssistTests.qc.xcconfig
+5
-8
Pods-Sailassist-frameworks-Canary-input-files.xcfilelist
.../Pods-Sailassist-frameworks-Canary-input-files.xcfilelist
+0
-0
Pods-Sailassist-frameworks-Canary-output-files.xcfilelist
...Pods-Sailassist-frameworks-Canary-output-files.xcfilelist
+0
-0
Pods-Sailassist-frameworks-QC-input-files.xcfilelist
...sist/Pods-Sailassist-frameworks-QC-input-files.xcfilelist
+3
-0
Pods-Sailassist-frameworks-QC-output-files.xcfilelist
...ist/Pods-Sailassist-frameworks-QC-output-files.xcfilelist
+2
-0
Pods-Sailassist-frameworks.sh
...pport Files/Pods-Sailassist/Pods-Sailassist-frameworks.sh
+4
-1
Pods-Sailassist.canary.xcconfig
...ort Files/Pods-Sailassist/Pods-Sailassist.canary.xcconfig
+0
-0
Pods-Sailassist.qc.xcconfig
...Support Files/Pods-Sailassist/Pods-Sailassist.qc.xcconfig
+7
-6
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+0
-0
Sailassist.xcscheme
...sist.xcodeproj/xcshareddata/xcschemes/Sailassist.xcscheme
+1
-1
Canary.xcscheme
...oj/xcuserdata/miura.xcuserdatad/xcschemes/Canary.xcscheme
+77
-0
QC.xcscheme
...deproj/xcuserdata/miura.xcuserdatad/xcschemes/QC.xcscheme
+77
-0
xcschememanagement.plist
...data/miura.xcuserdatad/xcschemes/xcschememanagement.plist
+24
-0
AlertDB.swift
Seilassist/Sailassist/DataSource/AlertDB.swift
+40
-0
PushNotificationTypes.swift
Seilassist/Sailassist/DataSource/PushNotificationTypes.swift
+33
-0
EcaTask.swift
Seilassist/Sailassist/ECA/EcaTask.swift
+23
-4
HttpRequestType.swift
Seilassist/Sailassist/Http/HttpRequestType.swift
+30
-4
Info.plist
Seilassist/Sailassist/Info.plist
+2
-0
LocationViewModel.swift
Seilassist/Sailassist/LocationViewModel.swift
+6
-1
no_sound.mp3
Seilassist/Sailassist/OtherAlertVoice/no_sound.mp3
+0
-0
sound_eca.mp3
Seilassist/Sailassist/OtherAlertVoice/sound_eca.mp3
+0
-0
Preferences.swift
Seilassist/Sailassist/Preferences/Preferences.swift
+4
-2
PreferencesKey.swift
Seilassist/Sailassist/Preferences/PreferencesKey.swift
+1
-1
Sailassist.entitlements
Seilassist/Sailassist/Sailassist.entitlements
+8
-0
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+60
-1
SignalRService.swift
Seilassist/Sailassist/SignalR/SignalRService.swift
+70
-0
AlertManager.swift
Seilassist/Sailassist/VoiceManager/AlertManager.swift
+130
-0
No files found.
Seilassist/Pods/Target Support Files/Pods-SailAssistTests/Pods-SailAssistTests.
debug
.xcconfig
→
Seilassist/Pods/Target Support Files/Pods-SailAssistTests/Pods-SailAssistTests.
canary
.xcconfig
View file @
7d4ad639
File moved
Seilassist/Pods/Target Support Files/
AzureNotificationHubs-iOS/AzureNotificationHubs-iOS.debug
.xcconfig
→
Seilassist/Pods/Target Support Files/
Pods-SailAssistTests/Pods-SailAssistTests.qc
.xcconfig
View file @
7d4ad639
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AzureNotificationHubs-iOS
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftSignalRClient" "${PODS_ROOT}/AzureNotificationHubs-iOS/WindowsAzureMessaging-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AzureNotificationHubs-iOS"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AzureNotificationHubs-iOS/WindowsAzureMessaging-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AzureNotificationHubs-iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "UserNotifications"
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftSignalRClient/SwiftSignalRClient.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "SwiftSignalRClient" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "UserNotifications"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}
PODS_ROOT = ${SRCROOT}/Pods
PODS_TARGET_SRCROOT = ${PODS_ROOT}/AzureNotificationHubs-iOS
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks-
Debug
-input-files.xcfilelist
→
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks-
Canary
-input-files.xcfilelist
View file @
7d4ad639
File moved
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks-
Debug
-output-files.xcfilelist
→
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks-
Canary
-output-files.xcfilelist
View file @
7d4ad639
File moved
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks-QC-input-files.xcfilelist
0 → 100644
View file @
7d4ad639
${PODS_ROOT}/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks.sh
${BUILT_PRODUCTS_DIR}/SwiftSignalRClient/SwiftSignalRClient.framework
\ No newline at end of file
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks-QC-output-files.xcfilelist
0 → 100644
View file @
7d4ad639
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftSignalRClient.framework
\ No newline at end of file
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist-frameworks.sh
View file @
7d4ad639
...
@@ -175,7 +175,10 @@ code_sign_if_enabled() {
...
@@ -175,7 +175,10 @@ code_sign_if_enabled() {
fi
fi
}
}
if
[[
"
$CONFIGURATION
"
==
"Debug"
]]
;
then
if
[[
"
$CONFIGURATION
"
==
"Canary"
]]
;
then
install_framework
"
${
BUILT_PRODUCTS_DIR
}
/SwiftSignalRClient/SwiftSignalRClient.framework"
fi
if
[[
"
$CONFIGURATION
"
==
"QC"
]]
;
then
install_framework
"
${
BUILT_PRODUCTS_DIR
}
/SwiftSignalRClient/SwiftSignalRClient.framework"
install_framework
"
${
BUILT_PRODUCTS_DIR
}
/SwiftSignalRClient/SwiftSignalRClient.framework"
fi
fi
if
[[
"
$CONFIGURATION
"
==
"Release"
]]
;
then
if
[[
"
$CONFIGURATION
"
==
"Release"
]]
;
then
...
...
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist.
debug
.xcconfig
→
Seilassist/Pods/Target Support Files/Pods-Sailassist/Pods-Sailassist.
canary
.xcconfig
View file @
7d4ad639
File moved
Seilassist/Pods/Target Support Files/
SwiftSignalRClient/SwiftSignalRClient.debug
.xcconfig
→
Seilassist/Pods/Target Support Files/
Pods-Sailassist/Pods-Sailassist.qc
.xcconfig
View file @
7d4ad639
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SwiftSignalRClient
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftSignalRClient" "${PODS_ROOT}/AzureNotificationHubs-iOS/WindowsAzureMessaging-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AzureNotificationHubs-iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftSignalRClient/SwiftSignalRClient.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks'
LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
OTHER_LDFLAGS = $(inherited) -ObjC -framework "Foundation" -framework "SwiftSignalRClient" -framework "SystemConfiguration" -framework "UIKit" -framework "WindowsAzureMessaging" -weak_framework "UserNotifications"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}
PODS_ROOT = ${SRCROOT}/Pods
PODS_TARGET_SRCROOT = ${PODS_ROOT}/SwiftSignalRClient
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
7d4ad639
This diff is collapsed.
Click to expand it.
Seilassist/Sailassist.xcodeproj/xcshareddata/xcschemes/Sailassist.xcscheme
View file @
7d4ad639
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
shouldAutocreateTestPlan =
"YES"
>
shouldAutocreateTestPlan =
"YES"
>
</TestAction>
</TestAction>
<LaunchAction
<LaunchAction
buildConfiguration =
"
Debug
"
buildConfiguration =
"
Release
"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
launchStyle =
"0"
...
...
Seilassist/Sailassist.xcodeproj/xcuserdata/miura.xcuserdatad/xcschemes/Canary.xcscheme
0 → 100644
View file @
7d4ad639
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1500"
version =
"1.7"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Canary"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
shouldAutocreateTestPlan =
"YES"
>
</TestAction>
<LaunchAction
buildConfiguration =
"Canary"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Canary"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
Seilassist/Sailassist.xcodeproj/xcuserdata/miura.xcuserdatad/xcschemes/QC.xcscheme
0 → 100644
View file @
7d4ad639
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1500"
version =
"1.7"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Canary"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
shouldAutocreateTestPlan =
"YES"
>
</TestAction>
<LaunchAction
buildConfiguration =
"QC"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Canary"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
Seilassist/Sailassist.xcodeproj/xcuserdata/miura.xcuserdatad/xcschemes/xcschememanagement.plist
0 → 100644
View file @
7d4ad639
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
SchemeUserState
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
Canary.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
3
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
QC.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
5
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
Sailassist.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
Seilassist/Sailassist/DataSource/AlertDB.swift
0 → 100644
View file @
7d4ad639
//
// AlertDB.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/19.
//
import
Foundation
struct
WarnRecord
{
var
title
:
String
var
body
:
String
let
soundName
:
String
}
enum
SwitchingEca
{
case
Finish
case
Start
case
Notice
init
()
{
self
=
.
Notice
}
}
class
AlertDB
{
// シングルトン宣言
static
let
OnlyOne
=
AlertDB
()
private
var
alertEca
:
[
SwitchingEca
:
WarnRecord
]
=
[
SwitchingEca
.
Finish
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Finish"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrived at switching finished point"
,
comment
:
""
),
soundName
:
"sound_eca.mp3"
)
,
SwitchingEca
.
Start
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Start"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrivaed at switching start point"
,
comment
:
""
),
soundName
:
"sound_eca.mp3"
)
,
SwitchingEca
.
Notice
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Notice"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrived at advance notice point"
,
comment
:
""
),
soundName
:
"sound_eca.mp3"
)
]
//Eca通知
func
GetAlertEcaPoint
(
point
:
SwitchingEca
)
->
WarnRecord
{
return
alertEca
[
point
]
!
}
}
Seilassist/Sailassist/DataSource/PushNotificationTypes.swift
0 → 100644
View file @
7d4ad639
//
// PushNotificationTypes.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/19.
//
import
Foundation
struct
PushNotificationTypes
{
//リモートPush用sendType
enum
SendType
:
Int32
{
case
Error
=
-
1
case
Eca
=
0
// Eca
init
(){
self
=
.
Error
}
init
?(
_
code
:
Int32
)
{
switch
code
{
case
0
:
self
=
.
Eca
default
:
self
=
.
Error
}
}
}
//ローカルPush用Identifier
enum
LocalPushIdentifier
:
String
{
case
Reserve
=
"Reserve"
// 予約(初期設定)
case
EcaSwitching
=
"Eca"
// Eca
}
}
Seilassist/Sailassist/ECA/EcaTask.swift
View file @
7d4ad639
...
@@ -16,6 +16,21 @@ class EcaTask {
...
@@ -16,6 +16,21 @@ class EcaTask {
sessionShipStatus
.
RequestShipStatus
(
responseShipStatus
)
sessionShipStatus
.
RequestShipStatus
(
responseShipStatus
)
}
}
/**
* Eca通知
*/
private
func
notificationEca
(
point
:
SwitchingEca
)
{
let
alertDB
=
AlertDB
.
OnlyOne
var
wernrec
=
WarnRecord
(
title
:
"Eca"
,
body
:
""
,
soundName
:
""
)
wernrec
=
alertDB
.
GetAlertEcaPoint
(
point
:
point
)
let
formatstr
=
wernrec
.
title
wernrec
.
title
=
String
(
format
:
formatstr
)
let
voicemanager
=
AlertManager
.
OnlyOne
voicemanager
.
VocalizeAlert
(
alertrec
:
wernrec
,
identifier
:
.
EcaSwitching
)
}
func
responseShipStatus
(
result
:
Result
<
Data
,
APIError
>
)
{
func
responseShipStatus
(
result
:
Result
<
Data
,
APIError
>
)
{
print
(
debug
:
"called"
)
print
(
debug
:
"called"
)
switch
result
{
switch
result
{
...
@@ -29,6 +44,10 @@ class EcaTask {
...
@@ -29,6 +44,10 @@ class EcaTask {
SharingData
.
my
.
server
?
.
latitude
=
res
.
lat
SharingData
.
my
.
server
?
.
latitude
=
res
.
lat
SharingData
.
my
.
server
?
.
longitude
=
res
.
lon
SharingData
.
my
.
server
?
.
longitude
=
res
.
lon
SharingData
.
my
.
dataTime
=
res
.
dataTime
//2023-11-02T05:25:49.4362123Z
SharingData
.
my
.
dataTime
=
res
.
dataTime
//2023-11-02T05:25:49.4362123Z
if
Preferences
.
LocationType
==
1
{
SharingData
.
my
.
location
=
SharingData
.
my
.
server
}
}
}
checkEca
()
checkEca
()
case
.
failure
(
let
errorCode
):
case
.
failure
(
let
errorCode
):
...
@@ -37,20 +56,20 @@ class EcaTask {
...
@@ -37,20 +56,20 @@ class EcaTask {
}
}
}
}
private
func
checkEca
()
{
func
checkEca
()
{
let
runningEca
=
eca
.
ecaArea
.
first
(
where
:
{(
key
,
value
)
in
value
.
isRunning
==
true
})
let
runningEca
=
eca
.
ecaArea
.
first
(
where
:
{(
key
,
value
)
in
value
.
isRunning
==
true
})
if
let
eca
=
runningEca
?
.
value
{
if
let
eca
=
runningEca
?
.
value
{
if
let
location
=
SharingData
.
my
.
location
{
if
let
location
=
SharingData
.
my
.
location
{
let
distance
=
LocationCalculation
.
checkPolyLine
(
objPos
:
eca
.
points
,
shipPos
:
location
)
let
distance
=
LocationCalculation
.
checkPolyLine
(
objPos
:
eca
.
points
,
shipPos
:
location
)
if
eca
.
swStart
>=
Float
(
distance
)
{
if
eca
.
swStart
>=
Float
(
distance
)
{
notificationEca
(
point
:
SwitchingEca
.
Start
)
}
}
if
eca
.
swNotice
>=
Float
(
distance
)
{
if
eca
.
swNotice
>=
Float
(
distance
)
{
notificationEca
(
point
:
SwitchingEca
.
Notice
)
}
}
if
eca
.
swFinish
>=
Float
(
distance
)
{
if
eca
.
swFinish
>=
Float
(
distance
)
{
notificationEca
(
point
:
SwitchingEca
.
Finish
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/Http/HttpRequestType.swift
View file @
7d4ad639
...
@@ -8,8 +8,7 @@
...
@@ -8,8 +8,7 @@
import
Foundation
import
Foundation
// TODO: サイトのアドレスを変更
// TODO: サイトのアドレスを変更
#if DEBUG
#if CANARY
//MARK: デバッグサーバー用
enum
HttpRequestType
:
String
{
enum
HttpRequestType
:
String
{
case
RegisterLogin
=
"https://ssv-canary-web.azurewebsites.net/sailassistlogin"
case
RegisterLogin
=
"https://ssv-canary-web.azurewebsites.net/sailassistlogin"
case
SitePolicy
=
"https://ssv-canary-web.azurewebsites.net/sitepolicy"
case
SitePolicy
=
"https://ssv-canary-web.azurewebsites.net/sitepolicy"
...
@@ -22,13 +21,40 @@ enum HttpRequestType : String {
...
@@ -22,13 +21,40 @@ enum HttpRequestType : String {
case
GetMessage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/getmessages?shipId=XXXXX"
case
GetMessage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/getmessages?shipId=XXXXX"
case
SignalR
=
"https://ssv-canary-web.azurewebsites.net/signalr/shore"
case
SignalR
=
"https://ssv-canary-web.azurewebsites.net/signalr/shore"
case
UploadImage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/uploadimage"
case
UploadImage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/uploadimage"
case
ConnectionString
=
"Endpoint=sb://ssv-canary-notification.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=rj2WniCJWWP2SG5gk4J7/2P/nIyChx8+JXKWCfTi8KA="
case
HubName
=
"ssv-canary-notification"
}
#elseif QC
enum
HttpRequestType
:
String
{
case
RegisterLogin
=
"https://ssv-qc-web.azurewebsites.net/sailassistlogin"
case
SitePolicy
=
"https://ssv-qc-web.azurewebsites.net/sitepolicy"
case
CookiePolicy
=
"https://ssv-qc-web.azurewebsites.net/cookiepolicy"
case
PrivacyPolicy
=
"https://ssv-qc-web.azurewebsites.net/inapp?"
//+バージョン番号
case
TaskList
=
"https://ssv-qc-web.azurewebsites.net/api/sailassist/tasklist/XXXXX"
case
EcaArea
=
"https://ssv-qc-web.azurewebsites.net/api/sailassist/ecaarea"
case
ShipStatus
=
"https://ssv-qc-web.azurewebsites.net/api/sailassist/shipstatus/XXXXX"
case
ShipMonitoringRoute
=
"https://ssv-qc-web.azurewebsites.net/api/sailassist/shipmonitoringroute/XXXXX"
case
GetMessage
=
"https://ssv-qc-web.azurewebsites.net/api/chatdata/getmessages?shipId=XXXXX"
case
SignalR
=
"https://ssv-qc-web.azurewebsites.net/signalr/shore"
case
UploadImage
=
"https://ssv-qc-web.azurewebsites.net/api/chatdata/uploadimage"
case
ConnectionString
=
"Endpoint=sb://tacmiqchub.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=mjGZyOensA5D/T6bMiDDwX6hwhoZNsDcK+GtBBBiUXk="
case
HubName
=
"tacmiqchub"
}
}
#else
#else
//MARK: 運用サーバー用
//MARK: 運用サーバー用
enum
HttpRequestType
:
String
{
enum
HttpRequestType
:
String
{
case
RegisterLogin
=
"https://ssv.jmarinecloud.com/
app
login"
case
RegisterLogin
=
"https://ssv.jmarinecloud.com/
sailassist
login"
case
SitePolicy
=
"https://ssv.jmarinecloud.com/sitepolicy"
case
SitePolicy
=
"https://ssv.jmarinecloud.com/sitepolicy"
case
CookiePolicy
=
"https://ssv.jmarinecloud.com/cookiepolicy"
case
CookiePolicy
=
"https://ssv.jmarinecloud.com/cookiepolicy"
case
PrivacyPolicy
=
"https://ssv.jmarinecloud.com/inapp?"
case
PrivacyPolicy
=
"https://ssv.jmarinecloud.com/inapp?"
//+バージョン番号
case
TaskList
=
"https://ssv.jmarinecloud.com/api/sailassist/tasklist/XXXXX"
case
EcaArea
=
"https://ssv.jmarinecloud.com/api/sailassist/ecaarea"
case
ShipStatus
=
"https://ssv.jmarinecloud.com/api/sailassist/shipstatus/XXXXX"
case
ShipMonitoringRoute
=
"https://ssv.jmarinecloud.com/api/sailassist/shipmonitoringroute/XXXXX"
case
GetMessage
=
"https://ssv.jmarinecloud.com/api/chatdata/getmessages?shipId=XXXXX"
case
SignalR
=
"https://ssv.jmarinecloud.com/signalr/shore"
case
UploadImage
=
"https://ssv.jmarinecloud.com/api/chatdata/uploadimage"
case
ConnectionString
=
"Endpoint=sb://tacmihub.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=/IOJAYGLZmS2JvlsHT5aT+ETlPXqNt1+VGuMNDt4bzw="
case
HubName
=
"tacmihub"
}
}
#endif
#endif
Seilassist/Sailassist/Info.plist
View file @
7d4ad639
...
@@ -6,7 +6,9 @@
...
@@ -6,7 +6,9 @@
<
string
>
pk.eyJ1Ijoiam1hcmluZWNsb3VkIiwiYSI6ImNsbmxjbGYzZjA0dG8yaW82MDgwajQ5OTQifQ.pd8YC9qK1C4YmMUbMx6ywQ
<
/string
>
<
string
>
pk.eyJ1Ijoiam1hcmluZWNsb3VkIiwiYSI6ImNsbmxjbGYzZjA0dG8yaW82MDgwajQ5OTQifQ.pd8YC9qK1C4YmMUbMx6ywQ
<
/string
>
<
k
e
y
>
UIBackgroundModes
<
/k
e
y
>
<
k
e
y
>
UIBackgroundModes
<
/k
e
y
>
<
a
rr
a
y
>
<
a
rr
a
y
>
<
string
>
audio
<
/string
>
<
string
>
location
<
/string
>
<
string
>
location
<
/string
>
<
string
>
remote-notification
<
/string
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
<
/plist
>
Seilassist/Sailassist/LocationViewModel.swift
View file @
7d4ad639
...
@@ -40,9 +40,14 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -40,9 +40,14 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
if
let
newLocation
=
locations
.
last
{
if
let
newLocation
=
locations
.
last
{
let
isLocation
=
filterLocation
(
newLocation
)
let
isLocation
=
filterLocation
(
newLocation
)
if
isLocation
{
if
isLocation
{
lastSeenLocation
=
locations
.
first
lastSeenLocation
=
locations
.
first
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
SharingData
.
my
.
gps
=
targetCoordinate
SharingData
.
my
.
gps
=
targetCoordinate
if
Preferences
.
LocationType
==
0
{
SharingData
.
my
.
location
=
SharingData
.
my
.
gps
let
ecaTask
=
EcaTask
()
ecaTask
.
checkEca
()
}
}
}
}
}
}
}
...
...
Seilassist/Sailassist/OtherAlertVoice/no_sound.mp3
0 → 100755
View file @
7d4ad639
File added
Seilassist/Sailassist/OtherAlertVoice/sound_eca.mp3
0 → 100644
View file @
7d4ad639
File added
Seilassist/Sailassist/Preferences/Preferences.swift
View file @
7d4ad639
...
@@ -26,8 +26,10 @@ class Preferences{
...
@@ -26,8 +26,10 @@ class Preferences{
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipId.rawValue)
static
var
ShipId
:
String
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipId.rawValue)
static
var
ShipId
:
String
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipPassword.rawValue)
static
var
ShipPassword
:
String
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipPassword.rawValue)
static
var
ShipPassword
:
String
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.UserName.rawValue)
static
var
UserName
:
String
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.UserName.rawValue)
static
var
UserName
:
String
// func getPreferences(key)
@AppStorage(wrappedValue:0, PreferencesKey.TypeInt.LocationType.rawValue)
static
var
LocationType
:
Int
// func getPreferences(key)
@AppStorage(PreferencesKey.TypeURL.ECDIS.rawValue)
static
var
ECDISUrl
:
URL
?
@AppStorage(PreferencesKey.TypeURL.ECDIS.rawValue)
static
var
ECDISUrl
:
URL
?
}
}
...
...
Seilassist/Sailassist/Preferences/PreferencesKey.swift
View file @
7d4ad639
...
@@ -19,9 +19,9 @@ class PreferencesKey{
...
@@ -19,9 +19,9 @@ class PreferencesKey{
///Int型
///Int型
enum
TypeInt
:
String
{
enum
TypeInt
:
String
{
case
LocationType
case
AppStartUsingDate
case
AppStartUsingDate
case
LastLoginDate
case
LastLoginDate
}
}
enum
TypeURL
:
String
{
enum
TypeURL
:
String
{
...
...
Seilassist/Sailassist/Sailassist.entitlements
0 → 100644
View file @
7d4ad639
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
aps-environment
</key>
<string>
development
</string>
</dict>
</plist>
Seilassist/Sailassist/SailassistApp.swift
View file @
7d4ad639
...
@@ -6,10 +6,13 @@
...
@@ -6,10 +6,13 @@
//
//
import
SwiftUI
import
SwiftUI
import
UserNotifications
import
WindowsAzureMessaging
@main
@main
struct
SailassistApp
:
App
{
struct
SailassistApp
:
App
{
@UIApplicationDelegateAdaptor(AppDelegate.self)
private
var
d
elegate
@UIApplicationDelegateAdaptor(AppDelegate.self)
private
var
appD
elegate
var
body
:
some
Scene
{
var
body
:
some
Scene
{
WindowGroup
{
WindowGroup
{
ContentView
()
ContentView
()
...
@@ -18,11 +21,67 @@ struct SailassistApp: App {
...
@@ -18,11 +21,67 @@ struct SailassistApp: App {
}
}
class
AppDelegate
:
NSObject
,
UIApplicationDelegate
{
class
AppDelegate
:
NSObject
,
UIApplicationDelegate
{
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?
=
nil
)
->
Bool
{
print
(
debug
:
"called"
)
//プッシュ通知の利用許可のリクエスト送信
UNUserNotificationCenter
.
current
()
.
requestAuthorization
(
options
:
[
.
alert
,
.
sound
,
.
badge
])
{
(
granted
,
error
)
in
if
error
!=
nil
{
return
}
if
granted
{
UNUserNotificationCenter
.
current
()
.
delegate
=
self
}
}
application
.
registerForRemoteNotifications
()
MSNotificationHub
.
start
(
connectionString
:
HttpRequestType
.
ConnectionString
.
rawValue
,
hubName
:
HttpRequestType
.
HubName
.
rawValue
)
return
true
}
func
application
(
_
application
:
UIApplication
,
configurationForConnecting
connectingSceneSession
:
UISceneSession
,
options
:
UIScene
.
ConnectionOptions
)
->
UISceneConfiguration
{
func
application
(
_
application
:
UIApplication
,
configurationForConnecting
connectingSceneSession
:
UISceneSession
,
options
:
UIScene
.
ConnectionOptions
)
->
UISceneConfiguration
{
print
(
debug
:
"called"
)
let
config
=
UISceneConfiguration
(
name
:
nil
,
sessionRole
:
connectingSceneSession
.
role
)
let
config
=
UISceneConfiguration
(
name
:
nil
,
sessionRole
:
connectingSceneSession
.
role
)
config
.
delegateClass
=
SceneDelegate
.
self
config
.
delegateClass
=
SceneDelegate
.
self
return
config
return
config
}
}
func
notificationHub
(
_
notificationHub
:
MSNotificationHub
!
,
didReceivePushNotification
notification
:
MSNotificationHubMessage
!
)
{
let
title
=
notification
.
title
??
""
let
body
=
notification
.
body
??
""
if
(
UIApplication
.
shared
.
applicationState
==
.
background
)
{
print
(
"Notification received in background: title:
\"\(
title
)\"
body:
\"\(
body
)\"
"
)
}
else
{
let
alertController
=
UIAlertController
(
title
:
title
,
message
:
body
,
preferredStyle
:
.
alert
)
alertController
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
cancel
))
// self.present(alertController, animated: true)
}
}
}
extension
AppDelegate
:
UNUserNotificationCenterDelegate
{
// フォアグラウンド状態で通知を受信して表示する
func
userNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
willPresent
notification
:
UNNotification
,
withCompletionHandler
completionHandler
:
@escaping
(
UNNotificationPresentationOptions
)
->
Void
)
{
let
userInfo
=
notification
.
request
.
content
.
userInfo
print
(
debug
:
userInfo
)
completionHandler
([[
.
banner
,
.
badge
,
.
sound
]])
}
// バックグラウンド状態で通知を受信して表示する
func
userNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
@escaping
()
->
Void
)
{
let
userInfo
=
response
.
notification
.
request
.
content
.
userInfo
print
(
debug
:
userInfo
)
completionHandler
()
}
}
}
class
SceneDelegate
:
UIResponder
,
UIWindowSceneDelegate
,
ObservableObject
{
class
SceneDelegate
:
UIResponder
,
UIWindowSceneDelegate
,
ObservableObject
{
...
...
Seilassist/Sailassist/SignalR/SignalRService.swift
0 → 100644
View file @
7d4ad639
//
// SignalRService.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/17.
//
import
Foundation
import
SwiftSignalRClient
public
class
SignalRService
{
private
var
connection
:
HubConnection
public
init
(
url
:
URL
)
{
// リクエストURLの組み立て
// let url_string : String = HttpRequestType.SignalR.rawValue
// guard let req_url = URL(string : url_string) else {
// return
// }
connection
=
HubConnectionBuilder
(
url
:
url
)
.
withLogging
(
minLogLevel
:
.
error
)
.
build
()
connection
.
on
(
method
:
"MessageReceived"
,
callback
:
{
(
user
:
String
,
message
:
String
)
in
do
{
self
.
handleMessage
(
message
,
from
:
user
)
}
catch
{
print
(
error
)
}
})
// hubConnection?.invoke(method: "Your Method Name", arguments: [arg1, arg2]) { error in
// if let error = error {
// print("An error occurred: %@", "\(error)")
// }
// }
//
// hubConnection?.on(method: "YourMethod", callback: { (chatCount: Int, notificationsCount: Int) in
// self.notificationCount = notificationsCount
// self.chatCount = chatCount
// })
connection
.
start
()
}
private
func
handleMessage
(
_
message
:
String
,
from
user
:
String
)
{
// Do something with the message.
}
func
connectionDidOpen
(
hubConnection
:
SwiftSignalRClient
.
HubConnection
)
{
print
(
"connectionDidOpen"
)
// After connection established call registerUserInServer method
DispatchQueue
.
main
.
async
{
// self.registerUserInServer()
}
}
func
connectionDidFailToOpen
(
error
:
Error
)
{
print
(
"connectionDidFailToOpen"
)
}
func
connectionDidClose
(
error
:
Error
?)
{
print
(
"connectionDidClose"
)
}
func
connectionWillReconnect
(
error
:
Error
)
{
print
(
"connectionWillReconnect"
)
}
func
connectionDidReconnect
()
{
print
(
"connectionDidReconnect"
)
}
}
Seilassist/Sailassist/VoiceManager/AlertManager.swift
0 → 100644
View file @
7d4ad639
//
// AlertManager.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/19.
//
import
Foundation
import
UIKit
import
AVFoundation
// 音声を扱うクラスのうち、アラートに関するもの
class
AlertManager
{
// シングルトン宣言
static
let
OnlyOne
=
AlertManager
()
private
var
player
:
AVAudioPlayer
!
// ここでインスタンスを作ると例外発生
var
lastAlert
:
PushNotificationTypes
.
LocalPushIdentifier
=
.
Reserve
var
lastSpeech
:
String
=
""
private
init
()
{
//とりあえず音源を仮で置いておく
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
"no_sound.mp3"
)
do
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
}
catch
{
}
}
// 無音を鳴らす
func
PlayNoSound
(
identifier
:
String
)
{
let
content
=
"no_sound.mp3"
lastSpeech
=
identifier
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
content
)
do
{
if
(
player
.
isPlaying
){
print
(
debug
:
"SOUND Playing:
\(
content
)
"
)
//再生中の音を止めてしてしまうので再生しない
}
else
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
player
.
play
()
print
(
debug
:
"SOUND Go play:
\(
content
)
"
)
}
}
catch
{
lastSpeech
=
""
print
(
debug
:
"SOUND NoSound:
\(
content
)
"
)
return
}
}
// 音声だけ鳴らす
func
Speaking
(
identifier
:
String
,
content
:
String
)
{
lastSpeech
=
identifier
// 音声を再生する
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
content
)
do
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
player
.
play
()
print
(
debug
:
"SOUND Go play:
\(
content
)
"
)
}
catch
{
lastSpeech
=
""
print
(
debug
:
"SOUND NoSound:
\(
content
)
"
)
return
}
}
// 音声再生中止
func
CancelSpeak
(
identifier
:
String
)
{
if
let
alertPlayer
=
player
{
if
alertPlayer
.
isPlaying
==
true
{
if
lastSpeech
==
identifier
{
alertPlayer
.
stop
()
}
}
}
lastSpeech
=
""
}
// 警報を鳴らす。引数の型定義はAlertDB.swift
func
VocalizeAlert
(
alertrec
:
WarnRecord
)
{
VocalizeAlert
(
alertrec
:
alertrec
,
identifier
:
.
EcaSwitching
)
}
func
VocalizeAlert
(
alertrec
:
WarnRecord
,
identifier
:
PushNotificationTypes
.
LocalPushIdentifier
)
{
print
(
debug
:
"alertrec =
\(
alertrec
)
"
)
// 警報を通知する
let
content
=
UNMutableNotificationContent
()
content
.
title
=
alertrec
.
title
content
.
body
=
alertrec
.
body
/* 「通知」側の音声は、再生時間上限(10sec)の関係で無音とする
* 無音声ファイル(no_sound.mp3)は予め AppDelegateで ${App}/Library/Sounds にコピー済み
*/
content
.
sound
=
UNNotificationSound
(
named
:
UNNotificationSoundName
(
rawValue
:
"no_sound.mp3"
))
// 「通知」を発生させる
let
request
=
UNNotificationRequest
(
identifier
:
identifier
.
rawValue
,
content
:
content
,
trigger
:
nil
)
// let request = UNNotificationRequest( identifier: "ShipWarn", content: content, trigger: nil )
UNUserNotificationCenter
.
current
()
.
add
(
request
,
withCompletionHandler
:
nil
)
lastAlert
=
identifier
// 音声を再生する
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
alertrec
.
soundName
)
do
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
player
.
play
()
print
(
debug
:
"SOUND Go play:
\(
alertrec
.
soundName
)
"
)
}
catch
{
lastAlert
=
.
Reserve
print
(
debug
:
"SOUND NoSound:
\(
alertrec
.
soundName
)
"
)
return
}
}
// 警報の再生を中断する
func
CancelAlert
()
{
CancelAlert
(
identifier
:
.
EcaSwitching
)
}
// 警報の再生を中断する
func
CancelAlert
(
identifier
:
PushNotificationTypes
.
LocalPushIdentifier
)
{
if
let
alertPlayer
=
player
{
if
alertPlayer
.
isPlaying
==
true
{
if
lastAlert
==
identifier
{
alertPlayer
.
stop
()
}
}
}
lastAlert
=
.
Reserve
}
}
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