https error when using an external library with ionic

Viewed 24

I'm trying to use an external library with Ionic and Capacitor, but i have the response:

Failed 400 - "Https.Required"

I have:

index.html

<html>
<body>
  <app-root></app-root>
</body>
<script src="https://urlExample.js"></script>
</html>

home.page.ts

import { Component } from '@angular/core';
declare var ExampleVar: any;

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  constructor() {
    console.log(ExampleVar); //works fine

    this.startApi();
  }

  startApi() {
    ExampleVar.start({
       authorization: token
    });
  }
}

The ExampleVar.start function runs fine, it opens some screens with a form but when I send it, it fails. When making POST it returns a 400 error.

I don't know where I have to tell IONIC or CAPACITOR to use https, or what I have to do

0 Answers
Related