From 7bc9f052b3508b27c1d769ebc61a22acc2dc7a24 Mon Sep 17 00:00:00 2001 From: Eric Horodyski Date: Thu, 27 Jun 2024 15:03:08 -0400 Subject: [PATCH 1/4] docs: clarify RN instructions and class paths --- .../how-to/using-a-capacitor-plugin.md | 510 ++++++++++++++++-- 1 file changed, 477 insertions(+), 33 deletions(-) diff --git a/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md b/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md index c723125..d6cde64 100644 --- a/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md @@ -6,7 +6,7 @@ sidebar_label: Use a Capacitor Plugin import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; -import { getPortalsVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util'; +import { getPortalsVersion, getCapacitorVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util'; How to Use Capacitor Plugins: Core & Others | Ionic @@ -24,13 +24,43 @@ Capacitor [Core Plugins](https://capacitorjs.com/docs/apis) are plugins built by ### React Native Usage -Follow the [Android instructions](../../for-android/how-to/using-a-capacitor-plugin.md) and the [iOS instructions](../../for-ios/how-to/using-a-capacitor-plugin.md) in your native applications. When creating your portal, you will need to specify the android classpath and iOS Objective-C class name for the plugin class you intend to use: +In order to use a Capacitor Core Plugin, you need to install the plugin as a dependency in your `Podfile` and as a dependency in your `build.gradle` file. -```javascript -import { addPortal } from "@ionic/portals-react-native"; + + + +{ +`pod 'IonicPortals', '~> ${getPortalsVersionIos()}' +pod 'CapacitorPreferences', '~> ${getCapacitorVersion()}' +`.trim() +} + + + + +{ +` +dependencies { + implementation 'io.ionic:portals:${getPortalsVersionAndroid()}' + implementation 'com.capacitorjs:preferences:${getCapacitorVersion()}' +}`.trim() +} + + + + +:::caution +To avoid errors, make sure that the versions in your `build.gradle`, `Podfile`, and `package.json` match! +::: + + +When creating your portal, you will need to specify the Android classpath and the iOS Objective-C class name for the plugin you intend to use: + +```jsx +import { PortalView } from "@ionic/portals-react-native"; const cameraPortal = { - name: "camera", + name: "cameraFeature", plugins: [ { androidClassPath: "com.capacitorjs.plugins.camera.CameraPlugin", @@ -39,102 +69,516 @@ const cameraPortal = { ] }; -await addPortal(cameraPortal); + ``` ### Published Plugins -In CocoaPods, the Capacitor plugins are prepended with `Capacitor`. For example, the `@capacitor/storage` plugin on npm is named `CapacitorStorage` on CocoaPods. The following Plugins are available in CocoaPods. -**[CapacitorActionSheet](https://capacitorjs.com/docs/apis/action-sheet)** + +**[Action Sheet](https://capacitorjs.com/docs/apis/action-sheet)** + + + + + + + + + + +
**Pod**`CapacitorActionSheet`
**Maven**`com.capacitorjs:action-sheet`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.actionsheet.ActionSheetPlugin", + iosClassName: "ActionSheetPlugin" +} +``` The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take. -**[CappacitorApp](https://capacitorjs.com/docs/apis/app)** +**[App](https://capacitorjs.com/docs/apis/app)** + + + + + + + + + + +
**Pod**`CapacitorApp`
**Maven**`com.capacitorjs:app`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.app.AppPlugin", + iosClassName: "AppPlugin" +} +``` The App API handles high level App state and events. For example, this API emits events when the app enters and leaves the foreground, handles deeplinks, opens other apps, and manages persisted plugin state. -**[CapacitorAppLauncher](https://capacitorjs.com/docs/apis/app-launcher)** +**[App Launcher](https://capacitorjs.com/docs/apis/app-launcher)** + + + + + + + + + + +
**Pod**`CapacitorAppLauncher`
**Maven**`com.capacitorjs:app-launcher`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.applauncher.AppLauncherPlugin", + iosClassName: "AppLauncherPlugin" +} +``` + +The AppLauncher API allows the opening of other apps. -The AppLauncher API allows to open other apps +**[Browser](https://capacitorjs.com/docs/apis/browser)** -**[CapacitorBrowser](https://capacitorjs.com/docs/apis/browser)** + + + + + + + + + +
**Pod**`CapacitorBrowser`
**Maven**`com.capacitorjs:browser`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.browser.BrowserPlugin", + iosClassName: "CAPBrowserPlugin" +} +``` The Browser API provides the capability to open an in-app browser and subscribe to browser events. -**[CapacitorCamera](https://capacitorjs.com/docs/apis/camera)** +**[Camera](https://capacitorjs.com/docs/apis/camera)** + + + + + + + + + + +
**Pod**`CapacitorCamera`
**Maven**`com.capacitorjs:camera`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.camera.CameraPlugin", + iosClassName: "CAPCameraPlugin" +} +``` The Camera API provides the capability to take a photo with the camera or to choose photos from the photo album. -**[CapacitorClipboard](https://capacitorjs.com/docs/apis/clipboard)** +**[Clipboard](https://capacitorjs.com/docs/apis/clipboard)** + + + + + + + + + + +
**Pod**`CapacitorClipboard`
**Maven**`com.capacitorjs:clipboard`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.clipboard.ClipboardPlugin", + iosClassName: "ClipboardPlugin" +} +``` The Clipboard API enables copy and pasting to/from the system clipboard. -**[CapacitorDevice](https://capacitorjs.com/docs/apis/device)** +**[Device](https://capacitorjs.com/docs/apis/device)** + + + + + + + + + + +
**Pod**`CapacitorDevice`
**Maven**`com.capacitorjs:device`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.device.DevicePlugin", + iosClassName: "DevicePlugin" +} +``` The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids. -**[CapacitorDialog](https://capacitorjs.com/docs/apis/dialog)** +**[Dialog](https://capacitorjs.com/docs/apis/dialog)** + + + + + + + + + + +
**Pod**`CapacitorDialog`
**Maven**`com.capacitorjs:dialog`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.dialog.DialogPlugin", + iosClassName: "DialogPlugin" +} +``` The Dialog API provides methods for triggering native dialog windows for alerts, confirmations, and input prompts. -**[CapacitorFilesystem](https://capacitorjs.com/docs/apis/filesystem)** +**[Filesystem](https://capacitorjs.com/docs/apis/filesystem)** + + + + + + + + + + +
**Pod**`CapacitorFilesystem`
**Maven**`com.capacitorjs:filesystem`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.filesystem.FilesystemPlugin", + iosClassName: "FilesystemPlugin" +} +``` The Filesystem API provides a NodeJS-like API for working with files on the device. -**[CapacitorGeolocation](https://capacitorjs.com/docs/apis/geolocation)** +**[Geolocation](https://capacitorjs.com/docs/apis/geolocation)** + + + + + + + + + + +
**Pod**`CapacitorGeolocation`
**Maven**`com.capacitorjs:geolocation`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.geolocation.GeolocationPlugin", + iosClassName: "GeolocationPlugin" +} +``` The Geolocation API provides simple methods for getting and tracking the current position of the device using GPS, along with altitude, heading, and speed information if available. -**[CapacitorHaptics](https://capacitorjs.com/docs/apis/haptics)** +**[Haptics](https://capacitorjs.com/docs/apis/haptics)** + + + + + + + + + + +
**Pod**`CapacitorHaptics`
**Maven**`com.capacitorjs:haptics`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.haptics.HapticsPlugin", + iosClassName: "HapticsPlugin" +} +``` The Haptics API provides physical feedback to the user through touch or vibration. -**[CapacitorKeyboard](https://capacitorjs.com/docs/apis/keyboard)** +**[Keyboard](https://capacitorjs.com/docs/apis/keyboard)** + + + + + + + + + + +
**Pod**`CapacitorKeyboard`
**Maven**`com.capacitorjs:keyboard`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.keyboard.KeyboardPlugin", + iosClassName: "KeyboardPlugin" +} +``` The Keyboard API provides keyboard display and visibility control, along with event tracking when the keyboard shows and hides. -**[CapacitorLocalNotifications](https://capacitorjs.com/docs/apis/local-notifications)** +**[Local Notifications](https://capacitorjs.com/docs/apis/local-notifications)** + + + + + + + + + + +
**Pod**`CapacitorLocalNotifications`
**Maven**`com.capacitorjs:local-notifications`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin", + iosClassName: "LocalNotificationsPlugin" +} +``` The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications). -**[CapacitorMotion](https://capacitorjs.com/docs/apis/motion)** +**[Network](https://capacitorjs.com/docs/apis/network)** -The Motion API tracks accelerometer and device orientation (compass heading, etc.) + + + + + + + + + +
**Pod**`CapacitorNetwork`
**Maven**`com.capacitorjs:network`
-**[CapacitorNetwork](https://capacitorjs.com/docs/apis/network)** + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.network.NetworkPlugin", + iosClassName: "CAPNetworkPlugin" +} +``` The Network API provides network and connectivity information. -**[CapacitorPushNotifications](https://capacitorjs.com/docs/apis/push-notifications)** +**[Preferences](https://capacitorjs.com/docs/apis/preferences)** + + + + + + + + + + +
**Pod**`CapacitorPreferences`
**Maven**`com.capacitorjs:preferences`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.preferences.PreferencesPlugin", + iosClassName: "PreferencesPlugin" +} +``` + +The Preferences API provides a simple key/value persistent store for lightweight data. + +**[Push Notifications](https://capacitorjs.com/docs/apis/push-notifications)** + + + + + + + + + + +
**Pod**`CapacitorPushNotifications`
**Maven**`com.capacitorjs:push-notifications`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin", + iosClassName: "PushNotificationsPlugin" +} +``` The Push Notifications API provides access to native push notifications. -**[CapacitorScreenReader](https://capacitorjs.com/docs/apis/screen-reader)** +**[Screen Reader](https://capacitorjs.com/docs/apis/screen-reader)** + + + + + + + + + + +
**Pod**`CapacitorScreenReader`
**Maven**`com.capacitorjs:screen-reader`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.screenreader.ScreenReaderPlugin", + iosClassName: "ScreenReaderPlugin" +} +``` The Screen Reader API provides access to TalkBack/VoiceOver/etc. and provides simple text-to-speech capabilities for visual accessibility. -**[CapacitorShare](https://capacitorjs.com/docs/apis/share)** +**[Share](https://capacitorjs.com/docs/apis/share)** + + + + + + + + + + +
**Pod**`CapacitorShare`
**Maven**`com.capacitorjs:share`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.share.SharePlugin", + iosClassName: "SharePlugin" +} +``` The Share API provides methods for sharing content to any sharing-enabled apps that the user may have installed. -**[CapacitorSplashScreen](https://capacitorjs.com/docs/apis/splash-screen)** +**[Splash Screen](https://capacitorjs.com/docs/apis/splash-screen)** + + + + + + + + + + +
**Pod**`CapacitorSplashScreen`
**Maven**`com.capacitorjs:splash-screen`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin", + iosClassName: "SplashScreenPlugin" +} +``` The Splash Screen API provides methods for showing or hiding a Splash image. -**[CapacitorStatusBar](https://capacitorjs.com/docs/apis/status-bar)** +**[Status Bar](https://capacitorjs.com/docs/apis/status-bar)** + + + + + + + + + + +
**Pod**`CapacitorStatusBar`
**Maven**`com.capacitorjs:status-bar`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.statusbar.StatusBarPlugin", + iosClassName: "StatusBarPlugin" +} +``` The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it. -**[CapacitorStorage](https://capacitorjs.com/docs/apis/storage)** +**[Text Zoom](https://capacitorjs.com/docs/apis/text-zoom)** -The Storage API provides a simple key/value persistent store for lightweight data. + + + + + + + + + +
**Pod**`CapacitorTextZoom`
**Maven**`com.capacitorjs:text-zoom`
-**[CapacitorTextZoom](https://capacitorjs.com/docs/apis/text-zoom)** + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.textzoom.TextZoomPlugin", + iosClassName: "TextZoomPlugin" +} +``` The Text Zoom API provides the ability to change Web View text size for visual accessibility. -**[CapacitorToast](https://capacitorjs.com/docs/apis/toast)** +**[Toast](https://capacitorjs.com/docs/apis/toast)** + + + + + + + + + + +
**Pod**`CapacitorToast`
**Maven**`com.capacitorjs:toast`
+ + +```javascript +{ + androidClassPath: "com.capacitorjs.plugins.toast.ToastPlugin", + iosClassName: "ToastPlugin" +} +``` The Toast API provides a notification pop up for displaying important information to a user. Just like real toast! From 66ed79c38cb032bf1f4944a287574f46f9643fce Mon Sep 17 00:00:00 2001 From: Eric Horodyski Date: Thu, 27 Jun 2024 15:03:45 -0400 Subject: [PATCH 2/4] docs: replace Storage plugin with Preferences and set actual Cap version in code block --- .../how-to/using-a-capacitor-plugin.md | 60 ++++++++++--------- .../how-to/using-a-capacitor-plugin.md | 16 ++--- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/website/docs/for-android/how-to/using-a-capacitor-plugin.md b/website/docs/for-android/how-to/using-a-capacitor-plugin.md index 9f1a95c..1de1719 100644 --- a/website/docs/for-android/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-android/how-to/using-a-capacitor-plugin.md @@ -6,7 +6,7 @@ sidebar_label: Use a Capacitor Plugin import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; -import { getPortalsVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util'; +import { getPortalsVersion, getCapacitorVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util'; How to Use Capacitor Plugins: Core & Others | Ionic @@ -31,7 +31,7 @@ In order to use a Capacitor Core Plugin, you need to install the plugin as a dep ` dependencies { implementation 'io.ionic:portals:${getPortalsVersionAndroid()}' - implementation 'com.capacitorjs.storage:1.2.0' + implementation 'com.capacitorjs.preferences:${getCapacitorVersion()}' }`.trim() } @@ -70,89 +70,93 @@ builder = builder.addPlugin(MyPlugin.class) ### Published Plugins -In MavenCentral, the Capacitor plugins are prepended with `com.capacitorjs`. For example, the `@capacitor/storage` plugin on npm is named `com.capacitorjs.storage` on Maven. The following Plugins are available in MavenCentral. +In MavenCentral, the Capacitor plugins are prepended with `com.capacitorjs`. For example, the `@capacitor/preferences` plugin on npm is named `com.capacitorjs:preferences` on Maven. The following Plugins are available in MavenCentral. -**[com.capacitorjs.action-sheet](https://capacitorjs.com/docs/apis/action-sheet)** +**[com.capacitorjs:action-sheet](https://capacitorjs.com/docs/apis/action-sheet)** The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take. -**[com.capacitorjs.app-launcher](https://capacitorjs.com/docs/apis/app-launcher)** +**[com.capacitorjs:app](https://capacitorjs.com/docs/apis/app)** -The AppLauncher API allows to open other apps +The App API handles high level App state and events. For example, this API emits events when the app enters and leaves the foreground, handles deeplinks, opens other apps, and manages persisted plugin state. -**[com.capacitorjs.browser](https://capacitorjs.com/docs/apis/browser)** +**[com.capacitorjs:app-launcher](https://capacitorjs.com/docs/apis/app-launcher)** + +The AppLauncher API allows the opening of other apps. + +**[com.capacitorj:.browser](https://capacitorjs.com/docs/apis/browser)** The Browser API provides the capability to open an in-app browser and subscribe to browser events. -**[com.capacitorjs.camera](https://capacitorjs.com/docs/apis/camera)** +**[com.capacitorjs:camera](https://capacitorjs.com/docs/apis/camera)** The Camera API provides the capability to take a photo with the camera or to choose photos from the photo album. -**[com.capacitorjs.clipboard](https://capacitorjs.com/docs/apis/clipboard)** +**[com.capacitorjs:clipboard](https://capacitorjs.com/docs/apis/clipboard)** The Clipboard API enables copy and pasting to/from the system clipboard. -**[com.capacitorjs.device](https://capacitorjs.com/docs/apis/device)** +**[com.capacitorjs:device](https://capacitorjs.com/docs/apis/device)** The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids. -**[com.capacitorjs.dialog](https://capacitorjs.com/docs/apis/dialog)** +**[com.capacitorjs:dialog](https://capacitorjs.com/docs/apis/dialog)** The Dialog API provides methods for triggering native dialog windows for alerts, confirmations, and input prompts. -**[com.capacitorjs.filesystem](https://capacitorjs.com/docs/apis/filesystem)** +**[com.capacitorjs:filesystem](https://capacitorjs.com/docs/apis/filesystem)** The Filesystem API provides a NodeJS-like API for working with files on the device. -**[com.capacitorjs.geolocation](https://capacitorjs.com/docs/apis/geolocation)** +**[com.capacitorjs:geolocation](https://capacitorjs.com/docs/apis/geolocation)** The Geolocation API provides simple methods for getting and tracking the current position of the device using GPS, along with altitude, heading, and speed information if available. -**[com.capacitorjs.haptics](https://capacitorjs.com/docs/apis/haptics)** +**[com.capacitorjs:haptics](https://capacitorjs.com/docs/apis/haptics)** The Haptics API provides physical feedback to the user through touch or vibration. -**[com.capacitorjs.keyboard](https://capacitorjs.com/docs/apis/keyboard)** +**[com.capacitorjs:keyboard](https://capacitorjs.com/docs/apis/keyboard)** The Keyboard API provides keyboard display and visibility control, along with event tracking when the keyboard shows and hides. -**[com.capacitorjs.local-notifications](https://capacitorjs.com/docs/apis/local-notifications)** +**[com.capacitorjs:local-notifications](https://capacitorjs.com/docs/apis/local-notifications)** The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications). -**[com.capacitorjs.network](https://capacitorjs.com/docs/apis/network)** +**[com.capacitorjs:network](https://capacitorjs.com/docs/apis/network)** The Network API provides network and connectivity information. -**[com.capacitorjs.push-notifications](https://capacitorjs.com/docs/apis/push-notifications)** +**[com.capacitorjs:preferences](https://capacitorjs.com/docs/apis/preferences)** + +The Preferences API provides a simple key/value persistent store for lightweight data. + +**[com.capacitorjs:push-notifications](https://capacitorjs.com/docs/apis/push-notifications)** The Push Notifications API provides access to native push notifications. -**[com.capacitorjs.screen-reader](https://capacitorjs.com/docs/apis/screen-reader)** +**[com.capacitorjs:screen-reader](https://capacitorjs.com/docs/apis/screen-reader)** The Screen Reader API provides access to TalkBack/VoiceOver/etc. and provides simple text-to-speech capabilities for visual accessibility. -**[com.capacitorjs.share](https://capacitorjs.com/docs/apis/share)** +**[com.capacitorjs:share](https://capacitorjs.com/docs/apis/share)** The Share API provides methods for sharing content to any sharing-enabled apps that the user may have installed. -**[com.capacitorjs.splash-screen](https://capacitorjs.com/docs/apis/splash-screen)** +**[com.capacitorjs:splash-screen](https://capacitorjs.com/docs/apis/splash-screen)** The Splash Screen API provides methods for showing or hiding a Splash image. -**[com.capacitorjs.status-bar](https://capacitorjs.com/docs/apis/status-bar)** +**[com.capacitorjs:status-bar](https://capacitorjs.com/docs/apis/status-bar)** The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it. -**[com.capacitorjs.storage](https://capacitorjs.com/docs/apis/storage)** - -The Storage API provides a simple key/value persistent store for lightweight data. - -**[com.capacitorjs.text-zoom](https://capacitorjs.com/docs/apis/text-zoom)** +**[com.capacitorjs:text-zoom](https://capacitorjs.com/docs/apis/text-zoom)** The Text Zoom API provides the ability to change Web View text size for visual accessibility. -**[com.capacitorjs.toast](https://capacitorjs.com/docs/apis/toast)** +**[com.capacitorjs:toast](https://capacitorjs.com/docs/apis/toast)** The Toast API provides a notification pop up for displaying important information to a user. Just like real toast! diff --git a/website/docs/for-ios/how-to/using-a-capacitor-plugin.md b/website/docs/for-ios/how-to/using-a-capacitor-plugin.md index dfceec9..2f9e4dc 100644 --- a/website/docs/for-ios/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-ios/how-to/using-a-capacitor-plugin.md @@ -6,7 +6,7 @@ sidebar_label: Use a Capacitor Plugin import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; -import { getPortalsVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util'; +import { getPortalsVersion, getCapacitorVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util'; How to Use Capacitor Plugins: Core & Others | Ionic @@ -29,7 +29,7 @@ In order to use a Capacitor Core Plugin, you need to install the plugin as a dep { `pod 'IonicPortals', '~> ${getPortalsVersionIos()}' -pod 'CapacitorStorage', '~> 1.2.0' +pod 'CapacitorPreferences', '~> ${getCapacitorVersion()}' `.trim() } @@ -82,7 +82,7 @@ If you want all plugins to be automatically registered, then leaving the default ### Published Plugins -In CocoaPods, the Capacitor plugins are prepended with `Capacitor`. For example, the `@capacitor/storage` plugin on npm is named `CapacitorStorage` on CocoaPods. The following Plugins are available in CocoaPods. +In CocoaPods, the Capacitor plugins are prepended with `Capacitor`. For example, the `@capacitor/preferences` plugin on npm is named `CapacitorPreferences` on CocoaPods. The following Plugins are available in CocoaPods. **[CapacitorActionSheet](https://capacitorjs.com/docs/apis/action-sheet)** @@ -94,7 +94,7 @@ The App API handles high level App state and events. For example, this API emits **[CapacitorAppLauncher](https://capacitorjs.com/docs/apis/app-launcher)** -The AppLauncher API allows to open other apps +The AppLauncher API allows the opening of other apps. **[CapacitorBrowser](https://capacitorjs.com/docs/apis/browser)** @@ -144,6 +144,10 @@ The Motion API tracks accelerometer and device orientation (compass heading, etc The Network API provides network and connectivity information. +**[CapacitorPreferences](https://capacitorjs.com/docs/apis/preferences)** + +The Preferences API provides a simple key/value persistent store for lightweight data. + **[CapacitorPushNotifications](https://capacitorjs.com/docs/apis/push-notifications)** The Push Notifications API provides access to native push notifications. @@ -164,10 +168,6 @@ The Splash Screen API provides methods for showing or hiding a Splash image. The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it. -**[CapacitorStorage](https://capacitorjs.com/docs/apis/storage)** - -The Storage API provides a simple key/value persistent store for lightweight data. - **[CapacitorTextZoom](https://capacitorjs.com/docs/apis/text-zoom)** The Text Zoom API provides the ability to change Web View text size for visual accessibility. From c07fb4fb631a97f557dd5ed27f0b57de5ea152ae Mon Sep 17 00:00:00 2001 From: Eric Horodyski Date: Thu, 27 Jun 2024 15:15:54 -0400 Subject: [PATCH 3/4] chore: fix spelling mistakes --- .../for-android/how-to/using-a-capacitor-plugin.md | 12 +++++++----- .../docs/for-ios/how-to/using-a-capacitor-plugin.md | 2 +- .../how-to/using-a-capacitor-plugin.md | 10 ++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/website/docs/for-android/how-to/using-a-capacitor-plugin.md b/website/docs/for-android/how-to/using-a-capacitor-plugin.md index 1de1719..81e2f60 100644 --- a/website/docs/for-android/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-android/how-to/using-a-capacitor-plugin.md @@ -84,7 +84,7 @@ The App API handles high level App state and events. For example, this API emits The AppLauncher API allows the opening of other apps. -**[com.capacitorj:.browser](https://capacitorjs.com/docs/apis/browser)** +**[com.capacitorjs:browser](https://capacitorjs.com/docs/apis/browser)** The Browser API provides the capability to open an in-app browser and subscribe to browser events. @@ -195,14 +195,16 @@ project(':capacitor-plugin-name').projectDir = new File('../../webapp/node_modul Then in your project module level `build.gradle` file, add the project to the dependencies. -```groovy + +{ +` dependencies { implementation project(':capacitor-plugin-name') - implementation 'io.ionic:portals:0.5.0' - + implementation 'io.ionic:portals:${getPortalsVersionAndroid()}' //... +}`.trim() } -``` + If successful, you should now see a section in the Android Studio project browser for your plugin, be able to browse its source code, and reference classes in the plugin within your native application source code. diff --git a/website/docs/for-ios/how-to/using-a-capacitor-plugin.md b/website/docs/for-ios/how-to/using-a-capacitor-plugin.md index 2f9e4dc..3f96e5a 100644 --- a/website/docs/for-ios/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-ios/how-to/using-a-capacitor-plugin.md @@ -88,7 +88,7 @@ In CocoaPods, the Capacitor plugins are prepended with `Capacitor`. For example, The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take. -**[CappacitorApp](https://capacitorjs.com/docs/apis/app)** +**[CapacitorApp](https://capacitorjs.com/docs/apis/app)** The App API handles high level App state and events. For example, this API emits events when the app enters and leaves the foreground, handles deeplinks, opens other apps, and manages persisted plugin state. diff --git a/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md b/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md index d6cde64..2abc560 100644 --- a/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md @@ -636,14 +636,16 @@ project(':capacitor-plugin-name').projectDir = new File('../../webapp/node_modul Then in your project module level `build.gradle` file, add the project to the dependencies. -```groovy + +{ +` dependencies { implementation project(':capacitor-plugin-name') - implementation 'io.ionic:portals:0.5.0' - + implementation 'io.ionic:portals:${getPortalsVersionAndroid()}' //... +}`.trim() } -``` + If successful, you should now see a section in the Android Studio project browser for your plugin, be able to browse its source code, and reference classes in the plugin within your native application source code. From b15c6e356ebded5c4b200092daf7a6e2d07eeb65 Mon Sep 17 00:00:00 2001 From: Eric Horodyski Date: Thu, 27 Jun 2024 16:05:42 -0400 Subject: [PATCH 4/4] docs: remove the "Register the Plugin" section for "Other Plugins" in the RN doc --- .../how-to/using-a-capacitor-plugin.md | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md b/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md index 2abc560..d5dfc83 100644 --- a/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md +++ b/website/docs/for-react-native/how-to/using-a-capacitor-plugin.md @@ -652,65 +652,3 @@ If successful, you should now see a section in the Android Studio project browse -#### Register the Plugin - - - - -Plugins are automatically registered on iOS. - - - - -Register the plugin with a portal to use it. - - - - -```kotlin -class MyApplication : Application() { - override fun onCreate(): Unit { - super.onCreate() - PortalManager.register("YOUR_PORTALS_KEY") - - val portalId = "MY_FIRST_PORTAL" - PortalManager.newPortal(portalId) - .addPlugin(MyCapacitorPlugin::class.java) - .create() - } -} -``` - - - - -```java -public class MyApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - PortalManager.register("YOUR_PORTALS_KEY"); - - String portalId = "MY_FIRST_PORTAL"; - PortalManager.newPortal(portalId) - .addPlugin(MyCapacitorPlugin.class) - .create(); - } -} -``` - - - - - -