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

APNS Documentation

Pinned Posts

Posts under APNS tag

259 Posts
Sort by:
Post not yet marked as solved
0 Replies
164 Views
在项目中用到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
Posted Last updated
.
Post not yet marked as solved
0 Replies
281 Views
Is there a way for the app currently playing music or voice in the background to know when a Critical Alert or push comes? Currently, my app contains code that stops playback when a call comes in while music or voice is playing in the background. So, if a call comes in during playback, it stops normally. However, there is a phenomenon in which playback cannot be stopped when a Critical Alert or push comes. When a Critical Alert or push comes to the device, is there a way in the code for the app currently playing music or voice in the background or foreground to know at that moment? We are not sending out Critical Alerts or pushes. I would like to know how to resolve the situation when receiving a Critical Alert or push sent to all users in one country.
Posted Last updated
.
Post not yet marked as solved
0 Replies
239 Views
Hello Forum, If I send the device the "DeviceInformationCommand.Command.RequestType= DeviceInformation" command and "InstalledApplicationListCommand.Command.RequestType = InstalledApplicationList" command , it can be sent successfully, but I don't get a response from the device. https://developer.apple.com/documentation/devicemanagement/get_device_information ------------- our log ---------------------- general.log.5:[2024/03/27 13:23:30] (172.31.54.87) I #TaskUpdateInformationHandler - did:14379, udid:63a6d7edc9f1128808aaee49d80e9539b5fd9cdd, mdm_task_uuids:['0aa5f838-1891-4a9b-b4fd-9d7c0aa365d3', '3f401ea8-be87-499b-a4be-fea2b1dab379'], result:ok, cid:117 general.log.5:[2024/03/28 03:06:34] (172.31.76.98) I #TaskUpdateInformationHandler - did:14379, udid:63a6d7edc9f1128808aaee49d80e9539b5fd9cdd, mdm_task_uuids:['c46b8523-40cd-4c7e-8a5d-0e49c9d26106', '8a99b664-df27-4bc9-8f41-fe39e3a7f3bc'], result:ok, cid:117 It is transmitted successfully to the Apple MDM server, but there is no response from the device. However, policy distribution such as PushSetting works normally. I would like to get some document or help that I can refer to. Thank you.
Posted
by Dave_Koh.
Last updated
.
Post not yet marked as solved
3 Replies
257 Views
I'm facing an issue where I can't play an audio file stored in my project after receiving a push-to-talk notification. Strangely, I'm able to play the audio file by tapping on a button before receiving the push notification, but it doesn't work afterward without any error messages. I've ensured that I've set up everything correctly in my project's capabilities. Any insights on what might be causing this issue would be greatly appreciated. I set everything in capabilities Set permission in .plist Request permission in app delegate I make connection to the room when app becomes active and received succes Then I setup .halfDuplex for this channel In restoredChannelUUID I activate AVAudioSession After sending the ppt push, I parse speaker and make it activeRemoteParticipant. I see than delegate function channelManager didActivate works good Where I tried to play audio from my player I see this prints in console, but no sound play
Posted
by dmitry225.
Last updated
.
Post not yet marked as solved
0 Replies
199 Views
大家好,我正在尝试制作一个关于如何检测手机屏幕前是否有物体的演示。如果有物体,屏幕将显示红色,如果没有物体,则显示绿色。这可能需要调用距离传感器,但我不知道如何调用它。希望大家能给我一个回应。谢谢。
Posted
by Esoting.
Last updated
.
Post not yet marked as solved
0 Replies
163 Views
background I want to know whether an installed app has added the "Removable" option that value is true reference We used InstallApplicationCommand with the Removable option to install the app to a managed device. https://developer.apple.com/documentation/devicemanagement/installapplicationcommand/command/attributes?language=objc Question matters I checked the following items, but no items could be obtained. https://developer.apple.com/documentation/devicemanagement/installedapplicationlistresponse?language=objc https://developer.apple.com/documentation/devicemanagement/installedapplicationlistresponse/installedapplicationlistitem?language=objc Is there any other way to determine whether an app installed on a device is removable?
Posted Last updated
.
Post not yet marked as solved
0 Replies
146 Views
I had post my app after a long develpment period, I don't know why. but in some devices works well, but in others is difficult to notice what is going on. First: my app is a softphone voip, but keep app open or in background for our register be active is not effective because of battery safety. Then is when apns coming in, we just need that or app come back to be active, even in background, to our call shows up. and this happens well in our development enviroment, exacly like I describe. but in some devices doesn't work at all. We are using apns and firebase tokens to identify our registers and devices, and keeping together in our server/DB. I will share a image to explain better the flux that I implemented: Yes, I followed all instructions to insert apns, p12 and p8 certifies in the project, I just don't know why is working only in some devices. If anybody try test this function in my app, doesn't will work because I put some rules about IP address.
Posted
by amaxphone.
Last updated
.
Post not yet marked as solved
0 Replies
166 Views
hello I'd like to transfer my application to another Apple dev account in the near future, my application uses FireBase cloud messaging to receive notifications What exactly should I do once the transfer is done? Should I just update the APNs authentication key on the FireBase console in Project parameters ? Should I also change the team ID on the fireBase console ? Does this mean generating a new GoogleService-Info.plist file and therefore an application update ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
235 Views
Our MDM customers often claim MDM push is not delivered to device and cannot manage devices via MDM. The user first uninstalled the old description file and then installed the new one, but after the new description file was installed, our mdm server did not receive any notification from Apple about updating the token, only received an Authenticate message We tried to restore network settings but it did not work. We hope to get your help to solve this problem. Currently, we can't figure out where the problem is.
Posted
by wutiezhu.
Last updated
.
Post marked as solved
1 Replies
219 Views
Hi, Has anyone found a way to send a push notification based on beacon region entry/exit? Since iOS 17, CLBeacionRegion which inherits CLRegion that made this possible is now deprecated and replaced by CLMonitor.CLBeaconIdentityCondition. CLMonitor.CLBeaconIdentityCondition does not only work properly on the latest version of iOS, it also lacks such features like sending push notifications based on region entry/exit. Even UNLocationNotificationTrigger only accepts CLRegion which is not possible to create one using existing classes that are not deprecated.
Posted
by peter292.
Last updated
.
Post not yet marked as solved
0 Replies
230 Views
Hi. I'm looking to schedule a number of notifications based on the user's location and have them be triggered UNLocationNotificationTriggers. I want to know whether notifications get delivered so I can limit the number of notifications the user receives in a day. I was hoping I could determine their delivery by either the UNUserNotificationCenterDelegate's method userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) (which only knows when the user has tapped on the notification or deleted it) or by UNUserNotificationCenter.current().deliveredNotifications() (which should return the notification if it was delivered and is in the Notification Center). UNUserNotificationCenter.current().deliveredNotifications() is not returning notifications that were delivered via UNLocationNotificationTriggers. I'm assuming this is for some privacy reason? All of the UNLocationNotificationTriggers are configured with notifyOnEntry to be true, notifyOnExit to be false, and repeats to be false. They get delivered appropriately, but I can't determine if/when they get delivered to ensure the user doesn't receive too many notifications. Notifications delivered with a UNTimeIntervalNotificationTrigger are returned as expected. Is all of this by design or is there another way to determine when a notification scheduled with a UNLocationNotificationTrigger gets delivered? I'm just trying to create the best experience for my users. Thank you.
Posted Last updated
.
Post not yet marked as solved
0 Replies
209 Views
I've got an app which has a notification service extension (and has had so for a few years). I noticed that the pushes were getting delivered directly to the user for a handset, and in the log could see a SpringBoard error saying Error Domain=PluginKit Code=4 RBSLanchRequest error trying to launch plugin Error Domain=RBSRequestErrorDomain Code=5 Launch failed ErrorDomain=NSPOSIXErrorDomain Code=111 Unknown error:111 I rebooted the phone and it started working as expected. But it's worrisome this happened, and it's not the first time I've seen it either. Observed with iOS 17.3.1
Posted
by mungbeans.
Last updated
.
Post not yet marked as solved
0 Replies
318 Views
I want to create passes with Dynamic QR Codes which changes based on T-OTP. Google wallet do have this feature called RotatingBarCode, while there is nothing like this in Apple wallet. Can we do this by updating the passes? If yes, how? If apple wallet pass are getting updates using webServiceURL, how can we create the endpoint and what the body of get request will look like?
Posted Last updated
.
Post not yet marked as solved
0 Replies
241 Views
Hi, I'm experiencing a bug that only occur in iPhone X/XS that run iOS 16.2. I couldn't tap the push notification when the app is already active. I need to trigger a feature when the push notification is tapped. When the app is on the background, it worked. But when the app is already active / on the foreground, it didn't. I tried this on an iPhone 8 Plus running iOS 16.2.1 and iPhone 14 and iPhone XR running iOS 17.1.2, but this bug didn't occur (ie. the tap was working and I can call didReceiveResponse callback). Why does this happen? Can anybody help me? Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
200 Views
We have been seeing a large increase of errors since March 5, 2024 starting around 8pm UTC. Example error response is http2: server sent GOAWAY and closed the connection; LastStreamID=2147483647, ErrCode=PROTOCOL_ERROR, debug="Stream 169 does not exist" We've been sending notifications the same way for about 8 months now, and a very similar way for over 2 years without this issue. Currently getting about an 8% failure rate on requests. Sending about 20,000,000 notifications a day. Has something changed that we need to modify our process for?
Posted
by duraug.
Last updated
.
Post not yet marked as solved
0 Replies
260 Views
Hello, Scenario: My app is running in the foreground, logged into my backend server and I have registered for push notifications and received a push token. I have pin code activated on the phone. I make some code changes and re-flash it in Xcode, the app is running in debug mode wired to Xcode. I put the app in the background and lock the screen and wait 30 sec until data protection is activated and the keychain cannot be accessed. I send a push notification. In this case didRegisterForRemoteNotificationsWithDeviceToken if often called with the same push token as I had before. Data is protected in this state, hence I cannot access the auth token and send the token to the server. In this case it is not needed since the token is the same, but it got me a bit worried. In didRegisterForRemoteNotificationsWithDeviceToken I send the push token to the server, as the Apple docs recommend. My concern now is: could didRegisterForRemoteNotificationsWithDeviceToken be called in a real scenario when the phone is locked and data protection is activated? The Apple docs say: Device tokens can change periodically, so caching the value risks sending an invalid token to your server. And gives an example: For example, UIKit calls the method when the user launches an app after having restored a device from data that is not the device’s backup data. In this case, since the user is initiating it, the phone is unlocked so data should be unprotected. But that is one example, what more scenarios could there be that triggers this function, and could data be protected in those scenarios? I'm worried that it could be triggered, even if its rare, in a state where data protection is activated, hence I cannot send the new push token to the server, and thus future remote notifications from the server will not be received by my app until the users logs out and logs in again.
Posted
by codenea1.
Last updated
.
Post not yet marked as solved
0 Replies
220 Views
I'm trying to implement a unique Id for each pass that someone adds to their wallet. Something like a unique membership Id or even something as simple as displaying a unique username. What is the process of setting this up? I already have everything set up to generate the pass and update the values of the pass fields, but how can I make this specific to a single pass? I feel like I have everything I need to support this but not sure of the workflow I should use. I found this endpoint: https://developer.apple.com/documentation/walletpasses/return_a_personalized_pass but unsure what the personalizationToken is or how I'd provide this. Is this the same as the "pushToken"? It also references this: https://developer.apple.com/documentation/walletpasses/personalizationdictionary/requiredpersonalizationinfo which seems to require previously entered user information.
Posted
by gonzosan.
Last updated
.
Post not yet marked as solved
0 Replies
282 Views
Hi Team, We are facing issues about VOIP call for some users in USA who used the Wi-Fi network of some service provider. They are not receiving the calls on Wi-Fi but able to receive the call when connected to SIM/Data Connection. We implemented the VOIP services of apple and VOIP notification received and call kit UI displayed. Its working fine on public network mostly but not working on some Wi-Fi network in USA. iPhone 12 Latest iOS version VOIP notification not received Call kit not display App Name=> Owwll
Posted
by almas542.
Last updated
.