@@ -218,7 +218,7 @@ runNtfTestCfg (t, msType) baseId smpCfg ntfCfg aCfg bCfg runTest = do
218
218
testNotificationToken :: APNSMockServer -> IO ()
219
219
testNotificationToken apns = do
220
220
withAgent 1 agentCfg initAgentServers testDB $ \ a -> runRight_ $ do
221
- let tkn = DeviceToken PPApnsTest " abcd"
221
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
222
222
NTRegistered <- registerNtfToken a tkn NMPeriodic
223
223
APNSMockRequest {notification = APNSNotification {aps = APNSBackground _, notificationData = Just ntfData}} <-
224
224
getMockNotification apns tkn
@@ -242,7 +242,7 @@ v .-> key = do
242
242
testNtfTokenRepeatRegistration :: APNSMockServer -> IO ()
243
243
testNtfTokenRepeatRegistration apns = do
244
244
withAgent 1 agentCfg initAgentServers testDB $ \ a -> runRight_ $ do
245
- let tkn = DeviceToken PPApnsTest " abcd"
245
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
246
246
NTRegistered <- registerNtfToken a tkn NMPeriodic
247
247
APNSMockRequest {notification = APNSNotification {aps = APNSBackground _, notificationData = Just ntfData}} <-
248
248
getMockNotification apns tkn
@@ -261,7 +261,7 @@ testNtfTokenRepeatRegistration apns = do
261
261
testNtfTokenSecondRegistration :: APNSMockServer -> IO ()
262
262
testNtfTokenSecondRegistration apns =
263
263
withAgentClients2 $ \ a a' -> runRight_ $ do
264
- let tkn = DeviceToken PPApnsTest " abcd"
264
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
265
265
NTRegistered <- registerNtfToken a tkn NMPeriodic
266
266
APNSMockRequest {notification = APNSNotification {aps = APNSBackground _, notificationData = Just ntfData}} <-
267
267
getMockNotification apns tkn
@@ -290,7 +290,7 @@ testNtfTokenSecondRegistration apns =
290
290
291
291
testNtfTokenServerRestart :: ASrvTransport -> APNSMockServer -> IO ()
292
292
testNtfTokenServerRestart t apns = do
293
- let tkn = DeviceToken PPApnsTest " abcd"
293
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
294
294
ntfData <- withAgent 1 agentCfg initAgentServers testDB $ \ a ->
295
295
withNtfServer t $ runRight $ do
296
296
NTRegistered <- registerNtfToken a tkn NMPeriodic
@@ -311,7 +311,7 @@ testNtfTokenServerRestart t apns = do
311
311
312
312
testNtfTokenServerRestartReverify :: ASrvTransport -> APNSMockServer -> IO ()
313
313
testNtfTokenServerRestartReverify t apns = do
314
- let tkn = DeviceToken PPApnsTest " abcd"
314
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
315
315
withAgent 1 agentCfg initAgentServers testDB $ \ a -> do
316
316
ntfData <- withNtfServer t $ runRight $ do
317
317
NTRegistered <- registerNtfToken a tkn NMPeriodic
@@ -334,7 +334,7 @@ testNtfTokenServerRestartReverify t apns = do
334
334
335
335
testNtfTokenServerRestartReverifyTimeout :: ASrvTransport -> APNSMockServer -> IO ()
336
336
testNtfTokenServerRestartReverifyTimeout t apns = do
337
- let tkn = DeviceToken PPApnsTest " abcd"
337
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
338
338
withAgent 1 agentCfg initAgentServers testDB $ \ a@ AgentClient {agentEnv = Env {store}} -> do
339
339
(nonce, verification) <- withNtfServer t $ runRight $ do
340
340
NTRegistered <- registerNtfToken a tkn NMPeriodic
@@ -369,7 +369,7 @@ testNtfTokenServerRestartReverifyTimeout t apns = do
369
369
370
370
testNtfTokenServerRestartReregister :: ASrvTransport -> APNSMockServer -> IO ()
371
371
testNtfTokenServerRestartReregister t apns = do
372
- let tkn = DeviceToken PPApnsTest " abcd"
372
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
373
373
withAgent 1 agentCfg initAgentServers testDB $ \ a ->
374
374
withNtfServer t $ runRight $ do
375
375
NTRegistered <- registerNtfToken a tkn NMPeriodic
@@ -393,7 +393,7 @@ testNtfTokenServerRestartReregister t apns = do
393
393
394
394
testNtfTokenServerRestartReregisterTimeout :: ASrvTransport -> APNSMockServer -> IO ()
395
395
testNtfTokenServerRestartReregisterTimeout t apns = do
396
- let tkn = DeviceToken PPApnsTest " abcd"
396
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
397
397
withAgent 1 agentCfg initAgentServers testDB $ \ a@ AgentClient {agentEnv = Env {store}} -> do
398
398
withNtfServer t $ runRight $ do
399
399
NTRegistered <- registerNtfToken a tkn NMPeriodic
@@ -434,7 +434,7 @@ getTestNtfTokenPort a =
434
434
435
435
testNtfTokenMultipleServers :: ASrvTransport -> APNSMockServer -> IO ()
436
436
testNtfTokenMultipleServers t apns = do
437
- let tkn = DeviceToken PPApnsTest " abcd"
437
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
438
438
withAgent 1 agentCfg initAgentServers2 testDB $ \ a ->
439
439
withNtfServerThreadOn t ntfTestPort ntfTestDBCfg $ \ ntf ->
440
440
withNtfServerThreadOn t ntfTestPort2 ntfTestDBCfg2 $ \ ntf2 -> runRight_ $ do
@@ -554,7 +554,7 @@ testNotificationSubscriptionExistingConnection apns baseId alice@AgentClient {ag
554
554
get alice ##> (" " , bobId, CON )
555
555
get bob ##> (" " , aliceId, CON )
556
556
-- register notification token
557
- let tkn = DeviceToken PPApnsTest " abcd"
557
+ let tkn = APNSDeviceToken PPApnsTest " abcd"
558
558
NTRegistered <- registerNtfToken alice tkn NMInstant
559
559
APNSMockRequest {notification = APNSNotification {aps = APNSBackground _, notificationData = Just ntfData}} <-
560
560
getMockNotification apns tkn
@@ -607,9 +607,9 @@ testNotificationSubscriptionNewConnection :: HasCallStack => APNSMockServer -> A
607
607
testNotificationSubscriptionNewConnection apns baseId alice bob =
608
608
runRight_ $ do
609
609
-- alice registers notification token
610
- DeviceToken {} <- registerTestToken alice " abcd" NMInstant apns
610
+ APNSDeviceToken {} <- registerTestToken alice " abcd" NMInstant apns
611
611
-- bob registers notification token
612
- DeviceToken {} <- registerTestToken bob " bcde" NMInstant apns
612
+ APNSDeviceToken {} <- registerTestToken bob " bcde" NMInstant apns
613
613
-- establish connection
614
614
liftIO $ threadDelay 50000
615
615
(bobId, qInfo) <- createConnection alice 1 True SCMInvitation Nothing SMSubscribe
@@ -645,7 +645,7 @@ testNotificationSubscriptionNewConnection apns baseId alice bob =
645
645
646
646
registerTestToken :: AgentClient -> ByteString -> NotificationsMode -> APNSMockServer -> ExceptT AgentErrorType IO DeviceToken
647
647
registerTestToken a token mode apns = do
648
- let tkn = DeviceToken PPApnsTest token
648
+ let tkn = APNSDeviceToken PPApnsTest token
649
649
NTRegistered <- registerNtfToken a tkn mode
650
650
Just APNSMockRequest {notification = APNSNotification {aps = APNSBackground _, notificationData = Just ntfData'}} <-
651
651
timeout 1000000 $ getMockNotification apns tkn
0 commit comments