Skip to content

Commit

Permalink
Merge pull request #32 from freswa/master
Browse files Browse the repository at this point in the history
set default expiration of push notifications to 24h
  • Loading branch information
frederik authored Dec 22, 2017
2 parents bc5a0cf + a3bbcf0 commit 612d6af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/xapsd/xapsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"net"
"os"
"strings"
"time"
)

const Version = "1.0b1"
Expand Down Expand Up @@ -361,6 +362,10 @@ func sendNotification(reg Registration, client *apns.Client) {
notification := apns.NewNotification()
notification.Payload = payload
notification.DeviceToken = reg.DeviceToken
// set expiration
// https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html
t := time.Now().Add(24 * time.Hour)
notification.Expiration = &t
client.Send(notification)
}

Expand Down

0 comments on commit 612d6af

Please sign in to comment.