Post not yet marked as solved
Hi,
How can I send push notification for point update and promos to my loyalty wallet users. Currently I get push notification Id when user install loyalty wallet and I use it for sending wallet updates. But when I tried to use this push notification id for custom APN messages it doesn't appear anywhere.
Thank you.
Post not yet marked as solved
I'm trying to get push tokens for Live Activities but I am getting the same token twice, Why is that?
Is there any other way to get the token just once, so I can hit the API to save the token.
Here's the code:
Task {
for await data in runningActivity.pushTokenUpdates {
let myToken = data.hexString
self.count += 1
print("Count \(self.count)\n" + myToken)
}
Output:
Count 1 80dc21086f81.........646d7084805dc
Count 2 80dc21086f81.........646d7084805dc
I can't seem to understand why this is happening, and some times it takes significantly longer to get the tokens. Am I doing anything wrong? Please do share your thoughts.
Thank you!
Post not yet marked as solved
Hello,
On one of our test devices, we stopped receiving push notifications on our app. Upon investigation we noticed that APNs is returning a 410 status code when we try to deliver a notification to this device.
In our iOS code, on every launch we call the registerForRemoteNotifications() method of UIApplication to request the device token. Upon successful registration, we receive the token in our app delegate’s application(_:didRegisterForRemoteNotificationsWithDeviceToken:) method. Each time we continue to receive the same token as before, and this token continues to receive a 410 response from APNs.
How can we get more info on why this token has been marked as Inactive/Expired by APNs?
Why is APNs giving us the same token on device if it has been marked as Inactive/Expired?
What is the best way to start receiving push notifications on this device for our app? Is it possible to get a new token without deleting and re-installing the app?
Post not yet marked as solved
I'm following Apple guidelines to add the Location Push Service Extension to our app.
I followed these steps:
I applied and got approved for Location Push Service Extension.
My app already asks the user for "Always" permissions for location updates
I added the entitlement key com.apple.developer.location.push = TRUE
I added to the project a new Target, and selected Location Push Service Extension from the iOS Application Extension group
I encouter the following issue. When I run the app and call
startMonitoringLocationPushes(completion:)
I receive the following error:
Error Domain=CLLocationPushServiceErrorDomain Code=1 "(null)"
By looking at Apple documentation for CLLocationPushServiceErrorDomain, code 1 stands for:
missingPushExtension
An error code that indicates the app is missing a Location Push Service Extension.
As mentioned beofore I already added the Location Service Extension Target to the project. Any idea of why I receive this error?
Thanks
Post not yet marked as solved
Hello Everyone!
After push notifications were enabled we got to work on this feature. for our PWA.
The problem that we are having is that they work great for a little bit and then they suddenly stop working. We thought it was our problem but after doing some research I found that many other developers are having this same issue.
Push notifications work perfectly on Android but don't reach ios users.
Is anyone else having the same issue? Can something be done to fix this?
Thanks!!
Post not yet marked as solved
I have already updated the token of APNs to refresh every 60 minutes. However, I still receive the "TooManyProviderTokenUpdates" error. I'm wondering if I would still encounter this error if there are multiple devices that need to receive notifications and they are all sent from the same server.
Post not yet marked as solved
Hi there,
Our app is installed on tablets provided to customer workers for performing tasks. We're currently implementing Push Notifications using AWS SNS and FCM. The goal is to send data-only (silent) push notifications to trigger a function that creates a record in the app's local DB.
This approach allows us to control how the message is displayed in the foreground and background using Notifee. While this works well on Android in all states (foreground, background, killed), we're facing an issue on iOS, specifically in the release build.
The silent push notifications only reach devices when the app is in the foreground, not in the background or killed states. Normal push notifications work fine, but we require the ability to send silent notifications for better processing control. Upon researching, we discovered that Apple has strict guidelines for these notifications to prioritize user experience, battery usage, spam prevention, and privacy. However, in our case, the tablets are dedicated work devices with only our app installed.
Given this context, is there a reliable solution to send silent push notifications to iOS devices with the app in the background or killed states?
Post not yet marked as solved
Hey there, I'm new to iOS. Please help me that how we know that user clicked on live Activity. This means how to track the click of live activities.
And another question is How to know the notification received on the device to update the live activity. This means tracking notifications received on the device.
I tried all the APNS notification delegates but nothing get happened when a live activity update push was received.
Thanks.
Post not yet marked as solved
I am trying to implement Safari Web Push using the document to setup APNS and receive silent push messages on a react app on Safari browser.
At this point, I have added an endpoint to get push packages on calling window.safari.requestPermission. This prompts the user to enable notification and grants the permission and returns with a device token.
I have a server-side node script implemented using node-apn to send a silent push message to the client using a device token. The send function resolves with a successful response.
Sample message packet that I am sending via APNS:
{
"aps": {
"content-available": 1
},
"customData": "custom data",
"topic": "web.push.ID"
}
I am expecting the payload to be delivered to the client through an event. I am trying this with the below function on the web page.
window.addEventListener('push', function (event) {
if (event && event.push) {
const payload = event.push;
console.log('safari received payload in window.addEventListener:', payload);
}
});
However, I do not see any message coming to the client.
Can someone please point me to what I am missing here? Thanks a lot for your help in advance.
Post not yet marked as solved
I am hitting a limit: https://a.cl.ly/WnumLpxl
My understanding is I have more than 2 keys for APN.
I deleted the old keys, even though I am way under the limit, to have only two outstanding APN Keys.
But I still have this limit.
Post not yet marked as solved
Is it possible to schedule a local notification that contains an Ad in iOS?
The app will be using an SDK that allows for ad content to be downloaded then presented as a local notification at a later time.
Does this practice break App Store guidelines in any way?
Post not yet marked as solved
Since from few days we are facing bad device token issue even configuration is proper from frontend and from backend and with valid token. And also we are receiving device token with the length of 160 characters. Is that correct?
Post not yet marked as solved
I have a Push Notification Servis and I serve hundreds of applications to send notifications. But an application sometimes send notifications successfully but sometimes get stream closed exceptions. I don't understand why is happening.
Stack Trace;
io.netty.handler.codec.http2.Http2Exception$StreamException: Stream closed before write could take place
at io.netty.handler.codec.http2.Http2Exception.streamError(Http2Exception.java:167)
at io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$FlowState.cancel(DefaultHttp2RemoteFlowController.java:481)
at io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$1.onStreamClosed(DefaultHttp2RemoteFlowController.java:105)
at io.netty.handler.codec.http2.DefaultHttp2Connection.notifyClosed(DefaultHttp2Connection.java:356)
at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.removeFromActiveStreams(DefaultHttp2Connection.java:1000)
at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.deactivate(DefaultHttp2Connection.java:956)
at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultStream.close(DefaultHttp2Connection.java:512)
at io.netty.handler.codec.http2.DefaultHttp2Connection.close(DefaultHttp2Connection.java:152)
at io.netty.handler.codec.http2.Http2ConnectionHandler$BaseDecoder.channelInactive(Http2ConnectionHandler.java:209)
at io.netty.handler.codec.http2.Http2ConnectionHandler.channelInactive(Http2ConnectionHandler.java:417)
at com.eatthepath.pushy.apns.ApnsClientHandler.channelInactive(ApnsClientHandler.java:514)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81)
at io.netty.handler.timeout.IdleStateHandler.channelInactive(IdleStateHandler.java:278)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:388)
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:353)
at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1075)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1403)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:912)
at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:816)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:416)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:515)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Post not yet marked as solved
I want to configure Firebase Cloud Messaging as secondary project & analytics as default project. Analytics works as default app, but FCM is not working as secondary app. FCM also woks as default app but requirement is FCM have to setup as secondary app.
// Configure FIRApp.
let secondaryOptions = FirebaseOptions(googleAppID: "1:844153255576:ios:1e34bfjdjhgfouycfjvefrhvr2ed",
gcmSenderID: "625478876345263")
secondaryOptions.apiKey = "AIzaSyA-eygfwergFDSYRTWDVWEGVHHHB_HFM"
secondaryOptions.projectID = "fcmdemo-81b20"
secondaryOptions.bundleID = "com.own.Demo1"
secondaryOptions.appGroupID = nil
FirebaseApp.configure(name: "fcm", options: secondaryOptions)
if let apps = FirebaseApp.allApps {
print("apps:\(apps)")
}
Messaging.messaging().isAutoInitEnabled = true
FirebaseApp.configure()
Messaging.messaging().delegate = self
Post not yet marked as solved
Hey there, I'm using live activities in my iOS app.
All setups are done and the live activities feature is working fine.
But I'm facing a problem with tracking the live activities.
When an update is received on the device by token-based push, How can we track it?
When a user tap on an activity at the lock screen it launches the App, So can we track the user's click?
I'm stuck in the middle of it. Please help me out.
Thanks.
Post not yet marked as solved
lately, we found out that all notifications from the app I developed suddenly vanished for no reason when a new notification arrived.
Mostly this case happened on iOS 16, and the notification has threadID by which we want to fulfill the notification grouping.
When I continuously sent 4-5 notifications to my iPhone this case will happen. Problem screen recording
did anyone encounter this situation? Why and how to fix it
Post not yet marked as solved
I have found that the live activity push notification payload was changed from event -> events.
https://developer.apple.com/documentation/activitykit/updating-and-ending-your-live-activity-with-activitykit-push-notifications
Is it a mistake or it has been updated?
Post not yet marked as solved
Hello everyone,
I’m developing an app using Flutter. Users can establish a websocket connection in order to receive order requests from the server. However, when I lock the screen, the socket connection disconnects. I have Background Process and Background Fetch enabled through Xcode. Is there a way to keep the app alive even if it is in background? I only need the websocket connection to stay alive. Thank you!
Post not yet marked as solved
I can't response Delivery Log after sending a production environment notification using the Notifications Console, but I can for the development environment.
Our app is not localized but we want to begin the localization process starting with push notifications we are going to integrate. The documentation notes:
you can store your message strings in the Localizable.strings file of your app bundle and use the title-loc-key, subtitle-loc-key, and loc-key payload keys to specify which strings you want to display
String Catalogs in Xcode 15 supersedes Localizable.strings. How do you support this when using String Catalogs? Do you just manually add a Localizable.xcstrings file to your project then manually add a new entry for your loc-key, and the system will find this string without issue? Or will we need to have a Localizable.strings file too?