Hi,
Can you show us JS code from the ipadscreen1.js file lines 360-370 ?
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi,
Can you show us JS code from the ipadscreen1.js file lines 360-370 ?
Hi Igor,
Given below is the code you have asked for :
code
$(document).off("click", '#ipadscreen1_mobilecontainer2 [name="mobilebutton_80"]').on({
click: function() {
if (!$(this).attr('disabled')) { // Get HTML string
var page = document.body.innerHTML;
Code: Select all
// Pass the HTML
window.plugin.printer.print(page);
}
},
}, '#ipadscreen1_mobilecontainer2 [name="mobilebutton_80"]');
/code
Hi Asif,
Where did you tested your app? Is it .apk or other way?
You can test plugins only when compile app in .apk and install it into device.
http://prntscr.com/3c86s7/direct
In your screenshoot, we can see an error of window.plugin. - there is no object.
So, that means only two things: whether you tested it not as the native app (with installed plugin) or you didn't install plugin correctly.
Please add this following code on the "page show" event to understand whether a plugin was successfully integrated:
precode
alert("window.plugin = " + window.plugin);
alert("window.plugin.printer" + window.plugin.printer);/code/pre
Regards.
Hi lllya,
I am testing the app using .apk file only on the device.
For first alert, i am getting "window.plugin = undefined"
and for second alert, i m getting "Uncaught TypeError: Cannot read property 'printer' of undefined "
Hi Asif.
precode
"window.plugin = undefined"/code/pre
It means: plugin did't inited correctly.
Please share your app with us.
Regards.
Hi lllya,
I have shared my app with 'a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a'. Name of the app is 'POS'
Hi,
In Printer.java change row
packet de.appplant.cordova.plugin.printer;
on
packet com.phonegap.plugins.printer;
And rename folder "de.appplant.cordova.plugin.printer" on "com.phonegap.plugins.printer" (folder contains www/printer.js)
In file cordova_plugins.js change rows that include plugin on next rows
{
"file": "plugins\com.phonegap.plugins.printer\www\printer.js",
"id": "com.phonegap.plugins.Printer",
"clobbers": [
"Printer"
]
}
And try create event on any button click with such code
alert("window.plugin = " + window.plugin);
Hi Nikita,
I have made changes which you have mentioned,but still i m getting same error
code
window.plugin= undefined
/code
Hi Asif,
You have included plug-in correctly. Try using this function:prewindow.plugin.print (...)/pre