Coder Social home page Coder Social logo

Comments (14)

442623641 avatar 442623641 commented on June 20, 2024 1

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.

DGGohil avatar DGGohil commented on June 20, 2024

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.

zhzhch335 avatar zhzhch335 commented on June 20, 2024

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.

DGGohil avatar DGGohil commented on June 20, 2024

I do have Honor V10 and i didn/t tried with .subscribe() , mine worked by doing above method.

from toast-phonegap-plugin.

NorthFred avatar NorthFred commented on June 20, 2024

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.

Jeijie avatar Jeijie commented on June 20, 2024

@NorthFred It no works in Honor 8X,Android 8.1.0

from toast-phonegap-plugin.

Jeijie avatar Jeijie commented on June 20, 2024

@DGGohil I had tried with .subscribe() , but it no worked by doing above method.

from toast-phonegap-plugin.

DGGohil avatar DGGohil commented on June 20, 2024

@DGGohil I had tried with .subscribe() , but it no worked by doing above method.

PM me your index.html.

from toast-phonegap-plugin.

Jeijie avatar Jeijie commented on June 20, 2024

@DGGohil

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.

aoilti avatar aoilti commented on June 20, 2024

I also encountered this problem, and my device is Xiaomi 8, Android 8.1

from toast-phonegap-plugin.

Jeijie avatar Jeijie commented on June 20, 2024

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.

aoilti avatar aoilti commented on June 20, 2024

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
image

from toast-phonegap-plugin.

Jeijie avatar Jeijie commented on June 20, 2024

@Zhang1051127659

Yeah!, same issue I encountered , you need remove it manually and install again.
image

from toast-phonegap-plugin.

EddyVerbruggen avatar EddyVerbruggen commented on June 20, 2024

Published 2.7.1 which removes the problematic code entirely.

from toast-phonegap-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.