Dear all,
I am seeking your assistance to finalize my registration in the Apple Developer Program. I have attempted to register multiple times using valid payment cards, but I received an email stating that my request would be processed within two business days, and that $99 would be deducted. However, two days have passed without any progress. I am unsure if the issue is related to using my friends' cards, despite their validity. In my last attempt, I provided a photo of my friend's ID card and his passport as proof of his consent for the deduction. Could the discrepancy between the cardholder's information and my registration details be the cause of the problem?
Thank you.
Notifications
RSS for tagLearn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.
Post
Replies
Boosts
Views
Activity
Apple Watch doesn't vibrate for notifications
version: 11.1
help please
I am developing an app which makes use of actionable notifications.
On my code (the func userNotificationCenter function), I need to read my users from the local storage on the iPhone:
let query: [String: Any] = [
kSecAttrService as String: "uio-auth",
kSecAttrAccount as String: "users",
kSecClass as String: kSecClassGenericPassword,
kSecReturnData as String: true
]
var result: AnyObject?
SecItemCopyMatching(query as CFDictionary, &result)
let ref = result as? Data
But when the same code execute when I tap on the notification on the Apple Watch, it doesn't fetch anything. It now occurs to to me:
Does it mean that when an actionable notification programmed for the iOS is displayed on the Apple Watch, it tries to access its own storage, and not the iPhone? If so, is there a nice way to pass the values to the watchOS so that when the callback for the actionable notifications run, it has then the data it needs?
Hello,
since updating (last night) to developer beta 18.2, I no longer have email count numbers / badges showing. I don’t know if others are experiencing this, but thought I should report it.
Hi,
I'm building an app that allows users to get real time data about trains in Portugal and the Metro system in Lisbon. I'm using SwiftUI for frontend.
I would like to add a feature to the app, where the User can add a specific Train to their Favourites list and subscribe to notifications about the status of that Train so that they are aware of any disturbances.
For example, 10 minutes before the train departure time, there would be an API call to fetch the train information, and a notification would be sent to the end-user with the status of the Train.
Can someone tell me if this is possible to do? And if so, how to do it?
Basically, I want to trigger an API call more-or-less at a specific time and, based on the data from the API, send a push notification to the User.
Thanks in advance
I am using a Key to connect my notification server with APNS in order to send out notifications to users. I have recently added notifications to a second app of mine, using the same notification server to fire off notifications for both apps. However, any notifications going to the second app return the error InvalidProviderToken, where as I get no such issues when send notifications to the first app. Everything, including the payloads, are exactly the same between the two apps, the only difference is that the device IDs are attached to different apps.
Does anyone know why/how this would happen and how I can resolve it?
Hey there, i created a independent Watch OS app and I configure push notification there.
so on watch simulator I am able to get push notification every time.
but today I test watch app to my real watch series 6 WatchOS 11.
I got the permission alert I allowed it, and I am able to get the device token as well now if I try to send push notification to my real watch app I get this logs.
Oct 22, 2024, 11:09:12.024 AM GMT+5
received by APNS Server
Oct 22, 2024, 11:09:12.334 AM GMT+5
discarded as application was not registered
why is that ? is there any body know's ? why i am not receiving remote notification on my real watch instead i get that my application is not register...
Over the past few weeks I've seen several people mention pushes sent via the sandbox haven't been getting delivered.
Today I'm also seeing that (though pushes sent via production are fine).
So it would appear to be down again. What's going on recently, any reason it's so unstable these last few weeks?
I have an iOS and watchOS app where both can run independently, I am not using WatchConnectivity to send data back and fourth. The issue I'm having is that if I schedule a local notification on the watch and the phone is unlocked, it will not show on the watch for about 10-15 seconds. If I uninstall the iOS app or have the phone locked, it will show immediately on the watch.
To my understanding, this is somewhat the expected functionality but is there a way to bypass it? My app is a timer app and it really should not have a delay.
Regarding the latest news from apple below. I am not able to understand what exactly needs to be done. I can download RSA certificate from the link given but to include it in Trust store is something i am not able to get.
can someone help me out here?
" The Certification Authority (CA) for Apple Push Notification service (APNs) is changing. APNs will update the server certificates in sandbox on January 20, 2025, and in production on February 24, 2025. All developers using APNs will need to update their application’s Trust Store to include the new server certificate: SHA-2 Root : USERTrust RSA Certification Authority certificate.
To ensure a smooth transition and avoid push notification delivery failures, please make sure that both old and new server certificates are included in the Trust Store before the cut-off date for each of your application servers that connect to sandbox and production.
At this time, you don’t need to update the APNs SSL provider certificates issued to you by Apple."
The Certification Authority (CA) for Apple Push Notification service (APNs) is changing. APNs will update the server certificates in sandbox on January 20, 2025, and in production on February 24, 2025. All developers using APNs will need to update their application’s Trust Store to include the new server certificate: SHA-2 Root : USERTrust RSA Certification Authority certificate.
To ensure a smooth transition and avoid push notification delivery failures, please make sure that both old and new server certificates are included in the Trust Store before the cut-off date for each of your application servers that connect to sandbox and production.
At this time, you don’t need to update the APNs SSL provider certificates issued to you by Apple.
Hi Everyone,
I noticed that applicationIconBadgeNumber has been deprecated in iOS17. While there's a new method to set the badge number using setBadgeCount(_:withCompletionHandler:), I couldn't find a way to retrieve the current value.
Previously we used to call UIApplication.shared.applicationIconBadgeNumber, to get the current value, which is deprecated now.
Does anyone know how to get the current badge count?
Thanks!
I'm attempting to leverage notifications in an app that is in Swift 6 language mode. I have the following code:
func startLocationUpdates() {
//if self.manager.authorizationStatus == .notDetermined {
// self.manager.requestWhenInUseAuthorization()
//}
self.logger.info("Starting location updates")
Task {
do {
let updates = CLLocationUpdate.liveUpdates()
for try await update in updates {
if !self.updatesStarted { break } // End location updates by breaking out of the loop.
self.lastUpdate = update
if let loc = update.location {
self.lastLocation = loc
self.isStationary = update.stationary
self.count += 1
self.logger.info("Location \(self.count): \(self.lastLocation)")
}
if lastUpdate!.insufficientlyInUse {
let notification = UNNotificationRequest(identifier: "com.example.mynotification", content: notificationContent, trigger: nil)
try await UNUserNotificationCenter.current().add(notification)
}
}
} catch {
self.logger.error("Could not start location updates")
}
return
}
}
As an aside, the above is directly taken from the following sample:
https://developer.apple.com/documentation/CoreLocation/adopting-live-updates-in-core-location.
With Swift 6 language mode enable, this generates a compiler error for the statement:
try await UNUserNotificationCenter.current().add(notification)
Sending main actor-isolated 'notification' to nonisolated instance method 'add' risks causing data races between nonisolated and main actor-isolated uses
How can I fix this?
Our application streams live video with AVCaptureSession. When application is active and Airpods case is being opened at this time, popup message "Not Your Airpods..." is appeared over application and video session is suspended.
I can see that application receives notification UIApplicationWillResignActiveNotification, so application becomes inactive at this time.
Is there any ability to disable such pairing popup from Airpods or maybe intercept it inside our application? Because it affects our video streaming feature.
Thanks.
Hello everyone,
We have an app that implements in-app purchases, and we're using the notification settings outlined in this Apple Developer guide. Everything is functioning correctly in TestFlight, and our server successfully receives notifications from Apple.
However, after releasing the app to production, we're no longer receiving these notifications, while the TestFlight version continues to work as expected.
Has anyone encountered a similar issue or have any suggestions on how to resolve this?
Thank you for your help!
I keep getting 401 Unauthorized error when fetching Apple's public keys.
In [14]: print(f"Error fetching public keys: {response.status_code} {response.text}")
Error fetching public keys: 401 Unauthenticated
I've verified that the Key ID, Issuer ID, and private key file are all correct, with the private key having admin access. The server time is correctly set to UTC. Given this, I can't identify what might be causing the issue. Any insights?
def generate_apple_developer_token():
# Load the private key in PEM format
with open(PRIVATE_KEY_FILE, 'rb') as key_file:
private_key = serialization.load_pem_private_key(
key_file.read(),
password=None,
backend=default_backend()
)
# JWT header
headers = {
"alg": "ES256",
"kid": KEY_ID,
"typ": "JWT"
}
# JWT payload
payload = {
"iss": ISSUER_ID,
"iat": int(datetime.utcnow().timestamp()),
"exp": int((datetime.utcnow() + timedelta(minutes=10)).timestamp()),
"aud": "appstoreconnect-v1",
}
# Encode the header and payload as base64
header_base64 = base64.urlsafe_b64encode(json.dumps(headers).encode()).decode().rstrip("=")
payload_base64 = base64.urlsafe_b64encode(json.dumps(payload).encode()).decode().rstrip("=")
# Concatenate header and payload
message = f"{header_base64}.{payload_base64}".encode()
# Sign the message using ECDSA with SHA256
signature = private_key.sign(
message,
ec.ECDSA(hashes.SHA256())
)
# Convert the DER-encoded signature to raw format (r and s concatenated)
der_to_raw_ecdsa_format = lambda der: der[4:36] + der[-32:]
# Convert the signature to raw format (64 bytes)
signature_64 = der_to_raw_ecdsa_format(signature)
# Base64 URL-encode the signature
signature_base64 = base64.urlsafe_b64encode(signature_64).decode().rstrip("=")
# Concatenate header, payload, and signature to form the JWT
jwt_token = f"{header_base64}.{payload_base64}.{signature_base64}"
return jwt_token
def get_apple_public_keys():
try:
# Generate a fresh JWT
developer_token = generate_apple_developer_token()
# Set up headers with the authorization token
headers = {
"Authorization": f"Bearer {developer_token}"
}
# Fetch the public keys from Apple
response = requests.get('https://api.storekit.itunes.apple.com/in-app-purchase/publicKeys', headers=headers)
# Log the response if it's not successful
if response.status_code != 200:
print(f"Error fetching public keys: {response.status_code} {response.text}")
response.raise_for_status() # Raises an exception for 4xx/5xx errors
# Parse and return the public keys
response_data = response.json()
keys = response_data.get('keys')
if not keys:
print("No 'keys' found in the response from Apple.")
return []
return keys
except requests.exceptions.RequestException as e:
print(f"Error fetching Apple's public keys: {e}")
return []
There is an issue with our app when showing a dynamic watch notification. Our app would sometimes receive a push notification with extra payload. In wOS6, the notification would be sent to the watch and show a dynamic detailed notification based on the data within the notification. But ever since wOS7, the watch does not show the data that is being sent.
We found out that the UNNotification that is being passed through in WKUserNotificationInterfaceController via. [didReceive:notification:](https://developer.apple.com/documentation/watchkit/wkusernotificationinterfacecontroller/2963125-didreceive) has an empty [userInfo](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649869-userinfo).
I was wondering if anyone else have that issue. Or was there a change in wOS7 that prevents the userInfo from being received by the watch? Thanks!
I would like to do exactly this but the API doens't seem to allow it. Was wondering if there were any creative workarounds? Basically, I have a reminder app that needs to send reminders at a certain time each day (there are several of these reminders per day). Each reminder has a couple of follow-ups scheduled at 5 min intervals.
If a user takes action on the task before the reminder is sent however, I would like to unschedule that notification (and follow ups) until the next day. The unscheduling part is easy, but there seems to be no reliable way to re-schedule it for the next day and continue repeating.
Looked into background tasks and they don't seem intended for these purposes nor do they seem reliable. The user isn't guaranteed to take action on notifications nor open the app within a 24-hour period after they have taken action on their task.
Hello, we have an app that has a case where the user can turn on a feature that starts a timer for a thing when they arrive at a specific location.
Our app also has a live activity to show the timer.
Naturally, we're trying to make our live activity to start counting when the geofence triggers, but we get ActivityAuthorizationError.visibility. If an activity is already running, it's possible to turn it off.
So, our question is basically if there's any way to make the geofence trigger start our live activity?
Thanks
I'm scheduling local notifications on my WatchOS app, but they are always alerting exactly 13 seconds later than scheduled. I have read other users having the exact same issue but there is no solution anywhere. I'm not sure how one is supposed to write any sort of timer app when they are always coming in delayed. Any idea why this occurs and how to resolve it? For now I am subtracting 13 seconds from the end time, but that's not really a solution I'm happy with.
Thanks