Windows Phone 8.1 Toast Notification not playing custom sound - push-notification

I am in dire need of your help.
I am a Windows app developer and I need my app to play an alarm sound when a toast notification is received. I have tried many different loadouts and everything works fine (Even applying silent='true' in the audio tag), except, ofcourse, for the custom sound.
I have tried my dev server and I have tried with a local toast sent from the app, and nothing seems to work.
My current XML loadout is as follows (I got it from an example in MSDN):
string audio = "ms-winsoundevent:Notification.Mail";
string toastXmlString = "<toast duration='long'>"
+ "<visual version='1'>"
+ "<binding template='ToastText02'>"
+ "<text id='1'>Sound:</text>"
+ "<text id='2'>" + audio + "</text>"
+ "</binding>"
+ "</visual>"
+ "<audio src='" + audio + "' />"
+ "</toast>";
The only sound I ever managed to play was the default windows sound. No 'ms-winsoundevent' sounds, no 'ms-appx' or 'ms-appdata' sounds, nothing.
I have checked the headers and XML loadout and compared them to the MSDN documentation.
I have tried different formats (mp3 and wav) and different audio clip lengths (18secs, 5secs, 10secs, etc...)
My experience tells me that if there was a problem with the XML loadout or the headers the toast would either not arrive or the text would not show. Other than the sound however, everything works fine.
Thanks in advance for all the help you may offer.

I don't know if you have already sorted out your problem, however the issue lies in the duration="long" attribute.
According to MSDN:
Note that neither looping audio nor long-duration toasts are not supported on Windows Phone 8.1.
so you have to use duration="short" in order to be able to play the custom sound.
It is a hidden NOTE in the sound tag documentation and is not states clearly and the worst part is the notification will be displayed properly, the silence attribute will be applied but the sound will not be played. Also sound files should be less than 10 seconds but short toast notification is displayed for 5-6 seconds only and the loop will not work as stated.
Hope this helps you :)

Related

HTTP Post: getting encrypted Paypal multiple-item cart upload button

I am having trouble using the BMCreateButton of the Button Manager API to get a multiple-item cart uploaded.
Inside the paypal documentation for the cart upload command, the paragraph on "securing your button" implies that it should be possible to get encrypted buttons for all the functions listed above, including the cart upload form. And in this SO thread, someone states they have solved this with PHP, but having looked it up, it's not evident they use a simple HTTP Post, as it's got to do with a PHP class's internal workings.
So far, I am able to only view one item only, and when trying to use the multiple-item syntax (item_name_1, item_name_2...) it's showing no items at all with a total of 0.00.
Here is my request code:
string requestContent =
"METHOD=BMCreateButton" +
"&VERSION=85.0" +
"&USER=<user>" +
"&PWD=<pwd>" +
"&SIGNATURE=<sig>" +
"&BUTTONCODE=ENCRYPTED" +
"&BUTTONTYPE=BUYNOW" +
"&BUTTONIMAGE=reg" +
"&BUTTONCOUNTRY=US" +
"&BUTTONSUBTYPE=PRODUCTS" +
//"&L_BUTTONVAR1=cmd%3D_cart" + //having this in here definitely causes an error message to display
"&L_BUTTONVAR1=button_subtype%3DPRODUCTS" +
"&L_BUTTONVAR2=business%3Dbiz%40biz.com" +
"&L_BUTTONVAR3=item_name_1%3DToaster" +
"&L_BUTTONVAR4=amount_1%3D45.00" +
"&L_BUTTONVAR5=quantity_1%3D1" +
"&L_BUTTONVAR6=upload%3D1";
It doesn't work -I have asked the PayPal tech support and will post back here if I hear anything back from them on this topic.
I encountered the same issue and as there was no progress, I contacted PayPal support. There is the answer:
There is quoted reply in case the link will die:
It's not only with ENCRYPTED. If you try CLEARTEXT, the same error is thrown.
Upload cart is a slightly different kind of button, that was never intended to be pre-built, and that's why this functionality doesn't exist in BMCreateButton. If you compare the Button Manager in the account and the API functionality - they have the same capabilities and, in both cases, the upload cart isn't there.
Looking at the documentation, you will also notice the BUTTONTYPE=CART refers to Add to cart.
It makes perfect sense to try to secure the upload cart code, but the best way will always be post-transaction consistency verification (with IPN).
So to sum this up, it is not possible to encrypt it, we can only detect tampering, e.g., with IPN.
In the reaction to my question, the PayPal moderator filed an issue to clarify this in the documentation.

Client doesn't have a name/class at startup

I'm trying to start an application (Spotify) on a particular tag. Rules aren't applied and now I'm inspecting the client class by printing the class in a notification in the "manage" signal. This results in an empty notification.
client.connect_signal("manage", function (c, startup)
naughty.notify({title=c.class})
end)
When I restart awesome, it does print the client class, so why isn't it working when the client is initially started?
Using xprop, it also prints the class:
WM_CLASS(STRING) = "spotify", "Spotify"
Sounds like a bug in Spotify (and I think I heard about this one before). I would guess that Spotify does not follow ICCCM and only sets its WM_CLASS property after it made its window visible and not before.
I fear that you cannot do much about this except for complaining to Spotify devs to fix their stuff.
You could work around this by starting a timer in the manage signal that checks if a window turns out to be spotify a short time later. Alternatively, you could do something like client.connect_signal("property::class", function(c) if c.class == "Spotify" then print("This is now a spotify window") end end) to react to change to a window's class (of course you'd want to do something more useful to Spotify's windows than printing them).
(Per the ICCCM, a window is not allowed to change its class while it is visible, but who cares about standards...)
I had a similar issue with the claws-mail client. Inspecting it via xprop, it shows
WM_CLASS(STRING) = "claws-mail", "Claws-mail"
but awesome just did’t apply the rules for it. The trick was giving awesome-wm both of these class names in the rules section by providing a set of characters to chose from:
rule = {class = "[Cc]laws%-mail"}
I hope this works for your spotify application, too.
For further reading about patterns in lua I suggest this:
https://www.lua.org/pil/20.2.html

ASP.Net page not updating - Literally the same screen from earlier (as if back was selected)

I have an ASP.Net application that accesses user data from a SQL database.
Visual Studio Version 2012
Windows Server 2012 Standard 6.2
Sql Server 2012
Program in Service since 11/2007 (with problem having never happened previously)
Problem:
First reported by 2 of my customers but I was not experiencing the problem until after a recent MS update.
Unsure of the particulars of those updates or whether it was only a coincident.
Log into application and go around to a few pages, all seems ok, than I select a new Active Company (auto filters list screens by Active Company ID from a session variable, changing active company changes the ID stored in the session variable), everything works fine for a while (1 - 4 mins) switching between screens and even different active companies, than at one point I go to a page that I've been to several times (that worked fine) and it shows everything from the last time I accessed it (literally the identical page from a few mins ago). I change to another page and it appears to be updated, go back to the screen that did not update and it no matter what, will not update again. I query the database and it is indicating the correct active company ID and query the session variable and that too is correct.
** The strange thing is I can wait 4 -5 mins (I just stop doing anything) and than try to access the page again and now it updates.
I have been beating at this now for almost 2 weeks and have not been able to determine to source of the problem.
I literally have tried every settings for session caching I could read up on with no (or minimal) affect.
Since our software utilizes session variables to hold user variables to control their environment (like active company selection), I went to go as far as removing the session variables and making the profile.variables (requiring Sql Session management) with minimal affect).
It seems to work fine for a few minutes (or page accesses) than once it stops updating the page, it will no longer update under any circumstance.
It will occur on pretty much any combination of page changes (after changing the active company, since it will actually change data displayed).
This design has been out in the field for over 8 years now (and is routinely brought up-to-date with the latest dot.net compiler updates, .net framework and IronSpeed Designer engine updates. This error has never occurred before now. No update to the development tools took place prior to the appearance of this issue.
I tried various tests.
Test 1:
I added java code to reset each page.
<script type="text/javascript">
function RefreshPage()
{
window.location.reload()
}
</script>
Result: No change
Test 2:
I stopped as soon as the page did not refresh and started timing when the page would update (1 -2 mins or going back and forth between the change active company and the reports screen several times)
Result:
After 60 - 90 secs, the current page seemed to do an update (the activity icon would appear than go away) so I would than check the page the was not refreshing and it was now correct.
Since I was using the report page for my tests, I would run a report when the screen update failed, to see what active company it thought it was on (since it was also reliant on the session variable, it was bringing up the correct report data, even though the page was not indicating the correct active company. Note: Every one of our screens indicate the current user and active company name at the top, so it is easy to see when it is not updating.
Any direction as to where to look from here would be greatly appreciated, I'm at a lost as to what to check now.
P.S. I installed MS Message Analyzer and had it monitor up to the point where I get a failure. I have never user MS MA before so I don't have much of an idea as to what to look for, other than the operation status was indicating Found (302) for the Get and Post and Ok (200) for the page I received the problem for.
Thanks in advanced!
John R
I propose to check caching options. I mean caching of page, controls, javascript, and browser. As workaround I propose to add some empty paramether to your page, ajax calls. For example instead opening "default.aspx" open "default.aspx?id=someNewGoid". Also consider adding some random paramethers to your ajax calls.
Try following coe for refresh:
<script type="text/javascript">
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function guid()
{
var guid = (S4() + S4() + "-" + S4() + "-4" + S4().substr(0,3) + "-" + S4() + "-" + S4() + S4() + S4()).toLowerCase();
return guid;
}
function RefreshPage()
{
var url = window.location;
if (url.indexOf("?")>-1){
url = url.substr(0,url.indexOf("?"));
}//this par will cut of additional paramthers
window.location = url + "?id=" + guid();
window.location.reload()
}
</script>

ARIA Live Regions and `role="alert"` not working on Mac

I am trying to get an error alert scenario working properly with assistive technology. There are two approaches i like which I am testing:
Using ARIA Live Regions
http://pauljadam.com/demos/aria-alert-validation.html
Using ARIA Alert
http://test.cita.illinois.edu/aria/alert/alert1.php
Both of this test pages work fine on Jaws 14 and VDA on PC in that the error is read outloud. However, using a Mac with voice over it does not read the errors in those examples out load.
To reproduce:
go to http://test.cita.illinois.edu/aria/alert/alert1.php
turn on voice over with command+f5
click the guess again button after typing some numbers (the alert should be read).
Is there some non-default setting I need to be away of? Or is there a better way to do this? I'm a little surprised all theses examples do not work.
Here is solution by Steve Faulkner from Paciello Group Blog that supports Safari on Mac:
function addError() {
var elem1 = document.getElementById("add1");
document.getElementById('add1').setAttribute("role", "alert");
document.getElementById('display2').style.clip = 'auto';
alertText = document.createTextNode("alert via createTextnode()");
elem1.appendChild(alertText);
elem1.style.display = 'none';
elem1.style.display = 'inline';
}
<div id="display2" role="alert"><span id="add1"></span></div>
<input type="submit" value="Method 4 alert - display" onClick="addError()">

Loading Song from file with Uri - XNA 4.0

I am attempting to load a song from Uri for use in my game. Code as below:
Uri uriStreaming = new Uri("file://E:/MySong.mp3");
Song song = Song.FromUri("Song Name", uriStreaming);
MediaPlayer.IsMuted = false;
MediaPlayer.Volume = 0.5f;
MediaPlayer.Play(song);
When I get in game no audio is playing at all, though I have no errors at all. I've also tried it with a http:/ link for an mp3 and it works fine, so I'm not quite sure of the issue.
Any ideas for a fix?
Edit: After further investigation of this problem, I've found out that it's the ID3 tags causing the issue, specifically if it is ID3v2.4 and if I use a tool to remove them, it plays fine. However, I can't expect my user to do this with all of their audio, so is there a workaround for this?

Resources