When attempting to launch the Ember Cordova application on the mobile device, an error was encountered stating: "Unable to access property 'notification' as it is

After installing cordova-plugin-local-notifications and trying it again, I encountered an error on the following line of code:

cordova.plugins.notification.local.on("click", function (notification) {

The error message reads:

Error while processing route: dashboard Cannot read property 'notification' of undefined TypeError: Cannot read property 'notification' of undefined

When I commented out that line, I faced another error with the next line of code:

states[Connection.UNKNOWN] = 'Unknown connection';

Once again, this error indicated that the connection does not exist. After investigating, I suspected that there might be a missing cordova package or dependency. However, running the same set of code lines in another app's application.js did not result in any errors. Upon comparing the two applications, I found no discrepancies in the cordova-related entries in the package and bower json files.

https://i.sstatic.net/y9EiQ.png

Answer №1

There was a issue with missing plugins in the cordova/config.xml file.

<widget id="com.organization.mobileapp" version="2.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
...
<plugin name="org.plugin.custom.notification" spec="https://github.com/organization/custom-notification-plugin" />
...
</widget

This fix successfully resolved the problem after rebuilding the app.

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

Renew the php blade foreach loop using jQuery to update data live

I have a foreach cycle in my HTML, and at one point, some data is posted from JavaScript. I would like to append it once it is added to the database. I need to find a way to refresh the foreach loop without reloading the entire page (I could simply use ap ...

What could be the reason for the image upload failure on Firebase storage?

To select an image, you can click on the 'CHOOSE IMAGE' button and it will display in an imageview. After clicking 'SAVE IMAGE', the chosen image will be uploaded to Firebase storage. If successful, information about the image will also ...

Issue with Bootstrap jQuery dynamic table edit/delete/view button functionality not functioning as expected

Could really use some assistance with this issue. I have a DataTable that includes a button in the last column which offers options like Edit/Delete/View. When clicked, it should delete the entire row. However, I'm struggling to access the current ele ...

How to deselect a radio button in AngularJS

I have explored various solutions using ng-dblclick, $event, etc, but none of them seem to work for me. Within a table, I have two radio buttons inside an ng-repeat. I have a field that determines which radio button should be active. While using ng-change ...

Express encountered an unexpected error when attempting to navigate to the client directory

I am attempting to send the index.html file from my client directory, located at the same level as my server directory. However, I am encountering the following error: TypeError: undefined is not a function at Object.handle (/myapp/server/routes/routes.js ...

Incorporate javascript into your XML transformations with XSLT

I need help with inserting JavaScript in XSLT. Here is an example of what I am trying to do: <xsl:variable name="comboname" select="@name" /> <script type="text/javascript"> var z{$comboname} = {$comboname}; </scri ...

Incorporating the parent tag name within jQuery elements

I am working with an HTML file that consists of around 100 elements. Using jQuery in my JavaScript file, I have created a variable to store all elements present in the HTML document. Additionally, I have another variable specifically for text nodes withi ...

Access an attribute using slashes in Jquery

I've been struggling to use jQuery to select an object based on a unique filename attribute. However, I'm facing issues with escaping slashes when the selector is created using a variable. Despite spending hours trying different combinations, I s ...

The StrongLoop ng-lb command encounters issues when utilizing the local-storage-connector

Hello Strongloop community, I have been experimenting with the local-storage data store example provided by loopback. It's working well and I can successfully create and retrieve files from the local file system (used as a data source) using the REST ...

What is the easiest way to pass a chosen value to PHP?

My goal is to dynamically display photos based on the selected album without refreshing the entire page. Here is my current script: <script type="text/javascript"> function replaceContent(divName, contentS) { document.g ...

Node.js Dependency and Git+HTTPS URL in App Engine

When deploying a node.js 12 project to App Engine (standard environment) with a dependency in package.json like this: "some-lib": "git+https://github.com/a/b.git", An error occurs during deployment when running gcloud app deploy. This ...

ReferenceError: 'exports' is undefined in the context of Typescript Jest

I'm currently delving into unit testing with jest and encountered an error that looks like this: > npm run unit > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="771f181012374659475947">[email protected]</ ...

Alignment of Material-UI dialogue buttons on the left side

I have a Dialog containing three buttons as shown below: https://i.stack.imgur.com/T6o35.png Here is the JSX code: <DialogActions classes={{ root: this.props.classes.dialogActionsRoot }} > <Button classes={{ root: this.props ...

Insert a new item into an existing list using jQuery

I am looking to enhance user experience by allowing them to easily add multiple sets of inputs with just one click. I have been experimenting with jQuery in order to dynamically insert a new row of input fields after the initial set. My current approach i ...

"Limit the display of the b-form-datepicker to only show the month and

Is there a way to customize the b-form-datepicker in order to only allow selection of the month and year? I've searched through bootstrap-vue but couldn't find an example. ...

Applying custom CSS to individual divs based on their text height using jQuery

I have a grid consisting of multiple boxes each sized at 280px by 280px, and I am seeking a way to vertically align text within hover overlays on each box. While my current code successfully aligns the text for the first box, I am encountering issues due ...

Javascript for Cordova utilizing WebSocket and incorporating client side certificates

I am looking to establish a secure SSL/TLS connection between my client and server, with only a specific authorized client allowed to connect. To achieve this, I have generated a client certificate using OpenSSL on the server for mutual authorization. The ...

Explore an array of elements to find the correct objectId stored in mongodb

element, I am faced with a challenge of searching through an array of objects to find a key that contains nested object id for populating purposes. Exploring My Object { service: 'user', isModerator: true, isAdmin: true, carts: [ ...

"Troubleshooting the persistent error with Android Ionic Cordova and @ionic-native/camera remains unresolved

Whenever I try to run the command > npm install @ionic-native/camera, I encounter the following error: npm audit report The error indicates vulnerabilities in several dependencies in the project: ansi-regex >2.1.1 <5.0.1 - Severity: moderate ...

Problem with full-page navigation sliding in and fading in and out

Upon the user's click on <a href="#slide-nav" class="slide-nav-trigger">, a full-page navigation smoothly slides into view. This animation is triggered by CSS and uses jQuery for event delegation. The Dilemma Instead of abruptly turning on and ...