Reputation: 351
The amazing 255kb:cordova-keyboard package works perfectly, but because of some bug that I could not figure out it prevents me from building for iphone. How can I add a package only for android? Is this possible? I only need this package to handle some situations where users close the keyboard with the Android hardware back button.
Upvotes: 0
Views: 44
Reputation: 369
You can use Meteor's dynamic imports together with platform detection.
function isAndroid() {
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
}
async function getAndroidLib() {
if(isAndroid) {
return await import('path/to/lib');
}
else {
return {};
}
}
Upvotes: 0