This plugin provides a common API for android and iOS to show toast notifications in your NativeScript applications.
tns plugin add nativescript-toasts
var nstoasts = require("nativescript-toasts");
var options = {
text: "Hello World",
duration : nstoasts.DURATION.SHORT,
position : nstoasts.POSITION.TOP //optional
}
nstoasts.show(options);
The plugin uses a pod created by Charles Scalesse to display toasts on iOS
import * as Toast from 'nativescript-toasts';
let toastOptions:Toast.ToastOptions = {
text: "Hello World",
duration: Toast.DURATION.SHORT,
position: Toast.POSITION.TOP //optional property
};
Toast.show(toastOptions);