firescript / nativescript-contacts

A nativescript module that gives access to the native contact directory.
MIT License
28 stars 32 forks source link

getAllContacts method not Webpack compatible #46

Closed NickIliev closed 5 years ago

NickIliev commented 5 years ago

@firescript the method getAllContacts is using a Worker it must be also made Webpack compatible.

e.g. change this line

orker = new Worker('./get-all-contacts-worker.js'); // relative for caller script path

to

var worker;
        if (global["TNS_WEBPACK"]) {
            var myWorker = require('nativescript-worker-loader!./get-all-contacts-worker.js.js');
            worker = new myWorker();
        } else {
            worker = new Worker('./get-all-contacts-worker.js'); // relative for caller script path
        }
erkanarslan commented 5 years ago

@NickIliev After moving my mobile only project to a code sharing project which is based on webpack I cannot use getContact() function. Its success and error promise callbacks aren't called and the code block after the line where I call contacts.getContact() is not executed at all. The function containing all that logic returns immediately.

Do you think that this might be related to the webpack problem you mentioned?

Edit: I found that contact selection window cannot be opened in a modal.

jzgoda commented 5 years ago

Resolved by PR #50