Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

OS X Desktop Notifications
Started by tomprice Mar 16 2017 07:08 AM

6 replies to this topic

Best Answer ojnab , 16 March 2017 - 01:30 PM

This is probably not what you need, but you can fire local notifications on MacOS via applescript like this:

local function showNotification( title, subtitle, message, sound )
    
    local sound = sound or "Alert"
    local script = [[osascript -e "display notification \"]] .. message .. [[\" with title \"]] ..title.. [[\" subtitle \"]] .. subtitle .. [[\" sound name \"]] .. sound .. [[\"" ]]
    
    os.execute(script)
end

timer.performWithDelay( 3000, function()
    showNotification("Notification Title", "Some subtitle", "Here is a notification message...")
end )

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tomprice

[GLOBAL: userInfoPane.html]
tomprice
  • Observer

  • 28 posts
  • Corona SDK

Forgive me - I'm starting a new topic for this in case Rob/Perry didn't see the updates to the old one...

 

We're looking at using Corona SDK for our business app and our only stumbling block is the lack of OS X desktop notifications... but that's a big deal.  We need to be able to show badge notifications on a Mac dock icon as Skype and Slack do.

 

Rob previously suggested that we could ask a plugin developer to make this happen, which we'd be happy to do, but talking with Scott Harrison it seems that there would still need to be a change to the Corona core for this to happen.

 

Is that a possibility?

 

Tom



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 21,117 posts
  • Corona Staff

Like Perry likes to say "It's software. Anything is possible". But the reality is we have a lot of things to work on. This isn't an easy item to add and our team is busy with things that are in higher demand.

 

This starts with a feature request posted at http://feedback.coronalabs.com and get some votes on it. 

 

Rob



[TOPIC: post.html]
#3

tomprice

[GLOBAL: userInfoPane.html]
tomprice
  • Observer

  • 28 posts
  • Corona SDK

OK, that's what I wanted to get a sense of.  We'd be happy to pay a plugin developer to implement something, but it's correct to say that they couldn't do this until you'd made a change in the core?

 

Tom



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 21,117 posts
  • Corona Staff

That's based on Scott's assessment. But until I have a feature request, I can't get engineering to look at it.

 

Rob



[TOPIC: post.html]
#5

tomprice

[GLOBAL: userInfoPane.html]
tomprice
  • Observer

  • 28 posts
  • Corona SDK

Right - will raise that.  Many thanks Rob



[TOPIC: post.html]
#6

ojnab

[GLOBAL: userInfoPane.html]
ojnab
  • Contributor

  • 466 posts
  • Enterprise

  Best Answer

This is probably not what you need, but you can fire local notifications on MacOS via applescript like this:

local function showNotification( title, subtitle, message, sound )
    
    local sound = sound or "Alert"
    local script = [[osascript -e "display notification \"]] .. message .. [[\" with title \"]] ..title.. [[\" subtitle \"]] .. subtitle .. [[\" sound name \"]] .. sound .. [[\"" ]]
    
    os.execute(script)
end

timer.performWithDelay( 3000, function()
    showNotification("Notification Title", "Some subtitle", "Here is a notification message...")
end )

  • Perry Clarke likes this

[TOPIC: post.html]
#7

tomprice

[GLOBAL: userInfoPane.html]
tomprice
  • Observer

  • 28 posts
  • Corona SDK

Thanks very much ojnab




[topic_controls]
[/topic_controls]