Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Notifier broken?

i have:

var notifier = Titanium.Notification.createNotification()
notifier.setMessage('Foo')
notifier.show(false, false)

nothing shows up …

— asked July 23rd 2010 by Michael Stuhr
  • desktop
0 Comments

6 Answers

  • Do you mean to have an alert dialog?

    if so

    var alert = Titanium.UI.createAlertDialog({    
        buttonNames:['Ok'],
        title:"Oops!",
        message:'Message.'
    });
    alert.show();
    

    should work.

    — answered July 23rd 2010 by Abraham Vivas
    permalink
    0 Comments
  • no i meant "Titanium.Notification.createNotification()
    " as written above. but thanks.

    The API-Docs stink. why can't i comment there? it would be so much more helpful, if anyone could paste some example in there, which then could be reviewed for example. and please mark those things as broken who happen to be so.

    plus it would be very helpful if one of the Dev's could give some timeline for the desktop fork, and if there are any updates planned.

    — answered July 23rd 2010 by Michael Stuhr
    permalink
    0 Comments
  • try:

    var w = Titanium.UI.getMainWindow();
    var notice = Titanium.Notification.createNotification( w );
    notice.setTitle("YourTitle");
    notice.setMessage("YourMsg");
    notice.show();
    
    — answered July 26th 2010 by Chris Farmiloe
    permalink
    0 Comments
  • Hi, the notification system has really been bugging me for the last few hours.

    For some reason, this works:

        var w = Titanium.UI.getMainWindow();
        var notice = Titanium.Notification.createNotification( w );
        notice.setTitle("YourTitle");
        notice.setMessage("YourMsg");
        notice.show();
    

    but this, despite it being a more logical approach, does not work (may not be valid Javascript)

        var w = Titanium.UI.getMainWindow();
        var notify = Titanium.Notification.createNotification(w, function(){
            'title': 'Hello world',
            'message': 'Hello world',
            'timeout': 5
        });
        notify.show();    `
    

    The API, which still has not been updated, says that createNotification only has 1 argument, which is the window you want to attribute it to.

    However, there is another problem – some OS may not have Growl/Snarl or whatever software Appcelerator relies upon to deliver the notification. I was spending hours trying to figure out why notifications were not working, then it turns out you need Growl (Mac OSX) installed.

    So, because we cannot rely on the OS having the right software, it looks like a CSS3/JQuery Growl type plug-in is perhaps the best way to go to deliver notifications.

    To be honest, I'm really annoyed (as are many appcelerator developers) with the quality of API content, updates, and even basic tutorials/examples that you do not have to pay for.

    The only logical answer for desktop apps is to look at JRuby (which I do not want to touch), Python with wxPython, or BlitzMax or something equally similar. Bowline does not work, I've tried it; but it is not cross platform and only works on ruby 1.9.x; and its bloody hard to even get to work.

    I hope I can make the October 27th live webimnar as I'm sure someone is bound to ask them why their support is so damn awful.

    http://www.appcelerator.com/october-27-2010/

    — answered October 25th 2010 by zardon
    permalink
    0 Comments
  • The documentation is correct but inconsistent with the Mobile SDK. It seems like the better way to construct the notification object would be this

        var notify = Titanium.Notification.createNotification({
            window: w, 
            title: 'Hello world',
            message: 'Hello world',
            timeout: 5
        });
    

    However I do not see them changing it because apps already use the other behavior and would likely be broken by the change.

    I think conceptually what is being done by Appcelerator is good but the execution is sometimes lacking.

    Since this is an open source platform, it would be nice if the community could have an active role in documentation, samples, etc. A wiki with trusted community authors would be a nice touch and switching the documentation to a wiki as well would be good since it would allow annotations and additions of code samples and clarifications.

    It would also be a nice touch if the mobile and desktop SDK's started to move together. It is a peculiar move to have similar functionality between the two SDK's but difference in implementation of the API and apps that are created. It leads to a confusing mess in the QA because you can't just assume that a call in mobile is the same as desktop and vice versa. Ideally the two would be identical except where functionality just cannot exist or makes no sense and this is already done in the mobile SDK where they have added functionality for iOS and iPad that deviates from the rest of the SDK.

    A true forum that could be broken out by topics would be a nice touch as well. I often find myself jumping into the QA to answer a question only to discover it is on a subject where I am weak. It would be nice to know there were distinct categories so I can stay in my wheelhouse.

    Just my 2 cents.

    I am looking forward to the webcast on Wednesday and hope to see something good come from it.

    — answered October 25th 2010 by John McKnight
    permalink
    0 Comments
  • @John McKnight – I agree with your points. I was probably being overly frustrated with my progress with Appcelerator.

    Oh, if anyone from Appcelerator is reading – please can you change the design where the big box says 0 points 0 votes to the number of views and number of replies – the points/votes system is rarely used anyway; plus the visual design gives the wrong impression that there are no replies to a topic – even when they are.

    I've decided to wait for their webcast, and continue with Native Objective C. I'm hoping they address the desktop API issue and why it was never updated; but then again there's so many issues they need to address – and not just in desktop.

    — answered October 25th 2010 by zardon
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.