JamesBowen
19+ years progress programming and still learning.
I was exploring the possibility of using Windows' API of using Toast Notification and this is what I was able to create.
I've included some dirty code as a proof of concept.
The part the that is setting me back is when the use clicks on the notification, I'm not quite sure how the callback will work with the ABL. Currently, I have that will open a webpage.
I've included some dirty code as a proof of concept.
Code:
using Microsoft.Toolkit.Uwp.Notifications.*.
using System.*.
using System.DateTimeOffset.*.
block-level on error undo, throw.
/* ******************** Preprocessor Definitions ******************** */
DEFINE VARIABLE content AS CLASS ToastContentBuilder.
define variable uriAppLogo as class System.Uri no-undo.
define variable uriHeroLogo as class System.Uri no-undo.
/* *************************** Main Block *************************** */
content = NEW Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder().
//content:AddToastActivationInfo("action=viewConversation&conversationId=5", ToastActivationType:Foreground).
content:AddArgument("conversationId", 9813).
content:AddArgument("action", "viewConversation").
//content:SetBackgroundActivation().
//content:AddHeroImage(new System.Uri("https://www.progresstalk.com/progresstalk_forum.png"), "", true).
//content:AddInlineImage(new System.Uri("https://www.progresstalk.com/progresstalk_forum.png"), "", ?).
uriHeroLogo = new System.Uri("C:\Users\james\Downloads\progresstalk-logo.jpg").
uriAppLogo = new System.Uri("C:\Users\james\Downloads\2499.jpg").
content:AddHeroImage(new System.Uri(uriHeroLogo:AbsoluteUri), "", true).
content:AddAppLogoOverride(new System.Uri(uriAppLogo:AbsoluteUri), ToastGenericAppLogoCrop:Circle , "", ?).
//this-object:Leave:Subscribe( this-object:Form1_Leave).
content:SetBackgroundActivation().
//Open as web page
content:SetProtocolActivation(new System.Uri("https://www.progresstalk.com")).
//content:AddHeader("abc123","OpenEdge ABL Toast Notification","apply").
content:AddText("Hello, Progress Talk!",?,?,?,?,?,?).
content:AddText("Check this out! ABL Toast Notifications",?,?,?,?,?,?).
define variable deliveryTime as class System.DateTimeOffset no-undo.
// Delay Start
// deliveryTime = DateTimeOffset:Now:AddSeconds(10).
// content:Schedule(deliveryTime).
//Or show now.
content:Show().
The part the that is setting me back is when the use clicks on the notification, I'm not quite sure how the callback will work with the ABL. Currently, I have that will open a webpage.