Send push notifications to Mac, iOS, iPadOS, tvOS devices through your app using the Apple Push Notifications service (APNs).

Posts under APNS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

中国应用出海,海外用户频繁出现收不到推送消息
概述 应用的数据中心在海外 群名称:”CDC 大家樂集團 體驗群“ 群成员A、群成员B、群成员C 问题描述: ”CDC 大家樂集團 體驗群“聊天群里的成员A给成员C发群消息,C可以收到推送消息; 成员B给C发消息,C收不到推送消息;C不是一直都收不到B的消息,而是频繁出现收不到的情况。 B给C发送消息时,服务端调用APNs服务报异常:Notification rejected by the APNs gateway。 麻烦帮查一下是什么原因导致的服务端调用APNs服务报异常。
1
0
174
Apr ’24
Testing remote notifications with simulator
Greetings everyone, we have a problem testing remote notifications to our app runing in an iOS simulator, which should be possible for quite a while now. (https://nilcoalescing.com/blog/TestingRemotePushOniOSSimulator/) We made sure of the following prerequisites The system requirements (recent XCode, recent MacOS, Silicone Processor) are met The app build is set to testing The app is in fact generating a devicetoken and sendig it to our backend We are sending our requests to the api.sandbox.push.app.com environment Nonetheless, we always receive a status 400, error "BadDeviceToken" response from the APNS service. Doing the same with a physical device works like a charm, ie the message is received without any problems. We also tried sending the same device token to a production environment, but got the same 400/BadDeviceToken error. Also the simulator-generated token does not look distorted, ie it's also just a HEX string with the same length as the working token of the physical device. Is there anything else we need to check for this to work?
1
0
281
Apr ’24
Push notifications were not successfully delivered and have bad status
Hello everyone, I have been working on a macOS app that utilizes push notifications for the past year. Up until recently, everything was functioning correctly. However, now I'm experiencing issues where push notifications are either not being delivered at all or are experiencing significant delays, sometimes up to 10 minutes. Setting the priority header to 10 hasn't made any difference. I am currently using development push notifications, but the issue persists when switching to the production environment. I'm curious if anyone else has encountered similar problems. When checking the push console, it frequently reports that the device is offline, even though it's actually online ("discarded as device was offline"). Occasionally, notifications are delivered promptly, but this is becoming increasingly infrequent. This issue has been consistently reported by our testers, particularly after they updated to macOS Sonoma. Any insights or assistance you can provide would be greatly appreciated.
9
2
1.7k
Apr ’24
Starting Live Activity with APNs
I am trying to start a live activity using APNs, but it is not supported with firebase or onesignal, is there any other way to send a PN to the device, I have device token, bundle ID, team ID, and apnsKeyID. I also tried hitting this URL: 'https://api.development.push.apple.com/3/device/{deviceToken}', but it gives an error "unable to set private key file" even though I have given the path to my .pem file that has a private key in it enclosed under BEGIN CERTIFICATE and END CERTIFICATE. It will be great if someone could guide me here
0
0
243
Apr ’24
"volume": 0 in "sound" of push notification payload does not make volume "0".
I use the following push notification payload. { "aps": { "sound": { "name": "default", "volume": 0 } }, "type": "refresh" } When the iPhone received this, it sounds even though "volume" is set to "0". Is this iOS bug? Or dose "default alert sound" of iOS17 override this? I tested iOS17 and 16. This occurred both. Is there any way to set no sound when iPhone received a specific push notification like "type": "refresh".
0
0
201
Apr ’24
Easiest way to setup a wallet card distribution web service that can also send notifications?
Hi, I’m testing out different possibilities for a client that wants to have a loyalty card service where users can register to download and install a wallet pass. This wallet pass should be able to receive push notifications. I have found a library that can generate apple passes but I struggle to find a good direction with the notification / update service. I’m most comfortable with using PHP but any other easy solution is also welcome. What would be a good way to start and test things out? Thank you!
0
0
225
Apr ’24
PushKit (fileProvider) calling didInvalidatePushTokenFor instead of didUpdate (credentials)
I think I've got all the keys and entitlements set up ok. I have no problem receiving normal alerts via the UNUserNotifications framework. Now I'm trying to use PushKit (for fileProvider). I have the following in my AppDelegate fileProvider = PKPushRegistry(queue: nil) fileProvider.delegate = self fileProvider.desiredPushTypes = [.fileProvider] along with the required delegate functions. I am never provided with credentials, only an immediate call to the didInvalidatePushToken delegate. Any suggestions appreciated.
0
0
240
Apr ’24
Encountering 400 TopicDisallowed Error with APNS for Specific App
Hello Apple Developer Community, I am reaching out for insights regarding an issue we're facing with Apple Push Notification Service (APNS). Despite successful implementation and functioning for other apps, we are consistently receiving a 400 TopicDisallowed error when trying to send push notifications to one specific app. Here's a detailed overview: Issue Summary: Push notifications sent from our server to a specific app result in a 400 TopicDisallowed error from APNS. This problem is unique to this app; notifications to other apps with similar configurations are successful. Successful Tests via Apple CloudKit Console: Notably, when using the Apple CloudKit Push Notification Console, push notifications to the problematic app are sent successfully, indicating the app's basic setup is configured correctly. Key Details: The topic field in the push notification request matches the app's bundle ID exactly. The app is downloaded from the App Store, and we are using the production environment on our server. Payload structure, APNS endpoint, and APNS Auth Key are consistent across all apps we manage. Device tokens for the problematic app validate successfully using the tool in the push notification console. Detailed server-side logging has not revealed significant differences between successful and unsuccessful push notification requests. Given these factors, we are struggling to identify the root cause of this specific issue. I am wondering if anyone in the community has faced a similar problem or could offer any insights. Any help or guidance would be immensely appreciated. Thank you in advance!
1
0
356
Apr ’24
Can p8 Key be shared in anyway?
Hello. I have a very practical problem. A company would like me to develop an iOS app for them, and my counterpart is their company's marketing team. They want me to use their Firebase account for multiple purposes, but as they are marketing team, not IT team, they do not have Apple Developer account. So in this peculiar case, as I am the developer of the app, it seems they will need my p8 key to be placed in their Firebase account in order for Push notification to work. But I have concern as p8 key sounds like something private which I should not share with others. Can anyone share with me what I should do in this very practical case? Is p8 key supposed to be sharable to others? I have tried to google this topic but I don't have any answers. I have even tried to ask on stackoverflow but admin over there said this question is opinion-based and closed my thread.
1
0
191
Apr ’24
APNS key download issue
Has anyone had problems downloading a newly created APNS key? The first key I made downloaded fine. I realised I had made it on the wrong team, so I revoked it, changed team and made a new key. The first time I clicked Download, it said the key had already been downloaded. I suspected the problem was that I had named it the same as the one I had made in error, so I revoked that new key, and made a new one with a different name, but it still wouldn't download. Has anyone had this? Any workarounds? Thx.
4
0
399
Apr ’24
live activity with push notification custom sound
在项目中用到live activity,并且使用pushnotification来更新,其中sound是用自定义的,音频差不多5秒导入主工程中main bundle ,然后测试远程推送的Payload格式如下 { "aps": { "timestamp": 1712964986737, "event": "update", "sound": "socReminder10.mp3", "content-state": { "bindTime": 1712963986737, "soc": 38, "status": 1, "updateTime": 1712963986737 }, "alert": { "title": "电量低提示", "body": "您的电量已经低于40,请尽快换电" }, "mutable-content": 1, "badge": 0 } } 虽然收到推送的消息并更新但是声音还是默认的声音,不是我定义的声音,请问这个有没有什么解决方案 对了在正常的推送中是可以播放自定义的声音,唯独是live activity 的推送不行,希望能解决我这个问题,感谢,thanks
0
0
194
Apr ’24