Skip to content

Commit

Permalink
prefix DEBUG push tokens with sandbox:
Browse files Browse the repository at this point in the history
DEBUG-buils are only builds from us devs (testflight have DEBUG=0)
and can only receive remote push notification from the sandbox-apns.

still, it makes sense to get the PUSH notifications,
esp. during development, but also later to see if sth. goes wrong.

this commit reverts the change done at
#1773 ,
however, server-side, we aimt to have only one notifications.delta.chat
(that then calls sandbox or not based on the token)
  • Loading branch information
r10s committed Feb 28, 2024
1 parent 5ed35b2 commit 531eb34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deltachat-ios/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
// we pass the received token to the app's notification server then.
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }
let notifyToken = tokenParts.joined()
#if DEBUG
let notifyToken = "sandbox:" + tokenParts.joined()
#else
let notifyToken = tokenParts.joined()
#endif
logger.info("Notifications: Token: \(notifyToken)")
self.notifyToken = notifyToken
dcAccounts.setPushToken(token: notifyToken)
Expand Down

0 comments on commit 531eb34

Please sign in to comment.