This commit is contained in:
zjx 2025-06-19 10:49:17 +08:00
parent 84689e7ade
commit 509aa81f8a
4 changed files with 29 additions and 2 deletions

View File

@ -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 = "";

View File

@ -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 {

View File

@ -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)

View File

@ -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
}
}
} }