1
This commit is contained in:
parent
84689e7ade
commit
509aa81f8a
@ -257,7 +257,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.9;
|
MARKETING_VERSION = 1.0.7;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -303,7 +303,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.9;
|
MARKETING_VERSION = 1.0.7;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
@ -42,6 +42,7 @@ extension AppDelegate {
|
|||||||
Self.haveBeenShownAPNS = true
|
Self.haveBeenShownAPNS = true
|
||||||
SPAPPTool.sceneDelegate?.retryHandleOpenAppMessage()
|
SPAPPTool.sceneDelegate?.retryHandleOpenAppMessage()
|
||||||
}
|
}
|
||||||
|
self.uploadNoticeStatus()
|
||||||
}
|
}
|
||||||
UIApplication.shared.registerForRemoteNotifications()
|
UIApplication.shared.registerForRemoteNotifications()
|
||||||
}
|
}
|
||||||
@ -51,6 +52,17 @@ extension AppDelegate {
|
|||||||
view.show()
|
view.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///更新通知状态
|
||||||
|
func uploadNoticeStatus() {
|
||||||
|
UNUserNotificationCenter.current().getNotificationSettings { settings in
|
||||||
|
if settings.authorizationStatus == .authorized {
|
||||||
|
SPRewardsAPI.requestUploadNoticeStatus(status: true)
|
||||||
|
} else if settings.authorizationStatus == .denied {
|
||||||
|
SPRewardsAPI.requestUploadNoticeStatus(status: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AppDelegate: UNUserNotificationCenterDelegate {
|
extension AppDelegate: UNUserNotificationCenterDelegate {
|
||||||
|
@ -65,6 +65,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||||
// Called as the scene transitions from the background to the foreground.
|
// Called as the scene transitions from the background to the foreground.
|
||||||
// Use this method to undo the changes made on entering the background.
|
// Use this method to undo the changes made on entering the background.
|
||||||
|
SPAPPTool.appDelegate?.uploadNoticeStatus()
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
self.handleOpenAppMessage(webpageURL: nil)
|
self.handleOpenAppMessage(webpageURL: nil)
|
||||||
|
@ -22,4 +22,18 @@ class SPRewardsAPI: NSObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///上传通知状态
|
||||||
|
static func requestUploadNoticeStatus(status: Bool) {
|
||||||
|
var param = SPNetworkParameters(path: "/customer/uploadNoticeStatus")
|
||||||
|
param.isLoding = false
|
||||||
|
param.isToast = false
|
||||||
|
param.parameters = [
|
||||||
|
"is_open_notice" : status ? 1 : 0
|
||||||
|
]
|
||||||
|
|
||||||
|
SPNetwork.request(parameters: param) { (response: SPNetworkResponse<String>) in
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user