-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touch callback never triggers #88
Comments
Same problem here. |
Me too |
Please add some useful info. Android device/ version at the very least |
Sorry Eddy, For me, the touch callback triggers only in Android 5.1. Does not work in Android 4.4, 5.0 and 6.0 (sorry for my bad english) |
Same here, The versions is the same as @lantonello. my callback:
Problem is: the result parameter is return a "OK" string, then we can't capture the result.event when the user touch the screen. |
Let me try to make time for this tomorrow. |
Before digging into this deeper I really need to confirm something with you. I've installed function tap() {
window.plugins.toast.showWithOptions(
{
message: "hey there",
duration: 1500, // ms
position: "bottom",
addPixelsY: -40, // (optional) added a negative value to move it up a bit (default 0)
data: {'foo':'bar'} // (optional) pass in a JSON object here (it will be sent back in the success callback below)
},
// implement the success callback
function(result) {
if (result && result.event) {
console.log("The toast was tapped or got hidden, see the value of result.event");
console.log("Event: " + result.event); // "touch" when the toast was touched by the user or "hide" when the toast geot hidden
console.log("Message: " + result.message); // will be equal to the message you passed in
console.log("data.foo: " + result.data.foo); // .. retrieve passed in data here
if (result.event === 'hide') {
console.log("The toast has been shown");
}
}
}
);
} On my KitKat (4.4) device this gives me this (expected) output in the console when tapping the toast:
What's different in your setups that you don't see this? |
In my case, I´m using in an Ionic 1 project.
and the log always shows an "OK" string. |
@frcol Which plugin version are you using and do you have the same problem if you remove ngCordova from the equation? So replacing |
I'm experiencing the same problem on a Samsung Galaxy S6 running Android 5.1.1, as well as an S7 Edge on 6.0.1. However I'm not experiencing this on a Galaxy Avant running 4.4.2 or a Nexus 6P on 7.0. Coincidentally, these are the same devices that have an issue with #95 |
I don't have a S6 or S7 so can't help here.. |
I have an S4 with 5.0.1 and tapping the toast does nothing =( |
I have the same problem, the touch event is not coming out for s7 edge. So i tinkered in the I commented this entire line:
Replaced it with this:
Now, I can receive the touch event. |
Another observation: #93 (comment) |
I am having a similar issue where on some android (8 and 9) phones, the result from the callback after touching the toast has event set to "hide" instead of "touch", though seems to work properly on iOS |
Same issue here on multiple Android devices. The touch event is correctly received in a Pixel_2_API_R emulator but that's not the case for some physical devices (eg. Galaxy S9). This issue is blocking my release to production 😿 |
( Same issue as #80 ) |
shogunfighter's suggestion above did the trick for me 👍 PS. but introduced the same issue on other devices 😩 Trying to use both handlers for > lollipop + a workaround on the JS side.. |
Expected behaviour
the trigger event listed below should trigger.
Actual behaviour
The success is always called upon initializing the toast, and result returns a value of "ok". result.event is never populated. The trigger event works if I set it to occur when the result value is "ok", so whatever I'm doing wrong is specific to the code below. Any help or suggestions?
I'm seeing this behaviour on
Remove this hint: these checkboxes can be checked like this: [x]
Code Sample
Acts.prototype.ShowToast = function (st_message,st_duration,st_location,st_offset,st_opacity,st_backcolor,st_textcolor,st_textsize,st_cornerradius,st_hpadding,st_vpadding)
{if(st_location === 0){st_location = "top";}
else if(st_location === 1){st_location = "center";}
else{st_location = "bottom";}
window["plugins"]["toast"]["showWithOptions"]({
"message": st_message,
"duration": st_duration,
"position": st_location,
"addPixelsY": st_offset,
"data": {"foo":"bar"},
"styling": {
"opacity": st_opacity, // 0.0 %28transparent) to 1.0 (opaque). Default 0.8
"backgroundColor": st_backcolor, // make sure you use #RRGGBB. Default #333333
"textColor": st_textcolor, // Ditto. Default #FFFFFF
"textSize": st_textsize, // Default is approx. 13.
"cornerRadius": st_cornerradius, // minimum is 0 (square). iOS default 20, Android default 100
"horizontalPadding": st_hpadding, // iOS default 16, Android default 50
"verticalPadding": st_vpadding // iOS default 12, Android default 30
);
};
The text was updated successfully, but these errors were encountered: