Sistema Fenix Posted October 19, 2016 Posted October 19, 2016 Hi Follows a tip for using the notification by the browser. Add push_notification.js in folder files Add in the uniServerModule->CustomFiles To dispare notification: procedure FenixNotification(pTitle, pMessage:String); var vJS: String; begin vjs := format('jQuery(document).ready(function($){$.notify("%s",{title: "%s", icon: "http:\\dominio.com\yourimage.png"});});',[pMessage,pTitle]); UniSession.AddJS(vjs); end; procedure TFMenu.ButtonNotrClick(Sender: TObject); begin FenixNotification('Fenix','Your session is expiring.'; end; Best regards push_notification.zip 1 3 Quote
Harry Rogers Posted October 19, 2016 Posted October 19, 2016 Thanks for that Fenix - it works a treat. Quote
Harry Rogers Posted October 20, 2016 Posted October 20, 2016 How would you go about adding an audio notification to this? Cheers Quote
Sistema Fenix Posted October 20, 2016 Author Posted October 20, 2016 Hi HarryG, I found nothing about audio. You can use another command before calling the notification. Look at this example: https://github.com/admsev/jquery-play-sound https://jsfiddle.net/admsev/xscxya0g/ Quote
sparkz Posted September 8, 2017 Posted September 8, 2017 Fenix, this looks like a really useful bit of code. I'm new to the java side and am struggling to get this to work - I get "$.notify is not a function" errors. I suspect because I haven't setup things correctly. Have you got a sample project with this or some other bit of JS so I can learn from it. Thanks Quote
sparkz Posted September 9, 2017 Posted September 9, 2017 The .js file is included in the server CustomFiles: files/push_notification.js I'm calling the following on a button click in the client main form: procedure PushNotification(sTitle, sMessage: String); var sJS: String; begin sJS := Format('jQuery(document).ready(function($){$.notify("%s",{title: "%s", icon: ""});});', [sMessage, sTitle]); UniSession.AddJS(sJS); end; But I get the following error: I can put the JS code into the script directly and it works fine but I can't get the interaction between calling the "notify" function and the library .js file to work. I assume it's not finding the library? It seems to be one of those aspects not well documented, I'd really appreciate if someone could tell me what I may be missing... JSTest.zip Quote
acms Posted December 14, 2017 Posted December 14, 2017 Same problem to me : "$.notify is not a function" Fenix, this looks like a really useful bit of code. I'm new to the java side and am struggling to get this to work - I get "$.notify is not a function" errors. I suspect because I haven't setup things correctly. Have you got a sample project with this or some other bit of JS so I can learn from it. Thanks Quote
leons Posted December 14, 2017 Posted December 14, 2017 Hi Fenix, Works on my local machine for Chrome, IE and Edge with the program as stand-alone server. On IIS/ISAPI on the server as dll, only Edge is working. Any idea? Leon Quote
edujgomes5 Posted July 12, 2023 Posted July 12, 2023 On 10/19/2016 at 8:47 AM, Sistema Fenix said: Hi Follows a tip for using the notification by the browser. Add push_notification.js in folder files Add in the uniServerModule->CustomFiles To dispare notification: procedure FenixNotification(pTitle, pMessage:String); var vJS: String; begin vjs := format('jQuery(document).ready(function($){$.notify("%s",{title: "%s", icon: "http:\\dominio.com\yourimage.png"});});',[pMessage,pTitle]); UniSession.AddJS(vjs); end; procedure TFMenu.ButtonNotrClick(Sender: TObject); begin FenixNotification('Fenix','Your session is expiring.'; end; Best regards push_notification.zipUnavailable Alguém ainda tem esse arquivo (push_notification.zip) para disponibilizar? Gostaria de implementar no meu projeto. Quote
Sherzod Posted July 12, 2023 Posted July 12, 2023 24 minutes ago, edujgomes5 said: Alguém ainda tem esse arquivo (push_notification.zip) para disponibilizar? Gostaria de implementar no meu projeto. Which edition and build of uniGUI are you using? Quote
edujgomes5 Posted July 12, 2023 Posted July 12, 2023 6 minutes ago, Sherzod said: Qual edição e compilação do uniGUI você está usando? Uso esta: 1.90.0.1555 Quote
edujgomes5 Posted July 12, 2023 Posted July 12, 2023 3 minutes ago, Sherzod said: Trial? Não, versão completa. Quote
Sherzod Posted July 12, 2023 Posted July 12, 2023 Just now, edujgomes5 said: Não, versão completa. Then please adjust your forum email address first: Quote
edujgomes5 Posted July 12, 2023 Posted July 12, 2023 2 hours ago, Sherzod said: Em seguida, ajuste primeiro o endereço de e-mail do seu fórum: Estava com a cabeça cheia, respondi errado, uso uma versão trial, ainda estamos estudando a possibilidade de comprar a versão completa. desculpe-me por isso. Quote
Sherzod Posted July 13, 2023 Posted July 13, 2023 5 hours ago, edujgomes5 said: Uso esta: 1.90.0.1555 And are you using this trial version? Quote
edujgomes5 Posted July 13, 2023 Posted July 13, 2023 13 hours ago, Sherzod said: E você está usando esta versão de teste? sim Quote
Sherzod Posted July 13, 2023 Posted July 13, 2023 16 minutes ago, edujgomes5 said: sim I'm sorry, but this doesn't seem to be true. You are using a pirated version then... Quote
chefdackel Posted July 14, 2023 Posted July 14, 2023 @edujgomes5and please.... tranlating in english is so easy today. So we can all be part of the conversation. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.