I'm using firebase cloud messaging, and I want to show image in notification. I followed https://firebase.google.com/docs/cloud-messaging/ios/send-image
When I post notification with PNG, it seems well. However, for WebP image, it doens't works.
APNS
RSS for tagSend 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
HI,
i am Mehmood khan Computer Science Student from Pakistan and i have a project in client want to made an automate application that when the message from specific number comes to me it transfer that message to my laptop i want to automate this how i acan automate this please help me or i us shell script or python script for it
Hi,
My app works correctly in debug with Mac Catalyst and receive push, when I uploaded in TestFlight and installing from TestFlight not receiving any more push but the server of apple respond 200 ok.
we don't use certificate but keyID.
I am trying to refresh my widget through Silent Push Notifications.
I have the background value as well as content-value = 1.
However 99% of the time if the app is in the background or has been fully terminated/exited, the silent push notification won't start the app.
I also tried logging the method that runs when the notification is received and it seems like it only gets called once the app is re-launched manually.
Do I need to do anything to get it to get my widget to refresh when some events happen on the backend? Android is really smooth when it comes to implementing similar logic.
I have my own iOS app that works great. But I needed to connect Location Push Service Extension to this application.
The steps I performed: I got the entitlement for location push type, created certificates, profiles for this service, then I implemented this service by connecting all profiles to it and adding to .entitlements com.apple.developer.location.push. In the AppDelegate of my application, I create a service that has a CLLocationManager in it, which monitors the departure of the application to the background and immediately calls the startMonitoringLocationPushes method. startMonitoringLocationPushes works fine and gives me APN token. But when I try to send a notification to the device, the service is not even called.
The push structure looks like this:
payload: {},
compiled: false,
aps: {},
expiry: -1,
priority: 10,
topic: 'ru.profsoft.alertonDev.location-query',
pushType: 'location'
}
[headers] {
'apns-topic': '<MainAppID>.location-query',
'apns-push-type': 'location'
}
I use a small service on Node JS to send push notification to APN and it successfully delivers them, and the Apple console also successfully delivers them
But when device is successfully gets any location push, service is not calling.
I started to use Debug -> Attach to process by PID or Name and got this error:
Thread 1: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=24 MB)
But my LocationPushService contains only autogenerated code without any extra implementation.
Also I checked Console and found these errors when I delivered push to the device:
This is first error's description:
Failed to get LSApplicationRecord for <RBSLaunchRequest| xpcservice<ru.profsoft.alertonDev.AlertonLocationPushServiceDev([osservice<com.apple.locationpushd>:201])>; "Launching extension ru.profsoft.alertonDev.AlertonLocationPushServiceDev(BB972E40-8E19-48D5-B05D-13A5D9D7005B) for host 201"> with error Error Domain=NSOSStatusErrorDomain Code=-10814 "(null)" UserInfo={_LSLine=1538, _LSFunction=runEvaluator}
Can anybody help with this?
Our Vendor MDM CSR certificate will expire in a month. We are trying to renew/update it, but we are unsuccessful. We keep getting the message "Certificate signature Verification failed because the signature is invalid." Has anyone dealt with the renewal, or can anyone advise? We do everything according to the Apple documentation, but unfortunately there is not as much about renewal the certificate as there is about initially creating it. Can anyone help? Thank you
I have enabled developer mode in flutter app development.
I am using Firebase Cloud Messaging to send notifications.
everything works fine There is a notification coming to the normal app.
But after a while I can no longer send notifications to the app.
{"multicast_id":5417898622260949101,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}
The fcm device token doesn't seem to work.
This caused me to request a new fcm device token.
and after using it for a while, it came back like the first time
Is this caused by the APN token being canceled?
or caused by enabling developer mode to develop apps.
Hello everyone
Our application started to spam the Firebase Push Notifications when the device had the iOS 17 Beta. This behavior does not happen in iOS 16, but it was reproduced in many iOS 17 Beta (Beta 3, 4 & 5).
The issue goes like this:
Our backend service uses an SDK Firebase to send one notification
The user receives the notification
Then after some minutes, the device starts to receive the same push notification with the old date-time, by intervals of 5 to 15 minutes
We also got reports of other people with the same issue:
https://stackoverflow.com/questions/76620368/spam-of-fcm-push-notifications-on-ios-17-beta
https://github.com/kreait/firebase-php/issues/814
You can see the following screenshot of the output of this after 2 hours:
I recently began work on an app that uses push notifications and the app already has a version in the store. I no longer have access to the original development and distribution certificates. I know I need to generate new certs. However, will the new certificates work with the existing APN key, or will I have to generate a new APN key as well? Any links or info will help. Thanks.
Clevertap issuing a notice that iOS push certificate has expired 1 day(s) ago. Upload a new one. But the original APNs are still going on and cannot download more than two. Also don't have any old certificates with me.
I had called "registerforremotenotifications", but "didRegisterForRemoteNotificationsWithDeviceToken" and "didFailToRegisterForRemoteNotificationsWithError" not been callback, so that I should not get DeviceToken. Credentials, Compile options and so on, I had check all of them.
what's the reason? Networking or APNs overload?and other?
Please help to check.
I am trying to write some code to send a push notification to a pass on an Apple device using C# .NET and HttpClient over HTTP2 with client certificate authentication.
When I run the code, I am seeing the below exception:
InnerException = {"Error 12152 calling WinHttpWriteData, 'The server returned an invalid or unrecognized response'."}
I am trying to find out why this code is failing?
Is it possible to debug/troubleshoot this in some way?
Running this code on Windows 10 OS Build version: 21H2 (19044). The application is built on .Net Framework 4.8 and tried using WinHttpHanlder versions 6 and also 7.
Also, tried using other third party open source libraries like PushSharp and DotApns. PushSharp does not seem to support Http/2 and dotApns does not support certificate authentication for .net framework. We have no plans to migrate to .net Core.
Below is my code:
private static string pushToken = "dbc56849<hidden>";
private static string AppleApnServer = "https://api.sandbox.push.apple.com";
public static async Task<PushResult> SendPushNotificationToWalletPass(string notificationContent)
{
byte[] certificateData = LoadCertificate();
X509Certificate2 certificate = new X509Certificate2(certificateData, String.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
string url = $"{AppleApnServer}:443/3/device/{pushToken}";
StringBuilder payload = new StringBuilder();
payload.Append("{ \"aps\" : ");
if (string.IsNullOrWhiteSpace(notificationContent))
{
payload.Append("\"\" }");
}
else
{
payload.Append(notificationContent);
payload.Append(" }"); // close aps dictionary
}
var handler = new Http2Handler();
handler.ClientCertificates.Add(certificate);
using (var httpClient = new HttpClient(handler))
{
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
var messageGuid = Guid.NewGuid().ToString();
request.Content = new StringContent(payload.ToString());
request.Headers.Add("apns-id", messageGuid);
request.Headers.Add("apns-push-type", "alert");
using (var response = await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead))
{
HttpStatusCode statusCode = response.StatusCode;
string reasonPhrase = response.ReasonPhrase;
bool success = response.IsSuccessStatusCode;
Console.WriteLine($"APN {(success ? "Delivered Successfully!" : $"Failed to Send! :: StatusCode [{statusCode}] Reason [{reasonPhrase}]")} :: PushToken [{pushToken}]");
if (!success)
{
switch (statusCode)
{
case HttpStatusCode.Gone:
// The device token is no longer active for the topic.
return PushResult.DeviceNotRegistered;
default:
return PushResult.Failure;
}
}
return PushResult.Success;
}
}
}
}
public enum PushResult
{
Success = 0,
Failure = 100,
DeviceNotRegistered = 200
}
// Apple APNS requires http2 but .Net Framework does not support http2 (only built in support in .net core)
// found this workaround https://stackoverflow.com/questions/32685151/how-to-make-the-net-httpclient-use-http-2-0/43101990#43101990
private class Http2Handler : WinHttpHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
request.Version = new Version("2.0");
return base.SendAsync(request, cancellationToken);
}
}
I'm developing a Flutter application that utilizes topic messaging to send notifications to iOS devices using Firebase Cloud Messaging (FCM). I've followed the FCM documentation to initialize the topic and set up an API for sending messages. The API is triggered every hour through a cron job on the server. When a topic message is received, the app displays a notification and performs some background processing. While the notification is successfully delivered when the app is in the background, I'm encountering inconsistent behavior when the app is in a killed state.
What I've Tried: I've double-checked the implementation of the FCM topic initialization and the message sending API, and everything appears to be correct. I've also verified that the cron job on the server is running as intended and the API calls are being made regularly. The issue seems to be related to how the app behaves when it's not running in the background.
Topic Initialisation:
if (!Platform.isAndroid) {
await FirebaseMessaging.instance.subscribeToTopic("ios-scheduling");
}
API for delivering topic message:
router.post('/', (req, res) => {
const topic = "ios-scheduling";
const body = req.body;
console.log("Request Body", req.body);
const message = {
notification: {
title: "OsuniO",
body: "You may have some pending tasks.",
},
data: {
"notificationType": body['notificationType']
},
apns: {
payload: {
aps: {
contentAvailable: true,
"interruption-level": "time-sensitive"
}
},
headers: {
"apns-push-type": "background",
"apns-priority": "5",
"apns-topic": "io.flutter.plugins.firebase.messaging"
}
},
topic: topic
};
console.log("message to be sent to the user: ", message);
admin.messaging().send(message)
.then((response) => {
// Response is a message ID string.
console.log('Successfully sent message:', response);
res.status(200).json(message);
})
.catch((error) => {
console.log('Error sending message:', error);
res.status(400).json({
message: error
}).end();
});
});
module.exports = router;
Expected Behavior: I expect that when a topic message is sent via FCM, regardless of whether the Flutter application is in the foreground, background, or killed state, the notification should be reliably displayed on the device. Additionally, the associated API should be triggered consistently to perform the required background processing.
I'm working on an iOS app and I'm trying to implement notification filtering using the com.apple.developer.usernotifications.filtering entitlement. I want my app to receive only specific remote notifications based on certain criteria. However, I'm having trouble getting this entitlement to work as expected. Can you provide a step-by-step guide on how to correctly use the com.apple.developer.usernotifications.filtering entitlement for notification filtering? What are the key points and considerations I should keep in mind?
Where should I add the com.apple.developer.usernotifications.filtering entitlement? Should it be added to the main app target or an app extension?
Could you provide an example of how the entitlement key-value pairs should be structured for filtering notifications? For instance, if I want to filter notifications with a specific title and subtitle, how should I format this in the entitlements file?
How can I ensure that my entitlements file is correctly referenced in my app's target settings? Are there any specific configurations I need to be aware of?
I appreciate your assistance in helping me understand how to effectively use the com.apple.developer.usernotifications.filtering entitlement for notification filtering in my iOS app. Thank you!
Regenerate
The (archived) Local and Remote Notifications Programming Guide contains the following:
To support a background update notification, make sure that the payload’s aps dictionary includes the content-available key with a value of 1. If there are user-visible updates that go along with the background update, you can set the alert, sound, or badge keys in the aps dictionary, as appropriate.
The current documentation however reads:
To send a background notification, create a remote notification with an aps dictionary that includes only the content-available key, as shown in the sample code below. You may include custom keys in the payload, but the aps dictionary must not contain any keys that would trigger user interactions.
What caused this change and why is no longer supported to send additional keys (e.g. an alert dictionary) in the aps dictionary of a background notification?
Hello,
i try to send a Web Push Notification to my Safari Webbrowser and use the "http2" Module from Node.js
Every other Browser is able to receive my messages. I got the message "BadJwtToken" but when i use the same Authorization Key with a HTTP/1.1 Request, i got a Message on Safari.
Is there a Problem with the API when i use the HTTP/2 Protocol? Has anybody the same Problem?
I send exactly the same Headers and as i said other Push APIs from Mozilla,Chrome and Microsoft e.t.c. are working with my HTTP2 Client.
I need to create identifier for my apple push notification system but i am not able to find add icon near identifier please help
Hi All
I have successfully created an Apple pass using PHP.
The pass is added to the Apple wallet successfully.
Now, I have to update the pass with a new value for one of the parameters in the pass. How do we update the value? Please refer to a sample PHP script for the same.
I have checked the below sites, Here, they Mentioned only the input and output, as per the document I received the push token,
What should I do after getting the push token?
https://developer.apple.com/library/archive/documentation/PassKit/Reference/PassKit_WebService/WebService.html
index.php
after running this file i am getting this error
bool(false) Curl failed with error: SSL read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0Response from apple -> Curl Error
index.php
After running this code I am getting error
bool(false) Curl failed with error: SSL read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0Response from apple -> Curl Error