I am new in Ionic. I am using cordova-sms-plugin. Whenever I call this plugin I get message
W/PluginManager: THREAD WARNING: exec() call to SMS.listSMS blocked the main thread for 34ms. Plugin should use CordovaInterface.getThreadPool().
As an example my code look like this:
this.platform.ready().then((readySource) => {
let filter = {
box: 'inbox', // 'inbox' (default), 'sent', 'draft', '' for all
indexFrom: 0, // start from index 0
maxCount: 3, // count of SMS to return each time
};
if (SMS) SMS.listSMS(filter, (ListSms) => {
let messages = ListSms;
console.log(messages);
,
Error => {
alert(JSON.stringify(Error))
});
});
My assumption was that if this.platform().ready() then it handles threads on it is own, however it was naive. Is there a way to manage threads to avoid blocking of the main Thread?
Another issue is that after few sms checks, my app freezes.