Comments (14)
it work for me:
Toast.java, find
private static final boolean IS_AT_LEAST_PIE = Build.VERSION.SDK_INT >= 28;
replace with
private static final boolean IS_AT_LEAST_PIE = Build.VERSION.SDK_INT >= 26;
from toast-phonegap-plugin.
Remove this line from your index.html file meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;"> and add below one..
...
meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;style-src * 'unsafe-inline' 'self' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;img-src * data: 'unsafe-inline' 'self' content:;media-src mediastream;">
from toast-phonegap-plugin.
Try subscribe it with empty even:
this.toast.showShortCenter("再次点击返回键退出").subscribe();
In my project it works.
BTW my device is Honor V10.
I don't know its reason....
from toast-phonegap-plugin.
I do have Honor V10 and i didn/t tried with .subscribe() , mine worked by doing above method.
from toast-phonegap-plugin.
It seems that the toast notifications do not show on Android 8+ when using the latest versions of the plugin.
I removed the latest plugin from my project and went back to 2.5.2, and the toasts are working on at least Android 8.0 (e.g. Huawei P Smart) and Android 8.1 (Honor 7S).
ionic cordova plugin rm cordova-plugin-x-toast
ionic cordova plugin add [email protected]
from toast-phonegap-plugin.
@NorthFred It no works in Honor 8X,Android 8.1.0
from toast-phonegap-plugin.
@DGGohil I had tried with .subscribe() , but it no worked by doing above method.
from toast-phonegap-plugin.
@DGGohil I had tried with .subscribe() , but it no worked by doing above method.
PM me your index.html.
from toast-phonegap-plugin.
Whether or not there is a sentence above. It doesn't work.
meta charset="utf-8"
meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover"
meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;style-src * 'unsafe-inline' 'self' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;img-src * data: 'unsafe-inline' 'self' content:;media-src mediastream;"
from toast-phonegap-plugin.
I also encountered this problem, and my device is Xiaomi 8, Android 8.1
from toast-phonegap-plugin.
I also integrated cordova-plugin-toastyplugin to my project, it works for me.
if (window.cordova&&window.plugins.toastyPlugin) {
window.plugins.toastyPlugin.show(message, 1000, function () {
console.log('totoastyPluginast success');
}, function () {
});
}else if (window.cordova&&window.plugins.toast) {
window.plugins.toast.showShortCenter(message, function (res) {
console.log('toast success');
}, function () { });
} else {
alert(message);
}
from toast-phonegap-plugin.
I also integrated cordova-plugin-toastyplugin to my project, it works for me.
if (window.cordova&&window.plugins.toastyPlugin) {
window.plugins.toastyPlugin.show(message, 1000, function () {
console.log('totoastyPluginast success');
}, function () {
});
}else if (window.cordova&&window.plugins.toast) {
window.plugins.toast.showShortCenter(message, function (res) {
console.log('toast success');
}, function () { });
} else {
alert(message);
}
Are you talking about ToastyPlugin? I installed it, but I saw that the source code inside it is not very reliable, actually there is alert
from toast-phonegap-plugin.
@Zhang1051127659
Yeah!, same issue I encountered , you need remove it manually and install again.
from toast-phonegap-plugin.
Published 2.7.1 which removes the problematic code entirely.
from toast-phonegap-plugin.
Related Issues (20)
- duration does not seem to accept values on "show" and "showWithOptions"methods (Android 8.0) HOT 17
- Android P doesnt display toast HOT 2
- Toast is not showing in Android 9.0.0 (OnePlus 5) HOT 5
- Toast deprecation error on iOS 12.1.2 HOT 1
- why does the message have my app name before it pops up and how to remove it?
- What are advantages over web popover?
- iOS - Toast is displayed full width, no margins on left or right
- How can I increase the width and height of the toast?
- Android 9.0 Toast are not showing 2nd time HOT 1
- How is it possible to read Toast text?
- styling verticalPadding is not working properly in Android OS version 10 HOT 1
- Test0123
- null pointer exceptions in android 11 HOT 13
- window.plugins.toast.showWithOptions is not working
- Position of notification in Android 11 HOT 1
- Crash from API 30 HOT 7
- On Toast Click not working
- `showShortTop()` method is showing toast at the bottom only not at the top
- No color or styling For Android 12 and 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toast-phonegap-plugin.