Adobe AIR Growl Notifications

2 views
Skip to first unread message

CoreyDotCom

unread,
Sep 7, 2007, 11:20:19 AM9/7/07
to Growl Discuss
Hi,

Can somebody suggest the best means of dispatching a Growl
notification (and registration) from an Adobe AIR app?

I am assuming possible incorrectly that the only means I have is via a
TCP socket - in which case the user would have to manually enable
remote connections (via prefs) and set password on both ends, etc. A
tad tedious for the end user.

That said, if my assumptions are correct, is there any other mechanism
that could be enabled in a future build given the limitations of AIR?

Regards,

Corey L.

Evan Schoenberg

unread,
Sep 7, 2007, 1:49:56 PM9/7/07
to growld...@googlegroups.com, CoreyDotCom, Growl Discuss
Quoting CoreyDotCom <corey....@gmail.com>:

> Can somebody suggest the best means of dispatching a Growl
> notification (and registration) from an Adobe AIR app?

What is AIR, what is/are its platform(s), what is its programming
language, what are its plugin capabilities, and what are its
limitations?

-Evan

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

CoreyDotCom

unread,
Sep 7, 2007, 3:32:46 PM9/7/07
to Growl Discuss
Description:
http://labs.adobe.com/technologies/air/

Example apps:
http://labs.adobe.com/showcase/air/

Essentially Adobe AIR (Apollo) is a desktop runtime allow folks to
create cross platform desktop apps with Webkit + Flash. The apps are
essentially running in a desktop sandbox, tied down to a common set of
APIs (no direct access to system calls and system apis). Developers
can access the file system, save files, manage windows, open local and
remote TCP sockets, etc... but no ability to execute tasks, or invoke
things like Applescript. Locked down to abstraction layer only.

-Corey

Chris Forsythe

unread,
Sep 7, 2007, 3:32:51 PM9/7/07
to growld...@googlegroups.com, CoreyDotCom
Evan Schoenberg wrote:

>Quoting CoreyDotCom <corey....@gmail.com>:
>
>
>
>>Can somebody suggest the best means of dispatching a Growl
>>notification (and registration) from an Adobe AIR app?
>>
>>
>
>What is AIR, what is/are its platform(s), what is its programming
>language, what are its plugin capabilities, and what are its
>limitations?
>
>

It's a cross platform runtime:

http://labs.adobe.com/technologies/air/

Apparently it's pretty fancy, lightroom was written in it if I remember
right.

Chris

Chris Forsythe

unread,
Sep 7, 2007, 3:36:13 PM9/7/07
to growld...@googlegroups.com
CoreyDotCom wrote:

>I am assuming possible incorrectly that the only means I have is via a
>TCP socket - in which case the user would have to manually enable
>remote connections (via prefs) and set password on both ends, etc. A
>tad tedious for the end user.
>
>

Will this help you?

http://growl.info/documentation/developer/protocol.php

svn co http://src.growl.info/growl/trunk/Bindings/network/
growl-network-bindings

Chris

CoreyDotCom

unread,
Sep 7, 2007, 3:39:57 PM9/7/07
to Growl Discuss
I don't think so, per my comment. I don't want the user to have to go
in their settings and check the option to allow remote connections.
Agree would be a hassle for the user?

-C

Chris Forsythe

unread,
Sep 7, 2007, 3:44:08 PM9/7/07
to growld...@googlegroups.com
I do not agree, we don't want network storms crapflooding users.

Chris

CoreyDotCom

unread,
Sep 7, 2007, 3:47:33 PM9/7/07
to Growl Discuss
Huh? Thought thats what I said ;o) -- I don't want to use this
mechanism of interfacing with Growl - for just that reason - so was
looking for other possibilities.

Chris Forsythe

unread,
Sep 7, 2007, 3:52:20 PM9/7/07
to growld...@googlegroups.com
My email with the links was to help you find out if your assumption
about utilizing TCP was in fact correct (it was not), that was all. I
then also linked to a Bindings folder, but if you look one folder up on
the svn url there are plenty of examples of non-network bindings.

If you can interface to cocoa, that'd be easier, but since, based on
what you said, I don't think that'll work, I don't know what to tell you
to try.

I do not agree that going into network prefs is a hassle for the end
user, which is why I said what I did about networking. Since I believe
you may end up coming back to networking as the only way to do this, I
wanted to address that up front.

Chris

Corey Lucier

unread,
Sep 7, 2007, 4:00:20 PM9/7/07
to growld...@googlegroups.com
Thanks for the insight.  My assertion though was correct (given the fact that AIR does not support UDP sockets - leaving me with TCP).  And alas, no NSDistributedNotificationCenter. 

Being a UI guy only - curious...  Would there be a way for Growl to somehow support only local (same machine) connections to a TCP socket? Without need for user to enable remote connections?  Or by creating a socket/port listener there really is no "localhost" only mode?

-C

Chris Forsythe

unread,
Sep 7, 2007, 4:02:40 PM9/7/07
to growld...@googlegroups.com
What I've wanted for a while is for us to have Growl listen on both TCP
and UDP, in order to avoid issues just like this. Then adding a host
should be as simple as inputting a host/ip and then letting it try one
and then failing back to the other.

You are welcome to help us work on 1.2 or later to get TCP support in,
if that'll help you with AIR bindings.

Chris

Corey Lucier wrote:

> Thanks for the insight. My assertion though was correct (given the
> fact that AIR does not support UDP sockets - leaving me with TCP).
> And alas, no NSDistributedNotificationCenter.
>
> Being a UI guy only - curious... Would there be a way for Growl to
> somehow support only local (same machine) connections to a TCP socket?
> Without need for user to enable remote connections? Or by creating a
> socket/port listener there really is no "localhost" only mode?
>
> -C
>
>

> On 9/7/07, *Chris Forsythe* <ch...@growl.info

CoreyDotCom

unread,
Sep 7, 2007, 4:18:49 PM9/7/07
to Growl Discuss

Cool,

Guess I meant something like this.

What if Growl was always listening to a particular TCP port - and *by
default* would allow connections if and only if, the connection was
made locally. Otherwise it would require (as it does today), the user
to enable remote connections manually in the preferences.

I don't speak Cocoa but, in cookbook terms:

SOCKET s = accept(wParam,NULL, NULL);
//PRINT("FD_ACCEPT on response server (%d)\n", s);
if(s)
{
// ignore requests not from localhost
struct sockaddr name;
int namelen = sizeof(name);
if(0 == getpeername(s, &name, &namelen))
{
char hostName[NI_MAXHOST];
char servInfo[NI_MAXSERV];

if (0 == getnameinfo((SOCKADDR *)&name,
sizeof(name), hostName, NI_MAXHOST, servInfo, NI_MAXSERV,
NI_NUMERICSERV))
{
if("localhost" == string(hostName) ||
string(hostName) == string(gethostbyname("")->h_name))
{
CComPtr<Response> response(new
CComObject<Response>);
response->SetSocket(s);
mResponses.push_back(response);
return 0;
}
}
}
}
closesocket(s);

Chris Forsythe

unread,
Sep 7, 2007, 4:21:45 PM9/7/07
to growld...@googlegroups.com
Maybe, we'll have to discuss it after we get 1.1 out.

One of the devs pointed out to me via im that perhaps Adobe could add
Growl support into AIR. Think that's worth investigating?

Chris

Corey Lucier

unread,
Sep 7, 2007, 4:23:34 PM9/7/07
to growld...@googlegroups.com

>> One of the devs pointed out to me via im that perhaps Adobe could add
Growl support into AIR. Think that's worth investigating?

I proposed it in their pre-release forum - no dice. 
Reply all
Reply to author
Forward
0 new messages