Oguzhan D.
Oguzhan D.

Reputation: 169

Can't use POST method in Ionic 3

I have application that is on App Store.

While developing it, I tested in both Android and iOS.

It works perfectly fine in iOS, right now. However, in Android, I can't login using my RESTful service.

Here is the error visible in remote debug console;

Google Chrome Console

I don't know what does the error trying to tell me? I don't understand why it works in iOS, but not in Android; while it was working past days. I didn't change a thing.

When user hits to Login button, below method is executed;

this.loginService.Login(this.inputName, this.inputPassword).subscribe( () => {
  // Route user to home page!
});

The method above is implemented inside login.service.ts. Inside this service, it uses the ApiService class which is defined in api.service.ts

Upvotes: 1

Views: 75

Answers (1)

Aman
Aman

Reputation: 1382

It could be a permission issue. Add these lines in your "platforms/android/AndroidManifest.xml" file and try:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

Upvotes: 1

Related Questions