@@ -780,7 +780,8 @@ angular.module('ngCordova.plugins', [
780780 'ngCordova.plugins.push' ,
781781 'ngCordova.plugins.spinnerDialog' ,
782782 'ngCordova.plugins.pinDialog' ,
783- 'ngCordova.plugins.localNotification'
783+ 'ngCordova.plugins.localNotification' ,
784+ 'ngCordova.plugins.toast'
784785] ) ;
785786
786787angular . module ( 'ngCordova.plugins.network' , [ ] )
@@ -1086,6 +1087,85 @@ angular.module('ngCordova.plugins.statusbar', [])
10861087 }
10871088} ] ) ;
10881089
1090+ angular . module ( 'ngCordova.plugins.toast' , [ ] )
1091+
1092+ . factory ( '$cordovaToast' , [ '$q' , function ( $q ) {
1093+
1094+ return {
1095+ showShortTop : function ( message ) {
1096+ var q = $q . defer ( ) ;
1097+ window . plugins . toast . showShortTop ( message , function ( response ) {
1098+ q . resolve ( response ) ;
1099+ } , function ( error ) {
1100+ q . reject ( error )
1101+ } )
1102+ return q . promise ;
1103+ } ,
1104+
1105+ showShortCenter : function ( message ) {
1106+ var q = $q . defer ( ) ;
1107+ window . plugins . toast . showShortCenter ( message , function ( response ) {
1108+ q . resolve ( response ) ;
1109+ } , function ( error ) {
1110+ q . reject ( error )
1111+ } )
1112+ return q . promise ;
1113+ } ,
1114+
1115+ showShortBottom : function ( message ) {
1116+ var q = $q . defer ( ) ;
1117+ window . plugins . toast . showShortBottom ( message , function ( response ) {
1118+ q . resolve ( response ) ;
1119+ } , function ( error ) {
1120+ q . reject ( error )
1121+ } )
1122+ return q . promise ;
1123+ } ,
1124+
1125+ showLongTop : function ( message ) {
1126+ var q = $q . defer ( ) ;
1127+ window . plugins . toast . showLongTop ( message , function ( response ) {
1128+ q . resolve ( response ) ;
1129+ } , function ( error ) {
1130+ q . reject ( error )
1131+ } )
1132+ return q . promise ;
1133+ } ,
1134+
1135+ showLongCenter : function ( message ) {
1136+ var q = $q . defer ( ) ;
1137+ window . plugins . toast . showLongCenter ( message , function ( response ) {
1138+ q . resolve ( response ) ;
1139+ } , function ( error ) {
1140+ q . reject ( error )
1141+ } )
1142+ return q . promise ;
1143+ } ,
1144+
1145+ showLongBottom : function ( message ) {
1146+ var q = $q . defer ( ) ;
1147+ window . plugins . toast . showLongBottom ( message , function ( response ) {
1148+ q . resolve ( response ) ;
1149+ } , function ( error ) {
1150+ q . reject ( error )
1151+ } )
1152+ return q . promise ;
1153+ } ,
1154+
1155+
1156+ show : function ( message , duration , position ) {
1157+ var q = $q . defer ( ) ;
1158+ window . plugins . toast . show ( message , duration , position , function ( response ) {
1159+ q . resolve ( response ) ;
1160+ } , function ( error ) {
1161+ q . reject ( error )
1162+ } )
1163+ return q . promise ;
1164+ }
1165+ }
1166+
1167+ }
1168+ ] ) ;
10891169angular . module ( 'ngCordova.plugins.vibration' , [ ] )
10901170
10911171. factory ( '$cordovaVibration' , [ function ( ) {
0 commit comments