I have a calendar application which has the ability to set pill reminders.
ScheduledToastNotification recurringToast = new ScheduledToastNotification(
toastXml,startDay.AddDays(1), new TimeSpan(0, 0, 1, 0), 3);
As you can see it has MaxSnoozeCount = 3 and SnoozeInterval = 1 minute. The problem is that when I click the appearing toast as the documentation states the toast should be shown again because it hasn't been "snoozed". Yet it appears exactly 4 times regardless of the fact that I click it each single time.
Any ideas what is wrong? Thanks.
Upon clicking on the scheduled toast, your app should handle the toast activation event and remove the scheduled toast to prevent it from being seen again. A scheduled toast will continue to be shown based on its creation parameters until an application explicitly removes it from the schedule.
Use ToastNotifier.GetScheduledToastNotifications to retrieve the toast of interest, and then call ToastNotifier.RemoveFromSchedule to stop it from being displayed in the future.
Related
I'm trying to build rich, interactive Slack messages. Example: message with date picker, set of checkboxes and a long text. Upon submit (if modal) or push of an action button, I'd like to receive the current state of all interactive components.
I have tried regular messages with both input and action blocks...also tried modals. I get a message from Slack for every individual change to an interactive object, but not the state of all objects at once. Since the receiver of the interaction payload is stateless, this makes it impossible for me to properly react to the message.
Am I missing something? Appreciate every bit of advice.
OK, error seems to be on my side. I was just looking at the action payload preview in the Slack Block Kit Builder. When actually posting a message I see the state of all elements in the response.
I have a Home Page, it shows the status of the information of the company. But some days, there is some delay of information, due to errors in the PL's or in the server. Today I created a new region in the Home Page that shows a disclaimer/text/warning that there is a delay of 5 hours(I will delete this item at the end of the day or the 5 hours of delay). But I want to know if it's possible, that this message (I created another page with a text area item) written by my coworkers, can appear with a button from the other page and then hide the original region in the Home Page.
I'm using Oracle APEX 5.1
Thanks in advance.
So your ask is: Can I control what is shown/hidden in my Home Page from another page? Sure you can! You can try using APEX's Application Settings.
Then just:
Create an application setting (e.g. SHOW_MESSAGE)
Create buttons and a process attached to it calling the SET_VALUE procedure setting SHOW_MESSAGE to Y or N
-- from the Documentation example
begin
APEX_APP_SETTING.SET_VALUE(
p_name => 'SHOW_MESSAGE',
p_value => 'Y' );
end;
On your home page, just add a Server-Side Condition to the region checking if the GET_VALUE equals to Y
Apex does not support push notifications to push messages from the server, but you can use a workaround.
Create a region on the home page that displays the message
Create a dynamic action on page load to hide the message region if the message text is null
Create an an application process return 'Y' if there is a text message to show and 'N' when there is no message. The processing point of this process should be "Ajax Callback...". There are quite a bit of examples on the web on how to use application processes in ajax callback.
On your home page, create a javascript function (in section "Function and Global Variable Declaration") that invokes the application process and shows/hides the message regions based on the result.
On your home page, execute a javascript timer function (in section "Execute when Page Loads") to check every xx milliseconds for updates.
Notes:
As you can see this is quite a bit of relatively advanced work. You might consider showing the message at page rendering time instead.
Don't set the number of milliseconds too low. For every user on this page, a request to the database will be fired every xx milliseconds which can lead to a lot of traffic. For a case like yours, I'd set that to every 2 or even 5 minutes.
This is just one implementation, there are other options (using events, dynamic actions, etc) but it all boils down to the same technique: process on client running at interval.
How can I use server side events(sse) in vue? I'm receiving sse from backend and I need to implement that when I receive first event, I will show ringing panel on screen. Then I can accept that call and then show different panel and when I click on hang up I will show again screen like before events. It will be a call centrum.
I created method for receieving and handling event.
setupStream(){
let evtSource = new EventSource('/hzs/events.sse')
evtSource.addEventListener('call_status', event => {
let data = JSON.parse(event.data)
this.channels.push(data);
}, false)
}
Now, when I call I get something like this:
Where first curly brackets are incoming call, second are after I pick up phone and last are after I hang up.
How can I use this in app and show for example green ringing bar on screen based on events? So for every event I need different UI components.
Do I need to use vuex?
Thanks
I've a test case where after creation of an item, notification is shown, but that notification disappear s within 2-3 seconds.
I want to identify the element for that notification, but when I try to inspect element for that in firebug, it's HTML snippet disappears very quickly since notification itself disappears. Hence I couldn't identify element for it and finding it very difficult to automate.
Can anyone suggest how to deal with such situation?
Since you say "I've a test case", I'm thinking you are testing an application of yours. The plainest way to get around your problem is to know your application. Even if a third-party library is providing the notification code, you can read the doc to see if you can increase the delay or you can read the source code to figure out how it creates the element and where.
If the above fails, then if you can get together a sequence of operations in Selenium that triggers a notification, you should be able to get a serialization of body quickly enough that you can then examine at your leisure. Using Selenium for Python, it would go:
print driver.execute_script("return document.body.outerHTML;")
I would run the code above with redirection to save the output of the print statement to a file that I'd then examine at my leisure. You could make it narrower if you wish by getting the outerHTML of a descendant of body. I like to have a good bit of context so that I know where exactly the element is being created. I've used libraries and configurations that create such notifications as children of body, and some that put them as children of other elements.
Open the previous page before the notification
Press "Ctrl+Shift+c", Navigate to "sources" tab
Do the manual step to generate the notification, which is going to hide in few seconds
Press "F8". Page load scripts will be paused
Then inspect the element as usual and fetch the xpath at your convenience
You can use the below JAVA code to wait for 20 seconds till any element with text 'your notification' appears in the page:
try{
WebDriverWait wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(text(),'Your notification here')]")));
}catch(Throwable e){
System.err.println("Error while waiting for the notification to appear: "+ e.getMessage());
}
Toast is not displayed when completing the quest.
For example, as shown below toast
http://cloud.addictivetips.com/wp-content/uploads/2013/07/Google-Play-Games-In-Game-Toast-2.png
Google Play Games does not automatically display a toast for a completed Quest like it does with an Achievement. Instead, you should register a Quest listener that implements onQuestCompleted() in your Activity as described on this page.
This is because a Quest is something that your app can choose to customize, specifically through the reward data you associate with the quest. You should handle the quest completion event and give the user the appropriate award. If you'd like to also display a Toast, you can do that with a normal Toast.makeText(...) call in the callback or even an AlertDialog styled by your application.