Skip to content

Commit 4af04fa

Browse files
authored
doc(CORS): update the native options (#2954)
Include different options for Capacitor and Cordova (legacy). Also fixes what was a dead link to Ionic Native.
1 parent d8731a4 commit 4af04fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: docs/troubleshooting/cors.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,13 @@ If you are trying to connect to a 3rd-party API, first check in its documentatio
238238

239239
#### 1. Native-only apps (iOS/Android)
240240

241-
Use the [HTTP plugin from Ionic Native](../native/http.md) to make the requests natively from outside the webview. Please note that this plugin doesn't work in the browser, so the development and testing of the app must always be done in a device or simulator going forward.
241+
##### Capacitor Applications (Recommended)
242242

243-
##### Usage in Ionic Angular 4
243+
For Capacitor applications, use the [Capacitor HTTP API](https://capacitorjs.com/docs/apis/http). This API patches `fetch` and `XMLHttpRequest` to use native libraries. Please note that if you also deploy the application to a web-based context such as PWA or the local development server (via `ionic serve` for example) you still need to implement CORS for those scenarios.
244+
245+
##### Legacy Cordova Applications
246+
247+
For legacy Cordova applications, use the [HTTP plugin with the Awesome Cordova Plugins wrapper](https://danielsogl.gitbook.io/awesome-cordova-plugins/http). Please note that this plugin doesn't work in the browser, so the development and testing of the app must always be done in a device or simulator going forward.
244248

245249
```tsx
246250
import { Component } from '@angular/core';

0 commit comments

Comments
 (0)