Issue with push notifications on Ionic 2 specifically for Android 4 devices

Currently, I am working on a project that involves push notifications using the IONIC NATIVE PLUGIN. Everything works smoothly when running ionic cordova run android on android version 5. However, when trying to run it on android version 4, I encounter an error.

Unfortunately, the app named 'App NAME' has stopped.

I am unsure of how to proceed from here. Any assistance would be greatly appreciated!

Answer №1

I have successfully discovered the solution.

Utilize cordova version : 7.1.0

Employ cordova platform version : 6.3.0

In order to enhance the performance of the application, consider using crosswalk.

The device compatibility ranges from android version 4 and onwards.

@Melchia, your input is greatly appreciated.

Answer №2

Prior to developing an application, it is crucial to evaluate the possibility of downgrading your cordova version. Understanding your target audience is essential (what Android versions are they using? Is it necessary to cater to Android 4 users?) Installing the most recent cordova version without consideration can lead to unforeseen issues.

cordova-android Version     Supported Android API-Levels    Equivalent Android Version
6.X.X                                   16 - 25                   4.1 - 7.1.1
5.X.X                                   14 - 23                   4.0 - 6.0.1
4.1.X                                   14 - 22                   4.0 - 5.1
4.0.X                                   10 - 22                   2.3.3 - 5.1
3.7.X                                   10 - 21                   2.3.3 - 5.0.2

If your aim is to support Android 4.0, consider installing cordova 5.x.x. Execute the following command

$ npm i -g <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="096a667b6d667f68493c273d2738">[email protected]</a>
and then add the platform by running this command
$ cordova platform add <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="98f9f6fceaf7f1fcd8acb6a8">[email protected]</a>

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

Transform a Promise of string array into a regular string array

I have a function called fetchSavedCards that retrieves a list of saved cards. The function returns a Promise Object, but I want to convert it into an array of strings and return it. Is this possible? const fetchSavedCards = (): string[] => { return fe ...

Navigating to a PDF file in Angular 2: A step-by-step guide

My problem is trying to load a PDF file on the client side for display in the browser. I've attempted using a normal href with a path relative to the HTML file, but it doesn't seem to be working. <a href="../assets/file.pdf>Get File</a& ...

What is the best way to retrieve JSON data from a URL and use it in my application?

https://i.sstatic.net/K536M.png I am trying to access Json Data from the provided URL for my Android application. Despite searching on Google for solutions, I have not been able to find a clear answer yet. As I am new to Android development, any assista ...

Formatting numbers in Angular 2 to include a space every three zeros in a money amount

Let's say I have the number 30000 and I want to format it as 30 000. What method should I use to achieve this? Here are more examples: 300000 -> 300 000, 3000000 -> 3 000 000. Just to clarify, this is not about using dots or commas, but rathe ...

The argument labeled as 'readonly...' cannot be assigned to a parameter labeled as '...[]' in this context

There's a question that resembles mine but addresses a different issue, which can be seen here: Argument of type '...' is not assignable to parameter of type '...' TS 2345 utils.ts (https://www.typescriptlang.org/docs/handbook/2/g ...

Encountering an issue while attempting to retrieve a key from an Object within an Observable using async functionality

I have a seemingly basic and simple Object that I retrieve using Rx and would like to display a portion of it on screen. I removed all HTML and simply added {{ structure$ | async | json }}, with structure$ being the name of the Observable in my component, ...

The ZoneAwarePromise in Angular 2 consistently yields null as its outcome

Recently, I embarked on the journey of learning ASP.NET Core and Angular 2. Everything was going smoothly until today when I encountered a problem. The issue stems from a very basic Web Api controller. [Route("api/[controller]")] public class HomeControl ...

Implementing AdMob Ads into an Android canvas game panel

Is there a way to add an admob adbanner to a custom canvas SurfaceView? I have a Class that extends SurfaceView and implements its Callback. Are there any solutions for placing a view on top of this surface, such as a simple button? ...

How can you eliminate the first elements of two or more arrays of objects until all of their first elements match based on a specific field?

My Typescript code includes a Map object called `stat_map` defined as const stat_map: Map<string, IMonthlyStat[]> = new Map(); The interface IMonthlyStat is structured as shown below (Note that there are more fields in reality) export interface IMon ...

How can I achieve hover and click effects on an echarts sunburst chart in Angular using programming techniques?

Could I create hover and click effects programmatically on an Echarts sunburst chart using Angular? For example, can I trigger the sunburst click or hover effect from a custom function in my TypeScript file like this: customFunction(labelName: string): v ...

Exploring the creation of an Angular service that utilizes HttpClient for making GET requests, with a focus on the different

I've been diving into Angular lately and I'm facing some challenges with handling get requests. If you're interested, you can check out my code on Angular Stackblitz import { HttpClient} from '@angular/common/http'; import { Inject ...

Adjusting the Body Parameter in Angular's HttpClient

I am working with an Asp.Net Core Web API and Angular framework. One of my actions retrieves values using the following code: [HttpGet] public ActionResult<IEnumerable<MyModel>> Get([FromBody] MyParameter parameter) { ... } My clien ...

When the boolean in RxJS skipWhile remains true

My current scenario involves a specific use-case: There is a service that queues calculation tasks assigned with a certain ID. I have set up an observable to monitor the status of the service. When the ID is still in the queue, the query result is true (i ...

What is the best way to search for and highlight characters in spannable strings while ignoring case sensitivity?

I have integrated a search feature in my application so that when users filter through the list of names, it will highlight the matching names. The only issue is that it currently only highlights lowercase letters and does not highlight any words that are ...

"Defining the structure of object parameters in a function using type

What is the correct way to set typing for object style parameters? The function signature I have is as follows: private buildURI({ endpoint params }): void { } Typescript is throwing an error for missing typings, so I attempted the following: private ...

Redirecting HTTPS for an Angular i18n application using Nginx

After setting up angular localization and following the NGINX example provided in the documentation, everything seems to be working fine. However, there is an issue with redirection. When a user visits https://www.example.com, nginx redirects them to http: ...

Ways to discontinue support for large and xlarge screens for an existing app on the market

Original AndroidManifest File <uses-sdk android:minSdkVersion="8"/> Updated AndroidManifest File <uses-sdk android:minSdkVersion="8"/> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="and ...

The module 'crypto-js' or its corresponding type declarations cannot be located

I have a new project that involves generating and displaying "QR codes". In order to accomplish this, I needed to utilize a specific encoder function from the Crypto library. Crypto While attempting to use Crypto, I encountered the following error: Cannot ...

Communication between PHP server and Android application

Let's illustrate my query with a basic scenario: I have created a small android application where users can log in and stay logged in. This means that I have the user-id stored on the smartphone. On the server, there are user-specific entries that fr ...

Organize an array based on two criteria using Angular

How do I sort first by payment and then by amount in Angular? While in C#, I can easily achieve this with array.orderBy(x => x.payment).thenby(x => x.amount) Is there a similar method or function in Angular for sorting arrays? I have explored the A ...