Notifications

RSS for tag

Learn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.

Notifications Documentation

Post

Replies

Boosts

Views

Activity

Handling Subscription Status Updates with Apple Notification V2
We are using Apple Notification V2 and supporting only one subscription service per user (e.g., Netflix with Basic, Premium plans). In Notification V1, we could fetch the latest subscription information using the /verifyReceipt API. However, the documentation for Notification V2 suggests using SignedDataVerifier to decode the data locally. This raises a concern that the data received via notification might not always be up-to-date. For example, if a user cancels a subscription but the server fails to process the notification for some reason, and later the user upgrades and resumes the subscription, the new notification succeeds. In this scenario, the previously failed cancellation notification will be resent after some time. How should the backend server handle this? Should we always use APIs like get all subscription statuses to fetch the latest data instead of solely relying on the decoded data from each notification?
1
0
357
Jul ’24
Subscription Product Identifier Issue
Hello! I am writing to seek your assistance regarding an issue we have encountered with the in-app purchase subscriptions in our application. Issue Description In our application, when a user initially subscribes and opts for the free trial, the product identifier is co.cleaner.storage_001. However, upon renewal, the product identifier changes to co.cleaner.storage_003. This change is causing issues because our backend system relies on the product identifier to manage subscriptions. Assistance Required We would like to understand the following: Does Apple change the product identifier when transitioning from a free trial to a renewal? If so, how should we handle this situation? Is there any configuration or setting that can ensure the same product identifier is used during both the free trial and the renewal period? Any recommendations or solutions to ensure our subscription management system can correctly handle user renewals. Attached are the first free trial data and the renewal notification data for your reference. Thank you very much for your help and support. I look forward to your response. Best regards, first free trial data renewal notification data
0
0
153
Jul ’24
Subscription Product Identifier Issue
ello! I am writing to seek your assistance regarding an issue we have encountered with the in-app purchase subscriptions in our application. Issue Description In our application, when a user initially subscribes and opts for the free trial, the product identifier is co.cleaner.storage_001. However, upon renewal, the product identifier changes to co.cleaner.storage_003. This change is causing issues because our backend system relies on the product identifier to manage subscriptions. Assistance Required We would like to understand the following: Does Apple change the product identifier when transitioning from a free trial to a renewal? If so, how should we handle this situation? Is there any configuration or setting that can ensure the same product identifier is used during both the free trial and the renewal period? Any recommendations or solutions to ensure our subscription management system can correctly handle user renewals. Attached are the first free trial data and the renewal notification data for your reference. Thank you very much for your help and support. I look forward to your response. Best regards,
0
0
136
Jul ’24
Can I use Screentime API in CLLocationPushServiceExtension?
Can I use Screentime API in CLLocationPushServiceExtension? For example, I am curious about whether it is possible to set a managed setting in the Screentime API to limit app usage time or change the time limit. If the implementation of the above function is impossible or causes rejection by the App Store, is there a way to use the Screentime API in the background through push notification?
1
0
457
Jul ’24
Connection Reset between F5 and APNS
Our Java backend application is responsible for sending millions of push notifications. However, we are encountering an issue where thousands of connection resets occur daily. This irony leads to an inability to keep up with the volume, resulting in a lag that affects real-time performance. The application is built on Java, utilizing JDK 1.8 and the Apache HttpClient for network communications. Below is the Maven dependency we use: XML Additionally, we employ Spring’s RestTemplate to dispatch push notifications. Here is a snippet of the pseudo-code used to call the Apple Push Notification service (APNs): Java ResponseEntity postForEntity = restTemplate.postForEntity(apnsURL, entity, responseType); getResponse(aPNSResponse, postForEntity); AI-generated code. Review and use carefully. More info on FAQ. It’s important to note that our calls to APNs are not made directly but are routed through an F5 load balancer, which then communicates with the APNs endpoint. Could someone guide us in the right direction to resolve these connection reset issues?
4
0
336
Jul ’24
Questions about ConsumptionRequest properties
Hello. platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase?
1
0
376
Jul ’24
Are push to start APNs tokens the same across different live activity types?
The ActivityKit API requires developers to parameterize calls to pushToStartTokenUpdates by the live activity's attributes, e.g. for await data in Activity<AdventureAttributes>.pushToStartTokenUpdates { // Send token to server. } for await data in Activity<BoringAttributes>.pushToStartTokenUpdates { // Send token to server. } At runtime, I have noticed that the token is the same for the different live activity attribute types we support in our app. Can someone confirm if this behavior is consistent? If the pushToStartToken is the same across different live activity types, it can simplify our database design 🙏🏼.
2
0
477
Jul ’24
com.apple.developer.usernotifications.filtering
Nous souhaitons activer l'entitlement com.apple.developer.usernotifications.filtering pour notre extension MsgNotificationService. Pourriez-vous nous fournir des instructions supplémentaires ou activer cet entitlement pour notre App ID ? Si des informations supplémentaires sont nécessaires ou des étapes spécifiques doivent être suivies. actuellement cela n'a pas d'impact sur le build mais sur le product->archive. impossible upload le build Une idée, un conseil ? Merci,
2
0
315
Jul ’24
Text-to-speech when you receive an important alert while the app is closed
If you are receiving a regular push notification and try to read the content of the push notification in AVSpeechSynthesizer, it will read the text when the app is in the foreground, but when the app is closed, stopped, or in the background, it will display “Unable to list audio folders” and the text cannot be read. I couldn't find anything in the documentation about whether this works for critical alerts, so if anyone knows, please let me know. This text has been translated with DeepL
1
0
205
Jul ’24
Custom Push Notification for Apple Wallet Pass not Showing up on iPhone
I've implemented pass generation successfully and it's updated through Apple's silent notification, which updates the passes to their latest versions. I want to send some marketing push notifications to the Apple Wallet App as shown in my post at stackoverflow. Here is the Silent notification implementation, which is working perfectly fine. const options: apn.ProviderOptions = { token: { key: fs.readFileSync("./certs/APNs_AuthKey_7YYF346FU5.p8"), keyId: "******", teamId: "******", }, pfx: fs.readFileSync("./certs/private_key.pem"), cert: fs.readFileSync("./certs/certificate.pem"), production: true, rejectUnauthorized: true, }; const apnProvider = new apn.Provider(options); async function sendSilentPushNotification( deviceTokens: string[], serialNumber: string ) { try { const notification = new apn.Notification(); notification.topic = "pass.com.digital.passmaker"; notification.payload = { aps: { "content-available": 1, }, serialNumber, }; notification.priority = 5; return await apnProvider.send(notification, deviceTokens); } catch (error) { logger.error("Apple Notification error: " + error); return error; } } Here is the marketing notification I am trying to send, it is working with success, but I don't see any notification on mobile phone. please help me to fix it. async function sendCustomPushNotification( deviceTokens: string[], serialNumber: string, title: string, body: string, category?: string, badge?: number ) { try { const notification = new apn.Notification(); notification.topic = "pass.com.digital.passmaker"; // Set the title and body of the notification notification.alert = { title: title, subtitle: "Pass Update", body: body, }; // Set the sound to play when the notification is received notification.sound = "default"; // Set the badge number on the app icon (optional) if (badge !== undefined) { notification.badge = badge; } notification.contentAvailable = true; notification.mutableContent = true; notification.aps.category = category; notification.aps.alert = { title: title, body: body, }; notification.aps.badge = badge; notification.aps["content-available"] = 1; notification.aps["launch-image"] = "https://banner2.cleanpng.com/20180423/gkw/.......jpg"; // You can still include the serialNumber in the custom payload notification.payload = { serialNumber: serialNumber, aps: { "content-available": 1, "mutable-content": 1, "interruption-level": "time-sensitive", }, }; // Set to high priority notification.priority = 10; return await apnProvider.send(notification, deviceTokens); } catch (error) { logger.error("Apple Notification error: " + error); return error; } } I literally receive a success response from api returning the device pushToken with no errors. However, no notification show on my iPhone
0
0
325
Jul ’24
Not receiving push sent when device was offline
Hi, we noticed some issues with our app when it comes to receiving pushs sent when a device was offline. We know that only one push is stored if multiple are received while the device was offline but we got reports of multiple users that aren't receiving any pushs that were sent while they were offline. Reinstalling the App didn't help. We ruled out the third-party providers we used as my first thought was that there was some issues with setting the expiry but it also happens if directly sent over APNs. With a development build and the sandbox APNs I had no issue receiving one push after getting back online. But after reinstalling the production app no push after being offline. Example sent with the Push Notifications Console but I also tested it with curl directly: curl -v \ --header "authorization: bearer ${AUTHENTICATION_TOKEN}" \ --header "apns-topic: de.alarm-it-factory.ACC-App-Xamarin" \ --header "apns-push-type: alert" \ --header "apns-priority: 10" \ --header "apns-expiration: 1721379960" \ --data '{"aps":{"alert":{"title":"Test","body":"Expiry Test 4"}}}' \ --http2 https://api.push.apple.com:443/3/device/46F201D299F2B900CF3BF3096341116B9D5A69D103F2C0ACF18634823F73AB79 Sent: 15. Juli 2024, 16:00:42,361 MESZ Received: not received Topic: de.alarm-it-factory.ACC-App-Xamarin BundleID: de.alarm-it-factory.ACC-App-Xamarin Token: 46F201D299F2B900CF3BF3096341116B9D5A69D103F2C0ACF18634823F73AB79 apns-id: ec14fba2-efa5-4ace-9e22-3e4e5a64d630 I sent test messages before and after acivating airplane mode to make sure I have the correct token.
1
0
314
Jul ’24
CommunicationNotifications error
I'm trying to use communication notifications but I am getting this error in my logs. I've already checked my entitlements and signing & capabilities. I have notifications, communication notifications, and siri enabled. [com.testapp] _UNNotificationContentType is 'UNNotificationContentTypeMessagingDirect' but messaging notifications are not allowed. Abandoning communication API features for all messaging notifications. Perhaps app isn't allowed to donate messaging intents or is missing the communication entitlement.
0
0
135
Jul ’24
Notification Service Extension is initialized but never triggered
Hi all, I'm attempting to implement a notification service extension for my app, however I'm running into some troubles with triggering the extension. The service extension is successfully installed with the app, and is initialized when a notification is received (which ive confirmed by attaching a debugger to it), however the didReceive method is never called. In the debugger console, the following message is printed: Service extension base class recieved didReceiveNotificationRequest: . I can confirm that the all the payload requirements are met to trigger the extension, and I was able to create an extension that would trigger in a blank application (using the same payload). It's only this app that prints this message to the console, and does not trigger. The extension code is as follows (I've removed all of the intended functionality at this point to try and pinpoint the issue) class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override init() { self.contentHandler = nil self.bestAttemptContent = nil print("startup!") } func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) async { let logger = Logger(subsystem: "app.revolt.chat", category: "notificationservice") logger.info("Invoked notification extension") debugPrint(request) self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) guard let bestAttemptContent = bestAttemptContent else { print("content is null") return } bestAttemptContent.title = "beans" if request.content.categoryIdentifier != "ALERT_MESSAGE" { bestAttemptContent.subtitle = "not an alert message" contentHandler(bestAttemptContent) return } contentHandler(bestAttemptContent) } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { contentHandler(bestAttemptContent) } } }
0
0
414
Jul ’24