Define Thumbnail in iOS Notifications - ios

if you are receiving a local or push notification on iOS 15, normally you see the app's icon on the left of the notification and have the ability to attach media that is shown as thumbnail on the right. See here:
However some notifications (communications apps?) show the profile picture of the person sending the message (eg. iMessage or Slack in the example).
I'm running a news app and would like to place the logo of the publisher there. Is it possible to manipulate the image on the left and if so, how?

Related

Is there a way for a local (not push) notification to show a web preview?

When my app is in the background can I trigger a local notification that includes a web preview? In other words along with the banner that normally appears, can I show a small window with safari content that I specify when I create the notification? Like the image I am attaching

How to set a custom icon to an IOS push notification?

I'm currently adding notifications to my Flutter app for IOS, I wanted to add something similar to a largeIcon on Android, so far I didn't find a way to do that, only adding an image which is not a solution since I only want an icon at the right even if the user expands the notification (the image will expand too in this case which is undesirable for my use case).
As an alternative, I was wondering if I could change the notification app icon. As far as I looked around, this is not possible either, but at the same time I saw this image of notifications (the first one and the last one) that have a custom image and the app icon is smaller.
How can I do this in my app? I couldn't find any way in the documentation on how to do it.
You can do this with communication notifications. From HIG:
The system automatically displays a large version of your app icon at
the leading edge of each notification; in a communication
notification, the system displays the sender’s contact image — or
avatar — badged with a small version of your icon.
Here is the documentation on how to implement communication notifications in your app.

Notification/Widget on lock screen with button in Swift

I have an app that contains stopwatch and when time is running and the app enters background I would like to have a notification on lock screen and in Notification Center (when you swipe down). The notification should contain actual time of the stopwatches and user should be able to stop/start the stopwatches.
I was trying to achieve this using UNNotificationContentExtension but as documentation says:
When an iOS device receives a notification containing an alert, the system displays the contents of the alert in two stages. Initially, it displays an abbreviated banner with the title, subtitle, and two to four lines of body text from the notification. If the user presses the abbreviated banner, iOS displays the full notification interface, including any notification-related actions. The system provides the interface for the abbreviated banner, but you can customize the full interface using a notification content app extension.
I found out that I am able to edit just full notification interface which means that when user gets notification and opens it I can show him whatever I want (I tried mediaPlayPauseButtonType to handle stopwatches). But when I check the lockscreen the notification stays default.
What are the possibilities to achieve Notification similar to Spotify - when you play song, you can pause the song and you can see the time etc. from the lockscreen?
Thanks!

Is there any way to change notification image

i want to show or change present image in notification with latest image icon, the image icon will be provided either in the notification data or saved previously in the app like this one and this one image
i want that if notification came on the IOS device then the image in the notification will show accordingly
this text from iOS Human Interface Guidelines
A banner is a small translucent view that appears onscreen and then disappears after a few seconds. Users can also see a version of the banner on the lock screen and in the Notifications view of Notification Center. In the banner, iOS displays your notification message and the small version of your app icon (to learn more about the small app icon, see App Icon). Users tap the banner to dismiss it and switch to the app that sent the notification.
I believe that you can't change it, but may be if you change some pictures in App icon source, you will achieve the necessary result, but I repeat, hardly everything will correctly work
for example
U can try to change Spotlight images or any else....

How to set push subject as the title for push notification?

Is there any possibilities of setting push subject as the title in push notification?
I'm getting app name as the subject and description is same as given in the push. I want to change the title of the push.
Is this possible in iOS? I hope it is possible in android.
I just tested this on an iPhone 6s running iOS 9.1, and here's what I found: If the title field is provided as part of the alert dictionary, the notification on the lock screen will still show the bundle name. However, when viewing the same notification in Notification Center (accessed by swiping down from the top edge), the title is used in place of the app/bundle name.
When no title field is provided as part of the alert dictionary, the bundle name is displayed in both the lock screen and the Notification Center.
As of 2015, Apple has started using a title attribute but only seems to use when displaying a notification on the Apple Watch.
The title string used in the short look provides a brief indication of
the intent of the notification. For local notifications, you specify
this string using the alertTitle property of the UILocalNotification
object. For remote notifications, add the title key to the alert
dictionary inside the payload
This might indicate that it will be used also on the iPhone later on.
Source: https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/BasicSupport.html
Here's an example JSON payload: https://gist.github.com/edwardmp/2295364f068b24084e67561c8e5c2944
Edit: As of iOS 9 this started working on iPhone and iPad as well :) I do note that this appears to only be displayed in the notification center and not on the lock screen.
You can't change the title. It's always the application name.
Suppose you are playing chess with your friend online. While you are in the chess app, your friend’s moves appear on the board right away. When you switch to another app—for example, to read email while your friend decides where to move—the app needs a way to notify you when your friend moves. This is a perfect use case for a push notification—something changed outside of the app that is of interest to the user.
The provider for the chess application learns about this move and, seeing that the chess application on your device is no longer connected, sends a push notification to Apple Push Notification service (APNs). Almost immediately, your device—or more precisely, the operating system on your device—receives the notification over the Wi-Fi or cellular connection from APNs. Because your chess application is not currently running, iOS displays an alert similar to Figure 1-1. The message consists of the application name, a short message, and (in this case) two buttons: Close and View. The button on the right is called the action button and its default title is “View”. An application can customize the title of the action button and can internationalize the button title and the message so that they are in the user’s preferred language.
You can refer your client to the official APNS docs to convince them that's the way it is.
Yes, you can add a title property since iOS 8.2.
A short string describing the purpose of the notification. Apple Watch displays this string as part of the notification interface. This string is displayed only briefly and should be crafted so that it can be understood quickly. This key was added in iOS 8.2.
Check the Apple Document - The Remote Notification Payload

Resources