triniwiz / nativescript-toasty Goto Github PK
View Code? Open in Web Editor NEW:bread: NativeScript toast plugin :bread:
License: Other
:bread: NativeScript toast plugin :bread:
License: Other
Hi Osei,
I’m suddenly getting an error trying to build my Nativescript iOS app version… until there it was building correctly and running both on iOS and android... I've updated NS to 6.5.0.
I’ve already retry removing node_modules, npm install and so on… but I’m still stucked at this point.
The described building issue seems to be linked to the Toast-Swift library used from your Nativescript-toasty library.
.../platforms/ios/Pods/Toast-Swift/Toast/Toast.swift:307:15: error: method 'makeToastActivity' with Objective-C selector 'makeToastActivity:' conflicts with previous declaration with the same Objective-C selector
@objc func makeToastActivity(_ point: CGPoint) {
^
.../platforms/ios/Pods/Toast-Swift/Toast/Toast.swift:279:16: note: 'makeToastActivity' previously declared here
@objc func makeToastActivity(_ position: ToastPosition) {
^
Command CompileSwift failed with a nonzero exit code
note: Using new build systemnote: Planning buildnote: Constructing build descriptionwarning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Toast-Swift" target. (in target 'Toast-Swift' from project 'Pods')warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Toast-Swift" target. (in target 'Toast-Swift' from project 'Pods')
** BUILD FAILED **
Do you have any idea how to solve this... ?
Thanks for any help
Lo.
Plugin is not working on IOS and throwing the following error:
ERROR ReferenceError: Can't find variable: ToastStyle
I did debug the issue and found out that there's a folder on the package called "typings" that is not installed with the package, which includes the file objc!Toast_Swift.d.ts
that has the declaration for ToastStyle
hi, I trying to change background color and text color. but when I change this colors, corner radius stopping to work in android:
const toast = new Toasty({
text: ` ${t('notification_password_minimum_length')} ${minimumLength}`,
});
toast.setBackgroundColor('#f00');
toast.setTextColor('#fff');
toast.show();
Following is log detail -
ERROR in node_modules/nativescript-toasty/index.d.ts(6,17): error TS2304: Cannot find name 'Color'.
node_modules/nativescript-toasty/index.d.ts(7,23): error TS2304: Cannot find name 'Color'.
node_modules/nativescript-toasty/index.d.ts(11,14): error TS2304: Cannot find name 'Color'.
node_modules/nativescript-toasty/index.d.ts(12,20): error TS2304: Cannot find name 'Color'.
node_modules/nativescript-toasty/index.d.ts(36,23): error TS2304: Cannot find name 'Color'.
node_modules/nativescript-toasty/index.d.ts(43,29): error TS2304: Cannot find name 'Color'.
This issue occurs for both 1.3.1 (last version) and 1.4.0 (latest version). I request you to please make stable version available for installation because there are many developers those using your plugin like me and they have to deliver their projects to their clients/customers.
In my case it is critical issue and it will take lot of time to replace Toasty by another plugin.
on android, i receive this toast was not made with Toast.makeText()
I am running lollipop on an LG G3
Great plugin, but could you please add compatibility for NativeScript 3?
Looks like NS 6 is writing the warning topmost() is deprecated. Use Frame.topmost() instead.
in the console.
Changing frameModule.topmost()
to frameModule.Frame.topmost()
should fix this.
Using the BOTTOM location, the toast rests right at the bottom of the page.
Suggest providing a DEFAULT location which does not call SetGravity() and lets the OS position the toast.
The plugin works well on Android but crashes on iOS with the following error:
2019-06-04 20:31:08.717413+0200 TextBlastapp[4744:29297] JavaScript stack trace:
2019-06-04 20:31:08.717517+0200 TextBlastapp[4744:29297] 1 setToastPosition@file:///app/vendor.js:8272:23
2 Toasty@file:///app/vendor.js:8213:26
3 preview@file:///app/bundle.js:272:71
4 preview@[native code]
5 notify@file:///app/vendor.js:26179:23
6 _emit@file:///app/vendor.js:26207:18
7 tap@file:///app/vendor.js:39114:18
8 UIApplicationMain@[native code]
9 _start@file:///app/vendor.js:22469:22
10 run@file:///app/vendor.js:22511:9
11 $start@file:///app/vendor.js:21528:18
12 @file:///app/bundle.js:2033:10
13 ./main.js@file:///app/bundle.js:2037:34
14 __webpack_require__@file:///app/runtime.js:751:34
15 checkDeferredModules@file:///app/runtime.js:44:42
16 webpackJsonpCallback@file:///app/runtime.js:31:39
17 anonymous@file:///app/bundle.js:2:61
18 evaluate@[native code]
19 moduleEvaluation@[native code]
20 promiseReactionJob@[native code]
21 require@[native code]
22 anonymous@file:///app/starter.js:3:8
23 evaluate@[native code]
24 moduleEvaluation@[native code]
25 promiseReactionJob@[native code]
2019-06-04 20:31:08.717728+0200 TextBlastapp[4744:29297] JavaScript error:
2019-06-04 20:31:08.717867+0200 TextBlastapp[4744:29297] file:///app/vendor.js:8272:23: JS ERROR ReferenceError: Can't find variable: CSToastManager
file:///app/vendor.js:8272:23: JS ERROR ReferenceError: Can't find variable: CSToastManager
(lldb)
I am using Nativescript 5.4.0 before updating it it worked good.
When positioned at the bottom, Toasts border the home indicator; when positioned at the top, they appear half behind the notch. This does not happen in the Toast sample app (v 3.1).
According to documentation, backgroundColor removes android native look 'n feel for toasts.
On Android this currently removes the default Toast rounded borders.
Setting backgroundColor value to double quotes "" during initialization allows the use of native android toast. However, setting value to null will make toast itself disappear.
This is rather confusing and one can't find the solution without a bit of testing.
Hi @triniwiz
Like you see on the other issue there is a new Frame.topmost()
instead of topmost()
.. I decided to create a separate issue because it concern the Frame concept .. I use on my applications the BottomNavigation
and each tabs has a frame .. for that the msg dose show up only on one tabs only because when you try to get frameModule.topmost()
here you will get the last frame was loaded .. and it will not change if you change the frame ! I do not why.
Platform: ios
Version: 5.2.0
I have been unable to get toasts to display under Android Q/10 on a Pixel 3.
Same code works fine on all iOS versions tested, and Android emulator API 28.
Is this a known issue and/or is there something different I need to do for Android Q?
To be clear, no errors returned, but no toast appears.
Hello @triniwiz , first of all - thank you for this and your other plugins.
Migrated here due to TobiasHennig/nativescript-toast#40, and now
i'm having trouble running nativescript-toasty
v2.0.1 on tns-ios 6.0.1:
CONSOLE ERROR file:///node_modules/@angular/core/fesm5/core.js:5847:0 ERROR Error: Uncaught (in promise): Error: There is no topmost
_getView@file:///node_modules/nativescript-toasty/toasty.js:168:0
show@file:///node_modules/nativescript-toasty/toasty.js:102:0
showToast@file:///src/app/services/notification.service.ts:80:14
file:///src/app/app.component.ts:109:38
onInvoke@file:///node_modules/@angular/core/fesm5/core.js:24349:0
file:///node_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:883:0
onInvokeTask@file:///node_modules/@angular/core/fesm5/core.js:24340:0
drainMicroTaskQueue@file:///node_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:595:0
file:///node_modules/nativescript-angular/platform-common.js:174:0
notify@file:///node_modules/tns-core-modules/data/observable/observable.js:110:0
[native code] [<root>]
notifyAppStarted@file:///node_modules/tns-core-modules/application/application.js:143:0
didFinishLaunchingWithOptions@file:///node_modules/tns-core-modules/application/application.js:135:0
[native code] [<root>]
onReceive@file:///node_modules/tns-core-modules/application/application.js:33:0
UIApplicationMain@[native code] [<root>]
_start@file:///node_modules/tns-core-modules/application/application.js:277:0
run@file:///node_modules/tns-core-modules/application/application.js:305:0
bootstrapNativeScriptApp@file:///node_modules/nativescript-angular/platform-common.js:205:0
b<…>
Displaying toast via this service method:
public showToast(message: string) {
new Toasty({text: message}).show();
}
Can you please suggest what is this 'topmost' and, maybe, how to fix that?
Toast allways show behind modal view when called.
Platform: ios
Version: 4.2.4
We tried:
#11
it did not fix problem. Toast still showing behind modal view
Is this compatible with NativeScript Vue?
tns-core-modules ~5.4.0
tns-ios: 6.0.0
I tried importing this in several ways, in my app.js, in an actual component, but every time I try to use it my app crashes with an error:
CONSOLE ERROR file:///app/vendor.js:23387:20: [Vue warn]: Error in mounted hook: "TypeError: undefined is not an object (evaluating 'frame$$1.id')"
found in
--->
This might be me trying to import it the wrong way. I am not using TypeScript. What is correct way to import and use this with NS Vue?
Hi,
I have a Page with Tabview
and on tab 1
I have a scroll view
.. when Toasty is showing .. it appear below the Tab View Buttons.
I try to provide playground with the structure but I have crash Please see here
Thanks
Is NativeScript 7 update coming anytime soon?
https://nativescript.org/blog/nativescript-7-for-plugin-authors/
Hi,
I've recently updated to the latest Nativescript version 6 and after that I started to get an error on iOS but everything is working fine on Android. I'm not sure if there is any relation between the update and the error but I started to get it after the update.
this is my package.json: https://gist.github.com/janossuta/f7c56a9667e8bd3a74e29ee59d8dc087
Here is the error:
CONSOLE ERROR file:///node_modules/@angular/core/fesm5/core.js:5847:0 ERROR Error: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'this._iOSOpts.displayShadow')
Toasty@file:///node_modules/nativescript-toasty/toasty.js:25:0
file:///src/core/views/borders/border-details.component.ts:198:35
onInvoke@file:///node_modules/@angular/core/fesm5/core.js:24337:0
run@file:///node_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:138:0
file:///node_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:883:0
onInvokeTask@file:///node_modules/@angular/core/fesm5/core.js:24328:0
runTask@file:///node_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:188:0
drainMicroTaskQueue@file:///node_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:595:0
promiseReactionJob@[native code]
UIApplicationMain@[native code]
_start@file:///node_modules/tns-core-modules/application/application.js:277:0
run@file:///node_modules/tns-core-modules/application/application.js:305:0
bootstrapNativeScriptApp@file:///node_modules/nativescript-angular/platform-common.js:205:0
bootstrapApp@file:///node_modules/nativescript-angular/platform-common.js:106:0
bootstrapModule@file:///node_modules/nativescript-angular/platform-common.js:90:0
file:///app/bundle.js:9371:144
./main.ts@file:///app/bundle.js:9376:34
__webpack_require__@file:///src/webpack/bootstrap:750:0
checkDeferredModules@file:///src/webpack/bootstrap:43:0
webpackJsonpCallback@file:///src/webpack/bootstrap:30:0
anonymous@file:///app/bundle.js:2:61<…>
and this how I try to use your plugin:
new Toasty({text: "Some message"}).setToastDuration(ToastDuration.LONG).show();
If do you need any other info regarding this issue please let me know.
I am getting the below error on iOS14.4 , Nativescript: 7.0.10.
It is working fine in android 11.
ERROR Error: onMeasure() did not set the measured dimension by calling setMeasuredDimension() Label(577)
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: onMeasure() did not set the measured dimension by calling setMeasuredDimension() Label(577)
at
ZoneAwareError(file: node_modules/@nativescript/zone-js/zone-nativescript.js:1298:0)
Can we reduce the duration of the alert ?
Currently even the short property of the duration stays longer on the screen.
Hi, my iOS app crashes each time the plugin is called, using {N} 5.1. Are you guys aware of this issue? Anything I can do about it?
I am using Nativescript 7.0+ with Vue and running a simple example like this:
import { Toasty } from 'nativescript-toasty';
let toast = new Toasty({ text: "demo text" });
toast.show();
doesn't work and throws:
TypeError: Cannot read property 'mainScreen' of undefined"
Here's my package.json, if it helps to identify the issue:
{
"name": "nsvue-practice",
"main": "main.js",
"version": "1.0.0",
"description": "A native application built with NativeScript-Vue",
"author": "Suhaib Khan",
"license": "MIT",
"dependencies": {
"@nativescript/core": "~7.0.12",
"@nativescript/firebase": "^11.0.0",
"@nativescript/geolocation": "^7.0.0",
"@vue/devtools": "^5.3.3",
"axios": "^0.21.0",
"color": "^3.1.3",
"decode-google-map-polyline": "^1.0.1",
"nativescript-google-maps-sdk": "^2.9.1",
"nativescript-permissions": "^1.3.11",
"nativescript-socketio": "^3.3.1",
"nativescript-toasty": "^3.0.0-alpha.2",
"nativescript-vue": "^2.8.1",
"nativescript-vue-devtools": "^1.4.0",
"node-geometry-library": "^1.2.3",
"vuex": "^3.5.1"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@nativescript/android": "7.0.0",
"@nativescript/ios": "6.5.3",
"@nativescript/webpack": "^3.0.4",
"babel-loader": "^8.1.0",
"nativescript-vue-template-compiler": "^2.8.1",
"nativescript-worker-loader": "~0.12.1",
"sass": "^1.26.10",
"vue-loader": "^15.9.3"
}
}
Hi, I'm trying this plugin on a school project but can't manage to change backgroundColor, textColor, Position, ...
Nativescript : 7.1.2
Language : Angular
Platform : Android 11
Here is the code I'm using :
const toast = new Toasty({ text: error, position: ToastPosition.TOP, backgroundColor: new Color('RED'), textColor: ('#FF0000') }); toast.show();
I can change the text but it doesn't care about the colors or any argument I set.
I have a project I’m working on and have come across a weird situation. My primary dev machine is iMac Pro and I use bitbucket to store the code. I also pull to my MacBook to code while relaxing... the problem is with nativescript-toasty. Everything works fine on the iMac but on the MacBook Pro it throws an exception TypeError: Cannot read property ‘setOnTouchListener’ of null... I’m guessing this is line 30 of toasty.android.ts I’m asking here because maybe this is a set up issue?
nativescript-toasty/src/toasty.ios.ts
Lines 218 to 224 in b462aa6
When using position = ToastPosition.TOP, the linked code appears to be inverting the value for the y offset.
This prevents adjustment of the toast view downward when using ToastPosition.TOP. (It only moves up off the top of the screen when adjusting the yOffset positive or negative.)
This code should be modified to allow the yAxisOffset to adjust the y position of the view up or down when using ToastPosition.TOP
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.