Popup Notification

Hi

I want to display a popup notification when an incoming call happens in MIP plugin with button to answer call.

What is the most adapted plugin sample to do this ?

Thanks for your answer

Let us suggest using the new feature introduced with 2020R1: Toast.

https://doc.developer.milestonesys.com/html/index.html?base=samples/sctoast.html&tree=tree_search.html?search=toast

I’m trying to display popup like SCToast sample but nothing appears !!

After having trying to understand what is happening in SCToast sample, I have added the following code in my Plugin :

                  TimeSpan span = TimeSpan.FromSeconds(30);

                  Assembly assembly = Assembly.GetExecutingAssembly();

                  string name = assembly.GetName().Name;       

                  Icon myIcon = new Icon(assembly.GetManifestResourceStream(name + ".Resources.IconGreen.ico"));

                  SmartClientTextToastData myToast = new SmartClientTextToastData(Guid.NewGuid(), span, Dismissed, Activated, Expired, myIcon, "Primary text", "Secondary text", "Counter text");

                  EnvironmentManager.Instance.PostMessage(new Message(MessageId.SmartClient.ToastShowCommand, myToast));

It seems that the message is well sent but I no Popup is displayed.

I have deployed the SCToast plugin in my server and the “Add Toast” function works well so I don’t understand why in my plugin it doesn’t work.

Thanks

Here the toast object before Post

Thanks

When I paste this part of code in the SCToast plugin, it works well, I see the notification so I think it is more an environment problem. Is there some restrictions ?

The Toast functionality is for the Smart Client environment only. If you try to use it elsewhere it will not work. Are you trying to use it in a Management Client Plugin?

No. I use it for Smart Client. I"m trying to display it from BackGroundPlugin when I receive an incoming call from my server. So…

For simplest test I pasted your code into the Hotspot plugin sample. When I tried to put your code into a backgroundplugin in Smart Client I got:

Is this what you see?

--

Recommended

https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins

I hope this is the hint you need, otherwise let me know..

No. I have no exception and no errors. The message is sent but noting appears ..

You have this exception because you need to incorporate your icon. See screenshot sent.

Of course, seems to me I should have realized immediately. I will find time and get back to my experiment and let you know what I observe.

If you want something advanced you are able to create a window (WPF or WinForms). Toasts is easy to implement but not very flexible or advanced.

But if I want to display Notification from the bottom of the screen with a WPF Form, which Panel can I use ?

Thanks

You can do a WPF form but that will display outside the Smart Client, there is no way for such a form to disply inside the Smart Client in a pane or similar.

Ok but this WPF form, how can I display it ? I need to incorporate the form somewhere in my project so how can i launch it ?

The possibilities are endless:

Make a side panel with a button that launch it.

Launch it when something happens by subscribing to the messages in the Smart Client.

You said originally that you have a incoming call..

I think we are transgressing from how to display something to something else.

Try to elaborate on what your Smart Client plugin should do, I have a feeling I need to know the basics of what you intend to do otherwise my advises will not fit the use case scenario you have.

In fact I want to get in the Smart Client :

A MAp with all IpDoorStation displayed on the map.

When someone push the button of the IpDoorStation, I want that the icon of the IpDoorStation change ( this feature is working) and I want that a notification popup appears from the bottom of the screen (like Toast sample or like Access COntrol plugin see screenshot provided). In this popup, I will provide a button to answer to the call.

Is it more clear ?

Thanks

posted a file.

The code for the change of icon is executing in the Event Server, this is a problem, it does not execute in the Smart Client where it could simply launch a new window. Furthermore the Event Server background code does not know the identity of the Smart Client that pushed the button. It would be possible to implement code in the Event Server that would communicate with a Smart Client plugin when this happens but unfortunately it would then communicate to all Smart Clients as it does not know the origin of the push of the button.