Skip to content

Commit 3e2bf12

Browse files
committed
fix push service extension.
1 parent ad814e0 commit 3e2bf12

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

pushextension/NotificationService.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,22 @@ class NotificationService: UNNotificationServiceExtension {
1717
var change: Bool = false
1818

1919
var diffTime = Date().millisecondsSince1970 - NotificationService.lastRemoteNotifictionTS
20-
print("noti:Tlast=\(NotificationService.lastRemoteNotifictionTS)")
21-
print("noti:Tnow=\(Date().millisecondsSince1970)")
22-
print("noti:Tdiff=\(diffTime)")
23-
24-
var lastTs = NotificationService.lastRemoteNotifictionTS
20+
// print("noti:Tlast=\(NotificationService.lastRemoteNotifictionTS)")
21+
// print("noti:Tnow=\(Date().millisecondsSince1970)")
22+
// print("noti:Tdiff=\(diffTime)")
2523

2624
// check if last notification was received less than 24 seconds ago
27-
if (diffTime < (24 * 1000)) {
28-
print("noti:change=true")
25+
if (diffTime < (25 * 1000)) {
26+
// print("noti:change=true")
2927
change = true
3028
}
3129

3230
NotificationService.lastRemoteNotifictionTS = Date().millisecondsSince1970
3331

3432
if let bestAttemptContent = bestAttemptContent {
3533
if (change) {
36-
print("noti:actually changing")
37-
bestAttemptContent.title = "connecting ... ts=\(lastTs)"
34+
// print("noti:actually changing")
35+
bestAttemptContent.title = "connecting ..."
3836
}
3937
contentHandler(bestAttemptContent)
4038
}

0 commit comments

Comments
 (0)