Software Archive
Read-only legacy content
17061 Discussions

Fail to Import Third-Party Plugin

Marco_S_
Beginner
349 Views

Hi all,

I created an HTML+Cordova project and I tried without success to import and use plugin com.jsmobile.plugins.sms using Intel XDK internal tool.

I wonder where I am going wrong. Can you help me?

Thanks in advance.

Mark

0 Kudos
5 Replies
John_H_Intel2
Employee
349 Views

You must be doing something incorrectly. It works fine when I imported and added the correct code from the plugins site. 

function sendSMS()
        {
            var messageInfo = {
                phoneNumber: "4849425499",
                textMessage: "This is a test message"
            };

            sms.sendMessage(messageInfo, function(message) {
                console.log("success: " + message);
                }, function(error) {
                    console.log("code: " + error.code + ", message: " + error.message);
                });
        }

    <button style="width:100%;height:20px;left:0px;right:0px" onclick="sendSMS()">sendSMS</button>

 

0 Kudos
John_H_Intel2
Employee
349 Views

You need to build it and test it on device :)

0 Kudos
Marco_S_
Beginner
349 Views

Hi John,

thank you very much. You´re right , the plugin runs!

Two considerations:

 1> unfortunately the XDK it´s a bit tricky because don't see the code in the plugin list on the left with the others Cordova plugins.

 2> if you debug the device you get an error : sms not defined. Ok, into the INTEL XDK documentation I read that is not possible to debug of third-party plugin.

Thanks a Lot for you HELP !!

Marco

0 Kudos
Marco_S_
Beginner
349 Views

Is it possible to manually install the plugins, copying the source folder and modifing xml files?

0 Kudos
John_H_Intel2
Employee
349 Views

1. The list of Cordova plugins in the XDK are considered the core plugins. We test them to ensure they work. We can not include every Cordova plugin other wise we would have to test all of them to make sure they are compatiable, which we do not have time to do. This is why we allow you to include other 3rd party Cordova plugins.

2. You MUST build you app and install it to test the 3rd party plugins.

0 Kudos
Reply