Description
While [~htbryant] was closing TIMOB-19946 he was told that when attempting to use the below code it should print out a warning on Windows 10 Mobile and Windows Phone 8.1, informing the user that alertDialoghide() is unsupported on those platforms.
var a = Ti.UI.createAlertDialog({title: 'Alert', message: 'This will hide in 3 seconds'});
a.show();
// hide alert after 3 seconds
setTimeout(function () {
a.hide();
}, 3000);
// show alert after another 3 seconds
setTimeout(function () {
a.show();
}, 6000);
Upon further investigation from other APIs that should throw a warning it appears that these warnings do not reach the the console output of the user. Example 2 should log [HTTPClient::send: Data found during a GET request. Method will be changed to POST.](
https://github.com/appcelerator/titanium_mobile_windows/blob/5_3_X/Source/Network/src/HTTPClient.cpp#L121), but although the method of the request is successfully changed to POST the logging never occurs
var url = "http://requestb.in/15s5i021";
var client = Ti.Network.createHTTPClient({
// function called when the response data is available
onload : function(e) {
Ti.API.info("Received text: " + this.responseText);
alert('success');
},
// function called when an error occurs, including a timeout
onerror : function(e) {
Ti.API.debug(e.error);
alert('error');
},
timeout : 5000 // in milliseconds
});
// Prepare the connection.
client.open("GET", url);
// Send the request.
client.send({
"Hello": "World"
});
Steps to reproduce
1. Using example 1 build to a Windows 10 Mobile device or emulator
2. Using example 2 build to any Windows target
Actual result
No warning logs are printed in either case
Expected result
1.
AlertDialog::hide() is not supported on Windows Phone
or
AlertDialog::hide() is not supported on Windows 10 Mobile
should be logged depending on the os
2.
HTTPClient::send: Data found during a GET request. Method will be changed to POST.
should be logged
[~kota] Can you take a look at this? Looks like some of the logging macro usage should be converted to actually call Ti.API.log instead so it actually gets out to the console for the user to see.
Yes, so
TITANIUM_LOG_WARN
has been used only for debugging purpose from Visual Studio and we have not been quite aware of logging in Titanium CLI. I guess replacing entireTITANIUM_LOG_WARN
toTITANIUM_MODULE_LOG_WARN
would not fit in this case...we'll need to "choose" what to show manually.https://github.com/appcelerator/titanium_mobile_windows/pull/648 https://github.com/appcelerator/titanium_mobile_windows/pull/649
Verified as fixed, Example case 1: receive the log message
AlertDialog::hide() is not supported on Windows 10 Mobile
Example case 2: receive the log messageHTTPClient::send: Data found during a GET request. Method will be changed to POST.
Tested on: Windows 10 Pro Windows Phone 10.0 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201604290815 Ti SDK: 5.3.0.v20160429125919 Appc NPM: 4.2.5-3 Appc Core: 5.3.0-40 Node: v4.4.2 *Closing Ticket.*