The cordova module "cordova/plugin/SmsInboxPlugin cannot be located."

I am currently experimenting with the sms-reception-plugin implementation. After creating the plugin.xml

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
       id="cordova.plugin"
  version="0.1.2" >

<name>SmsReception</name>
<description>Cordova SmsReception Plugin</description>
<license>Apache 2.0</license>
<keywords>cordova,smsreception</keywords>


<js-module src="www/SmsInboxPlugin.js" name="cordova.plugin.smsplugin">
    <clobbers target="cordova.plugin" />
</js-module>

<!-- android -->
<platform name="android">
    <config-file target="res/xml/config.xml" parent="/*">
        <feature name="SmsPlugin">
          <param name="android-package" value="org.apache.cordova.plugin.SmsInboxPlugin" />
        </feature>
    </config-file>

    <source-file src="src/android/SmsInboxPlugin.java" target-dir="src/org/apache/cordova/plugin" />
    <source-file src="src/android/SmsReceiver.java" target-dir="src/org/apache/cordova/plugin" />

</platform>

</plugin>

Next, I incorporated this code in .html

var smsPlugin = cordova.require('cordova/plugin/smsplugin');
but encountered the error
Uncaught module cordova/plugin/smsplugin not found
I followed the guidelines in creating the plugin.xml mentioned here. If anyone has any insights, please assist me.

Answer №1

Check out this helpful tutorial, and make sure you've followed the instructions carefully.

http://devgirl.org/2013/09/17/how-to-write-a-phonegap-3.0-plugin-for-android/

Answer №2

Make sure to verify the existence of the name property within the js-module. I encountered this issue while utilizing the same plugin, and it should match the Plugin's name.

If this solution does not resolve the issue, consider switching to an alternate one like the PhoneGap-SMS Plugin. It could prove to be helpful.

For a better understanding of how these plugins are structured, refer to the documentation on cordova plugins: Cordova Plugin Documentation

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An error was encountered while attempting to proxy the request [HPM]

After cloning a GitHub repository, I ran npm i in both the root directory and client directories. I then created a development configuration file. However, when attempting to run npm run dev, nodemon consistently crashes with a warning about compiled cod ...

Is it possible to add a personalized parameter to an unnamed JavaScript replace function?

I am looking to customize a date value in the following format: var d = new Date(); myobj.format(d, "dddd (ddd) S dd'd'.MM (MMM MMMM).yyyy HH:mm:ss.fff t tt T TT (o) {Z}"); I prefer not to utilize date.js because of its large size. The issue ...

Utilizing JSON data within dialogue rather than an activity

Is it possible to display a JSON formatted response from a webservice, such as the opening hours of a restaurant, in a custom dialog? The issue I'm facing is that I currently have a listview with an onClicklistener that opens a new activity where I p ...

Hidden IFrame for Jquery File Upload

I was looking for a quick guide on setting up an AJAX-style file upload using a hidden iframe. Below is the section of HTML code related to the form: <div id = "file" class = "info"> <form id="file_upload_form" method="post" enctype=" ...

Locate the generated ID of the inserted child when saving the parent in MongoDB

If I have a document representing a post with comments like the one below: { "_id": "579a2a71f7b5455c28a7abcb", "title": "post 1", "link": "www.link1.com", "__v": 0, "comments": [ { "author": "Andy", "body": "Wis ...

Tips for eliminating nested switchMaps with early returns

In my project, I have implemented 3 different endpoints that return upcoming, current, and past events. The requirement is to display only the event that is the farthest in the future without making unnecessary calls to all endpoints at once. To achieve th ...

Node.js and Express: tackling the problem of duplicate variables

I have a checkUser middleware that saves the user information when a JWT is verified. However, when I integrate it into my routes and attempt to log res.locals.user.username, the username appears twice in the console. This duplication is causing issues wit ...

Interested in building an album app using Django Tastypie and Backbone?

I'm currently working on developing a new album application using django, with two essential django models: class Album(models.Model): name = models.CharField(max_length=100) family = models.ForeignKey(FamilyProfile) created_by = models.F ...

An alternative to Socket.io tailored for up-to-date web browsers

Are there any specialized versions of Socket.io or similar libraries that cater to modern browsers exclusively, utilizing Websockets without the need for legacy browser support and outdated code? ...

Aligning a rotated paragraph in the middle of its parent container

Here is my current progress: http://jsfiddle.net/2Zrx7/2/ .events{ height:100px; position: relative; } .tt_username{ position: absolute; top:0px; height: 100%; width: 30px; background: #ccc; text-align: center; } .tt_usern ...

A guide to selecting the dropdown item labeled as (Select All) using Python and Selenium

edit: Trying to submit parameters for a database-generated report on this page. Successfully modified the start date in the first field using send_keys(), but unable to click on "(Select All)" for fields 3 and onwards, except one. In order to access the h ...

What could be causing the issue with Google Chart in my ASP MVC app?

My controller has a method that returns Json data. [HttpPost] public JsonResult CompanyChart() { var data = db.adusers; var selectUsers = from s in data where (s.Company != null) select s; int f ...

Preventing the use of the <select> tag in JavaScript

As a beginner in JavaScript, I thought it would be a great idea to work on a simple Calculator project. I've already tackled the basics like addition and subtraction, but now I'm contemplating adding a squareroot function to it. The design incl ...

The beforeunload function in jQuery is not behaving as anticipated

My current goal is to show a pop-up with three choices whenever a user attempts to close the tab while on my website, and then store that choice somewhere. In my main.js file, which loads across all site pages, I have implemented the following code: $(do ...

Improve performance by debouncing computed properties and getters in Vue

I'm having trouble getting debounce to work with computed properties and Vuex getters. The debounced functions are always returning undefined. Check out this JSFiddle for an example HTML: <div id="app"> <input v-model="text"> <di ...

Vue.js: Retrieving and Using Data from the API Repeatedly

<template> <h1 class="text-lg text-gray-400 font-medium">Tracker dashboard</h1> <div class="flex flex-col mt-2 w-3/4"> <div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"> ...

Retrieving items from an array based on their class association

My challenge involves handling a list of items obtained using the following code: var searchResultItems = $(resultContainerId + ' li'); Each item in the search results can have different classes. How can I extract all items with a specific clas ...

A "fresh" expression lacking a construction signature for its target is automatically assigned an "any" type

I am encountering an issue with my file notifications.service.ts that handles push notifications: import { useEffect } from 'react'; import { PushNotifications, PushNotificationSchema, PushNotificationToken } from '@capacitor/push-notificati ...

Is a Toolbar plugin or custom Toolbar options the better choice for your project?

Could anyone recommend a Jquery plugin for adding a ToolBar option to my web application? I've searched and researched for the past 48 hours but haven't found a reliable one yet. If the recommended toolbar resembles the image below, that would b ...

Error: The "render" method is not available for the IncomingMessage object

While working on a basic application using node.js and express, everything seems to be in order except for this error that keeps popping up: res.render("aggregatedCostList",{ ^ TypeError: Object #<IncomingMessage> has no method 'render&ap ...