Page 1 of 2

How to add a custom logo to the notifications command?

Posted: Thu Feb 17, 2022 7:05 pm
by liveCode
I am currently working on this guide:
https://lessons.livecode.com/m/4069/l/5 ... ifications
And I wonder how I can add a custom logo to the post
After all, when the message is displayed, then the logo has the LIVECODE logo
If I do not understand enough I can attach a screenshot
Thank you

Re: How to add a custom logo to the notifications command?

Posted: Fri Feb 18, 2022 1:07 pm
by simon.schvartzman
Hi, in iOS the OS takes care of it, meaning it uses the same Icon as the one used by the APP in the home screen.

In Android you have to setup the Status Bar Icon in the stand alone settings.

Hope it helps.

Best

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 1:47 pm
by liveCode
I have set an icon in the settings of Android and it still does not work

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 1:53 pm
by Klaus
Hi livecode,

please don't write in Hebrew, this is an english speaking forum!


Best

Klaus

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 2:54 pm
by richmond62
How do you know that is Hebrew?

It could be Yiddish, Ladino or Fars; all of which use that writing system. :D

Sorry, aberrant moment . . . LOL.

Google Trashlate gave me this:

"I have set an icon in the settings of Android and it still does not work"

Is a PNG image OK for an Android icon?
Screen Shot 2022-02-23 at 3.58.37 PM.png
Screen Shot 2022-02-23 at 3.58.37 PM.png (9.64 KiB) Viewed 7508 times

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 7:42 pm
by liveCode
So replace the image with a JPG type?

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 8:07 pm
by jacque
The dialog icons need to be specified in script. See "gRevSmallAppIcon" and "gRevAppIcon" in the dictionary.

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 9:07 pm
by richmond62
So replace the image with a JPG type?
אני לא יודע

How about doing a spot of reading about Android and what it requires?

Re: How to add a custom logo to the notifications command?

Posted: Wed Feb 23, 2022 10:01 pm
by Klaus
You can and should use a PNG file for an Android icon.
I am currently working on this guide:
https://lessons.livecode.com/m/4069/l/5 ... ifications
And I wonder how I can add a custom logo to the post
Do you mean the ANSWER dialog on Android as shown in the lesson?
If yes, then dialog does not show any icon on Android! 8)
After all, when the message is displayed, then the logo has the LIVECODE logo
This is in the IDE, right? Only here we can see an icon in the ANSWER dialog and only here we can
add a custom idon as Jaques already described.

Is that what you mean?

Re: How to add a custom logo to the notifications command?

Posted: Thu Feb 24, 2022 12:07 am
by jacque
Klaus wrote:
Wed Feb 23, 2022 10:01 pm
If yes, then dialog does not show any icon on Android! 8)
So true, and the one that does show is ugly too. I forgot we were talking about Android when I answered. On Android it's more common to use a toast, since answer dialogs aren't native to Android. There is a built-in "mobileToast" command in LC.

Re: How to add a custom logo to the notifications command?

Posted: Thu Feb 24, 2022 8:47 am
by richmond62
toast
Wow: learning something every day.

Who on earth invented that wonky bit of terminology?
-
SShot 2022-02-24 at 9.47.57.png
-
And, perhaps more to the point, is it possible to see what that looks like on a desktop machine?

Re: How to add a custom logo to the notifications command?

Posted: Thu Feb 24, 2022 11:56 am
by simon.schvartzman
If I'm getting it right, in my humble opinion what is missing is to point to the desired icon in the Status Bar Icon field which is empty in the screen shoot.

Icons have been defined for the APP and the Splash but not for the Status Bar Icon which I guess is what the original post is asking for.

Maybe I'm completely wrong but...

Re: How to add a custom logo to the notifications command?

Posted: Thu Feb 24, 2022 6:29 pm
by jacque
richmond62 wrote:
Thu Feb 24, 2022 8:47 am
Who on earth invented that wonky bit of terminology?
The Android team, so-called because it pops up from the bottom of the screen like bread in an old toaster. It then lingers for a while and sinks back down again.
And, perhaps more to the point, is it possible to see what that looks like on a desktop machine?
No, because it's native to Android and LC uses an OS call to present it. But you could see it in an emulator I assume. If you like installing gigabytes of Android Studio you can have as many emulators as you like.

Edit: newer versions of Android don't pop up from the bottom, they appear higher up on the screen. But the name stuck.

Edit edit: a group of related icons that appear at the bottom and slide down when you're done using them (think photo editing options) is called a "snackbar".

Re: How to add a custom logo to the notifications command?

Posted: Fri Feb 25, 2022 5:33 pm
by jacque
Well, it certainly helps to look at the lesson the OP referred to, which I should have done earlier. He doesn't want an answer dialog, he's using the notification system. Simon is correct, for those you need to include a status bar image. I've done this before and it works.

Re: How to add a custom logo to the notifications command?

Posted: Sat Feb 26, 2022 6:22 pm
by liveCode
How do I use mobiletoast?
This is the code I tried

Code: Select all

mobileToast "hello", "long"