[SMS Cordova Plugin] smsplugin is not defined

[SMS Cordova Plugin] smsplugin is not defined

  
Forge Component
(0)
Published on 16 Feb by Pedro Domingues
0 votes
Published on 16 Feb by Pedro Domingues

Hi Pedro,

Thanks for this component.

 I'm using this component in a mobile application for sending SMS.

When I try to send the SMS I get error code 2: smsplugin is not defined.

I'm using ServiceStudio 10.0.717.0. .Net stack.

The steps I've done for testing the app are the following:

  • Created an Application containing 4 espaces (my mobile app, CommonPlugin, AndroidPermissionsPlugin, SMSPlugin)
  • I generated an apk for android phones (build type debug).
  • Scanned the QR code in order to install the app on the phone (both on Samsung and Huawei Honor 9)
  • The app checks the availability of the SMSPlugin by means of the CheckSMSPlugin method prior to sending the SMS (see attachment)
  • Test the app => Outcome of CheckSMSPlugin method is false, Error code = 2, ErrorMessage = "SMSPlugin is not defined"

Your help is appreciated,

Best regards,

Matthieu de Graaf


Matthieu de Graaf wrote:

Hi Pedro,

Thanks for this component.

 I'm using this component in a mobile application for sending SMS.

When I try to send the SMS I get error code 2: smsplugin is not defined.

I'm using ServiceStudio 10.0.717.0. .Net stack.

The steps I've done for testing the app are the following:

  • Created an Application containing 4 espaces (my mobile app, CommonPlugin, AndroidPermissionsPlugin, SMSPlugin)
  • I generated an apk for android phones (build type debug).
  • Scanned the QR code in order to install the app on the phone (both on Samsung and Huawei Honor 9)
  • The app checks the availability of the SMSPlugin by means of the CheckSMSPlugin method prior to sending the SMS (see attachment)
  • Test the app => Outcome of CheckSMSPlugin method is false, Error code = 2, ErrorMessage = "SMSPlugin is not defined"

Your help is appreciated,

Best regards,

Matthieu de Graaf


Update on this issue. If I send the SMS directly (without checking the availability of the SMS plugin) (see screenshot2) I get the follow error: 1: AndroidPermissionsPlugin not available.


Hello Matthieu.

Thanks for using the Plugin.

I've done a simple test on 2 different devices (Huawei P8 Lite 2017 and OnePlus 3 T) just to check the plugin availability and, both of them, returned that the Plugin is available (see attached screenshot). As you're wrote, you're not using OutSystems Now to test the Application, which is correct (otherwise the Plugins will not work).

It is also very weird that you get the message saying that AndroidPermissionsPlugin is not available. Is is considered a depency to have it installed in order to use the SMS Plugin.

Can you please attach your eSpace here for me to test it?

Regards,


Pedro Domingues wrote:

Hello Matthieu.

Thanks for using the Plugin.

I've done a simple test on 2 different devices (Huawei P8 Lite 2017 and OnePlus 3 T) just to check the plugin availability and, both of them, returned that the Plugin is available (see attached screenshot). As you're wrote, you're not using OutSystems Now to test the Application, which is correct (otherwise the Plugins will not work).

It is also very weird that you get the message saying that AndroidPermissionsPlugin is not available. Is is considered a depency to have it installed in order to use the SMS Plugin.

Can you please attach your eSpace here for me to test it?

Regards,


Hi Pedro,

Thanks for the swift reply.

As an attachment I send you a stripped down version of my application, which still contains the error.

Thanks for your help,

Matthieu


Hello Matthieu.

I've added a new button just to check the Plugin availability and it returned that the Plugin is available.

Even sending a SMS was success.

The steps were:

1. Publish the eSpace;

2. Generate a new version of the APK;

3. Download the new APK;

Can you please test with the new button i've added on the attachment?

Pedro Domingues wrote:

Hello Matthieu.

I've added a new button just to check the Plugin availability and it returned that the Plugin is available.

Even sending a SMS was success.

The steps were:

1. Publish the eSpace;

2. Generate a new version of the APK;

3. Download the new APK;

Can you please test with the new button i've added on the attachment?

Hi Pedro,

Once again, thanks for the swift answer. I checked your oml. Indeed, the check availability worked fine. Then I added the send sms method again to the method. Now I get the  "AndroidPermissionsPlugin is not available" error again. Could you please check my sample app (based on your modified app) in the attachment?

Regards,


Matthieu


Hello Matthieu,

Honestly i don't know what is happening.

I've added another button to check the availability of the Plugin for Android Permissions (eSpace attached) and both of them are available.

Can you please test?

Hi Pedro,

There seems to be a problem with the android plugin on our infrastructure. When checking the android permissions availability we get "cannot read property 'permissions' of undefined.


That's odd!!

Can you please try to get some help on the original thread for the Android Permission Plugin here?

If you need further help related with this plugin, just let me know.

Cheers

Hi Pedro,

Just for cross checking could you send me your version of the Android Permission Plugin. If I install this version and everything works ok, then the issue can be trapped more easily

Thanks for all your help,

Matthieu


Sure!

That's a good idea!!

Here you have!

Please let me know once tested.

Regards

Solution

Hi Pedro,

After installing your oap everything worked fine. However, it doesn't seem due to the version of the plugin.

After installing the android permissions plugin (APP) it is installed in it's own application and everything works fine. After moving the espace to a another application the same error occurs. I'll report this issue to Miguel.

Thanks for all your help,

Matthieu

Solution

Matthieu,

Plugins should live as standalone Applications in order to be reused by another Apps in the factory\server.

Just my 2 cents! :)

Regards,

Pedro Domingues

Hi Pedro,

I agree with you but the number applications can be become rather large. That's why I combine a set of commonly used libraries in a library application.

Regrards,

Matthieu