Commit 41876a5c authored by shigemi miura's avatar shigemi miura

Sail Assist質問リスト No42対応

Version確認処理
parent acaa60ef
......@@ -112,6 +112,7 @@
D5AE351A2AEBA66A00059889 /* ReqLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AE35182AEBA66A00059889 /* ReqLogin.swift */; };
D5AE351B2AEBA66A00059889 /* ResLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AE35192AEBA66A00059889 /* ResLogin.swift */; };
D5AE351D2AEBA6FC00059889 /* SessionLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AE351C2AEBA6FC00059889 /* SessionLogin.swift */; };
D5B803282B3B988E003B32AD /* AppVersionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B803272B3B988E003B32AD /* AppVersionModel.swift */; };
D5CB6F992B02088C00EC2010 /* ResShipStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CB6F982B02088C00EC2010 /* ResShipStatus.swift */; };
D5CB6F9B2B021C4F00EC2010 /* LocationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CB6F9A2B021C4F00EC2010 /* LocationViewModel.swift */; };
D5CB6F9F2B0220A700EC2010 /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CB6F9E2B0220A700EC2010 /* ErrorView.swift */; };
......@@ -271,6 +272,7 @@
D5AE35182AEBA66A00059889 /* ReqLogin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ReqLogin.swift; path = Sailassist/Json/ReqLogin.swift; sourceTree = SOURCE_ROOT; };
D5AE35192AEBA66A00059889 /* ResLogin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ResLogin.swift; path = Sailassist/Json/ResLogin.swift; sourceTree = SOURCE_ROOT; };
D5AE351C2AEBA6FC00059889 /* SessionLogin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SessionLogin.swift; path = Sailassist/ServerSession/SessionLogin.swift; sourceTree = SOURCE_ROOT; };
D5B803272B3B988E003B32AD /* AppVersionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppVersionModel.swift; path = Sailassist/AppVersionModel.swift; sourceTree = SOURCE_ROOT; };
D5CB6F982B02088C00EC2010 /* ResShipStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ResShipStatus.swift; path = Sailassist/Json/ResShipStatus.swift; sourceTree = SOURCE_ROOT; };
D5CB6F9A2B021C4F00EC2010 /* LocationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LocationViewModel.swift; path = Sailassist/LocationViewModel.swift; sourceTree = SOURCE_ROOT; };
D5CB6F9E2B0220A700EC2010 /* ErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ErrorView.swift; path = Sailassist/ErrorView.swift; sourceTree = SOURCE_ROOT; };
......@@ -367,6 +369,7 @@
020B98172AD8C3190029DE4C /* Assets.xcassets */,
020B98192AD8C3190029DE4C /* Preview Content */,
D5CB6F9A2B021C4F00EC2010 /* LocationViewModel.swift */,
D5B803272B3B988E003B32AD /* AppVersionModel.swift */,
D5CB6F9E2B0220A700EC2010 /* ErrorView.swift */,
027EF9F12B0D804C0079B825 /* WebView.swift */,
);
......@@ -959,6 +962,7 @@
020B98532AD919180029DE4C /* LoginTypeSelectView.swift in Sources */,
D52D213F2AEBB7D700324D58 /* RegisteredEca.swift in Sources */,
02CD06952AE895F5005F8D8F /* APIError.swift in Sources */,
D5B803282B3B988E003B32AD /* AppVersionModel.swift in Sources */,
D592D5232B0F14FE00B91A1C /* SessionUploadImage.swift in Sources */,
022A98202AF8B8960079C55A /* LocationCalculation.swift in Sources */,
D5258CA72B03988600365276 /* ReqTaskList.swift in Sources */,
......
//
// AppVersionModel.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/12/26.
//
import Foundation
class AppVersionModel: ObservableObject {
private var serverSession = ServerSession()
let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")
func start() {
print(debug: "called")
versionURL { response in
print(debug: "called")
switch response {
case .success(let resultData):
print(debug: String(data: resultData, encoding: .utf8) as Any)
let jsonstr = String(data: resultData, encoding: .utf8)!
let appData: Data = jsonstr.data(using: String.Encoding.utf8)!
do {
let json = try JSONSerialization.jsonObject(with: appData, options: [.allowFragments]) as? [String: Any]
guard let result = (json?["results"] as? [Any])?.first as? [String: Any],
let storeVersion = result["version"] as? String else { return }
print(debug: "\(storeVersion)")
} catch {
print(error)
}
case .failure(let errorCode):
print(debug: errorCode)
break
}
}
}
private func versionURL(_ completion: @escaping ((Result<Data, APIError>)) -> Void) {
print(debug: "calld")
let url_string = HttpRequestType.AppInfo.rawValue + "&date=\(Date.init().timeIntervalSince1970)"
guard let req_url = URL(string : url_string) else {
return
}
serverSession.getJson(req_url, completion: completion)
}
// func appVersionCheck() {
// guard let info = Bundle.main.infoDictionary,
// let appVersion = info["CFBundleShortVersionString"] as? String,
// let identifier = info["CFBundleIdentifier"] as? String,
// let url = URL(string: "https://itunes.apple.com/lookup?bundleId=\(identifier)") else { return }
//
// let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
// guard let data = data else { return }
// do {
// let json = try JSONSerialization.jsonObject(with: data, options: [.allowFragments]) as? [String: Any]
// guard let result = (json?["results"] as? [Any])?.first as? [String: Any],
// let storeVersion = result["version"] as? String else { return }
//
// if appVersion != storeVersion {
// // appVersion と storeVersion が異なっている時に実行したい処理を記述
// }
// } catch let error {
// print(error)
// }
// }
// task.resume()
// }
}
......@@ -92,7 +92,8 @@ var chinaHainan:[CLLocationCoordinate2D] = [
CLLocationCoordinate2D(latitude: 18.38620000, longitude: 108.51900000),
CLLocationCoordinate2D(latitude: 18.42630000, longitude: 108.47900000),
CLLocationCoordinate2D(latitude: 18.82040000, longitude: 108.41300000),
CLLocationCoordinate2D(latitude: 19.21310000, longitude: 108.38900000)
CLLocationCoordinate2D(latitude: 19.21310000, longitude: 108.38900000),
CLLocationCoordinate2D(latitude: 19.40180556, longitude: 108.44024444)
]
var chinaYangtziShuifuYunnan:[CLLocationCoordinate2D] = [
......
......@@ -29,6 +29,10 @@ enum HttpRequestType : String {
case GetManualUrl = "https://ssv-canary-web.azurewebsites.net/api/constantdata/manual?filter=SailAssist"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
case AppStore = "https://apps.apple.com/jp/app/ssv-mobile/id1434022656"
case AppInfo = "https://itunes.apple.com/lookup?bundleId=com.jrc.tacmi"
// case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428"
// case AppInfo = "https://itunes.apple.com/lookup?bundleId=com.jrc.sailassist"
}
#elseif QC
enum HttpRequestType : String {
......@@ -51,6 +55,8 @@ enum HttpRequestType : String {
case GetManualUrl = "https://ssv-qc-web.azurewebsites.net/api/constantdata/manual?filter=SailAssist"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428"
case AppInfo = "https://itunes.apple.com/lookup?bundleId=com.jrc.sailassist"
}
#else
//MARK: 運用サーバー用
......@@ -74,5 +80,7 @@ enum HttpRequestType : String {
case GetManualUrl = "https://ssv.jmarinecloud.com/api/constantdata/manual?filter=SailAssist"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
case AppStore = "https://apps.apple.com/jp/app/sail-assist/id6473762428"
case AppInfo = "https://itunes.apple.com/lookup?bundleId=com.jrc.sailassist"
}
#endif
......@@ -33,7 +33,7 @@ struct MapRepresentable: UIViewControllerRepresentable{
mapVC.updateCamera(location: focusEca.centerPosition, zoomlevel: focusEca.zoomLevel)
mapVC.updateOneTimeEca(eca: focusEca.points)
//10秒後削除
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0) {
DispatchQueue.main.asyncAfter(deadline: .now() + 15.0) {
do{
mapVC.updateOneTimeEca(eca: nil)
}catch{
......
......@@ -7,16 +7,9 @@
import SwiftUI
//enum EcaAlertType: String {
// case ecaDelete
// case ecaRunningStop
//}
struct TaskSwitchingMenuView: View {
@ObservedObject var taskViewModel: TaskViewModel
@ObservedObject var ecaData = SharingData.eca
// @State var isEcaAlert : Bool = false
// @State var ecaAlertType: EcaAlertType = .ecaDelete
@State var isDeleteAlert: Bool = false
@State var isRunningStopAlert: Bool = false
let deleteEcaArea = DeleteEcaArea()
......
......@@ -21,7 +21,7 @@ enum MenuPath: String, Hashable{
case ManualInmalsatC
case ManualInternationalVHF
case ManualVDR
case Information
// case Information
case Setting
case GpsSelect
case Help
......@@ -53,8 +53,8 @@ enum MenuPath: String, Hashable{
"International VHF"
case .ManualVDR:
"VDR"
case .Information:
"Information"
// case .Information:
// "Information"
case .Setting:
"Setting"
case .GpsSelect:
......@@ -138,11 +138,11 @@ struct MenuView: View {
MenuContentView(content: .Manual)
}
Button{
path.append(.Information)
}label: {
MenuContentView(content: .Information)
}
// Button{
// path.append(.Information)
// }label: {
// MenuContentView(content: .Information)
// }
Button{
path.append(.Setting)
......@@ -180,9 +180,9 @@ struct MenuView: View {
}else if goto == .AboutApp{
MenuAboutAppView(path: $path)
.navigationBarHidden(true)
}else if goto == .Information{
MenuInfomarionView(path: $path)
.navigationBarHidden(true)
// }else if goto == .Information{
// MenuInfomarionView(path: $path)
// .navigationBarHidden(true)
}else{
VStack(spacing: 0) {
MenuTitleView(path: $path, title: goto.title)
......@@ -203,6 +203,7 @@ struct MenuView: View {
MSNotificationHub.clearTags()
Preferences.Id = ""
Preferences.Password = ""
Preferences.UserName = ""
loginViewModel.isLogin = false
sceneDelegate.tabWindow?.isHidden = true
}
......
......@@ -12,7 +12,7 @@ struct MenuInfomarionView: View {
var body: some View {
VStack{
MenuTitleView(path: $path, title: MenuPath.Information.title)
// MenuTitleView(path: $path, title: MenuPath.Information.title)
ScrollView{
VStack(spacing: 0){
......
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