Closed sannidhyaroy closed 10 months ago
I don't remember the codebase, so I may be wrong, but it seems you should use dataPacket.downloadTask
, not dataPacket.payload
. You can check the ShareService for example how to use it.
@sannidhyaroy @giedrius-stanevicius https://github.com/sannidhyaroy/Soduto/pull/18 I have raised this PR with some logic added towards getting the notification icon from the app show up.
@sannidhyaroy I think you can close this since we have figured out how to get the PNG icon from the payload
@sannidhyaroy I think you can close this since we have figured out how to get the PNG icon from the payload
Sure, thank you for the help.
KDE Connect sends the app icon in PNG format as a payload along with the notification data packet. How can I get the image in Soduto? I tried adding a
getAppIcon()
method inside theDataPacket
extension in theNotificationsService.swift
file:However, when I access this method from the
showNotification()
function by defininglet appIcon = try dataPacket.getAppIcon()
, nothing happens. It returnsnil
for the lineguard let payloadStream = payload else { return nil }
in thegetAppIcon()
method.@giedrius-stanevicius Where am I going wrong? I agree I'm not very good with Swift and I didn't work with
InputStream
or similar data types in any other language either. Obviously the function above isn't entirely written by me, thanks to StackOverflow. Could you guide me a bit? I've been trying to get this to work for a couple of months but can't figure it out.