Toast Notifications Plugin

9 views
Skip to first unread message

PTiRouZ

unread,
Oct 26, 2011, 11:08:39 AM10/26/11
to seesmic-d...@googlegroups.com
Hi,
How do I make my plugin appear in this window (Option / Notifications) ?

image.png

And where is the best place for show a toast notifications ? 
Actually i done this in my ITimelineItemsProvider just after the SynchronizationHelper.Post(OnItemAdded,...

Thanks.
image.png

iuliub

unread,
Oct 27, 2011, 10:51:04 AM10/27/11
to Seesmic Desktop Platform Development
Hi there,
There are two major steps that will ensure that your plugin will
display particular notification settings:
1. Get a reference of the
Seesmic.Sdp.Extensibility.INotificationService;2. Register an instance
of your own implementation of the abstract class
Seesmic.Sdp.Extensibility.NotificationProvider.
At first step, one only needs to add the following code to the main
plugin class (for example, I would have "MyPlugin" which extends
abstract Seesmic.Sdp.Extensibility.Plugin):
<BEGIN code example>
using System.ComponentModel.Composition;using
Seesmic.Sdp.Extensibility;
[[Export(typeof(Plugin))]]public class MyPlugin:Plugin {
private static INotificationService _NotificationService;public static
INotificationService NotificationService         {            get    
        {                return _NotificationService;            }   
    }
 [Import] public INotificationService NotificationServiceImport      
  {            set             {                _NotificationService =
value;            }        }}
<END code example>
Note the System.ComponentModel.Composition.ImportAttribute above the
NotificationServiceImport public member.It will ensure that SD2 core
application will push a reference of the INotificationService into
your plugin member, at start-up.
At step two, registering your own implementation of the abstract
NotificationProvider may be done in two different ways:
a) should you need to display notification settings for each timeline
of your Seesmic.Sdp.Extensibility.Session implementation, one may only
need to call the superclass protected AddNotificationProvider method
and pass it a reference to an instance of your own
NotificationProvider subclass. This triggers under-the-hood
registration to the INotificationService that is specific to
Session. Settings checkboxes for each registered provider, will thus
appear under your session section in the Notifications tab.
b) one may also register a NotificationProvider , by directly calling
NotificationService.RegisterNotificationProvider; this however can
only be used for the following entities:Userlists, Searches and
Extras.Setting checkboxes for each registered provider, will thus
appear under each of the above listed sections.

Hope this helps.

Best regards,
Iuliu Burtoiu
SDP Team, Seesmic

iuliub

unread,
Oct 27, 2011, 11:06:27 AM10/27/11
to Seesmic Desktop Platform Development
Notification windows (or "toast" notifications) can only be displayed
in the lower right corner of the screen, similar to the ones that
Outlook uses to notify users about incoming e-mails. (On the Macintosh
however, notification windows appear at the top of the screen rather
than the bottom.)
This is a limitation of the Silverlight runtime. See official
documentation here:
http://msdn.microsoft.com/en-us/library/system.windows.notificationwindow(v=vs.95).aspx

With your SD2 plugin however, make sure you'll use the public methods
from Seesmic.Sdp.Extensibility.INotificationService:

.ShowToastNotification(ToastNotificationInfo
notificationInfo);
.ShowBarNotification(BarNotificationInfo notificationInfo);
.ShowDialogNotification(DialogNotificationInfo
notificationInfo);

For how to use SDP framework notifications, one may also read the
following article here:
http://devwiki.seesmic.com/w/page/25808480/SDP%20Notifications

Best regards,
Iuliu Burtoiu,
SDP Team, Seesmic
>  image.png
> 42KViewDownload

PTiRouZ

unread,
Nov 2, 2011, 12:36:34 PM11/2/11
to seesmic-d...@googlegroups.com
Thank for you help, but i am faced with a problem.
I developed my plugin using a unique ISession and not session, so I do not have access to AddNotificationProvider (for timeline)
:-(


2011/10/27 iuliub <iul...@gmail.com>

iuliub

unread,
Nov 4, 2011, 11:38:54 AM11/4/11
to Seesmic Desktop Platform Development
Hi there,

ISession has become deprecated in favour of the abstract class
Seesmic.Sdp.Extensibility.Session.
Have you tried to extent it and override the Start() and Stop()
methods (instead of just implement them)?

Regards,
Iuliu Burtoiu,
SDP Team, Seesmic

PTiRouZ

unread,
Nov 15, 2011, 6:04:44 AM11/15/11
to seesmic-d...@googlegroups.com
Thank you for your help, my plugin works fine with Notification now.

2011/11/4 iuliub <iul...@gmail.com>
Reply all
Reply to author
Forward
0 new messages