GithubHelp home page GithubHelp logo

ionic-team / capacitor-docs Goto Github PK

View Code? Open in Web Editor NEW
20.0 8.0 177.0 171.37 MB

Home Page: https://capacitorjs.com/docs

License: Apache License 2.0

JavaScript 21.58% TypeScript 28.19% CSS 6.02% SCSS 11.30% MDX 32.90%

capacitor-docs's Introduction

Capacitor Docs

The official Capacitor documentation, built with Docusaurus. Based on the Ionic Docs


Getting Started

Install the latest versions of Node and npm.

Once npm is installed, run

npm install
npm run build
npm run serve

The site will launch in development mode.


Contributing

Thanks for your interest in contributing! Read up on our guidelines for contributing.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


capacitor-docs's People

Contributors

adamdbradley avatar brandyscarney avatar bryplano avatar camwiegert avatar carlpoole avatar dallastjames avatar dependabot-preview[bot] avatar dependabot[bot] avatar dotnetkow avatar dtarnawsky avatar elylucas avatar eric-horodyski avatar giocalitri avatar imhoffd avatar ionitron avatar jaredcbaum avatar jcesarmobile avatar johnwheeler-prod avatar kensodemann avatar kevinports avatar liamdebeasi avatar ltm avatar manucorporat avatar mhartington avatar mlynch avatar nphyatt avatar perrygovier avatar rtpharry avatar sean-perkins avatar thomasvidas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

capacitor-docs's Issues

WebView information is out of date and inacurate

Docs say that on Android 7+ chrome is used, but on Android 10+ Google switched to the System WebView again.

Also saying "chrome is used" is inaccurate as it's not really Chrome, but a WebView provided by Google chrome and that has caused confusion in some users, so we should specify.

Recommended way to use private repo

to @capacitor team, I'd like to know what do you suggest if I am using private repo?
Our team is planning to use capacitor but I we have few issues facing with gradle dependencies.

Appreciate if you can give some suggestions. Thank you

Content missing for the section "Why am I getting CocoaPods errors on my Apple Silicon Device?​" in Getting Started

URL
The URL at which the content is missing or inaccurate

https://capacitorjs.com/docs/getting-started/faqs#why-am-i-getting-cocoapods-errors-on-my-apple-silicon-device

What is missing or inaccurate about the content on this page?

There is no content displaying underneath the heading "Why am I getting CocoaPods errors on my Apple Silicon Device" within the Getting Started guide. I am expecting a section answering this question and for it to not be blank.

We should use capacitor-assets, not cordova-res, no?

URL
The URL at which the content is missing or inaccurate
https://capacitorjs.com/docs/guides/splash-screens-and-icons

What is missing or inaccurate about the content on this page?
I was having trouble getting the Android app icon to update properly in an ionic-capacitor app and was following the instructions above.
Then I found these issues:

Which leads me to believe that this source file for the above doc page is outdated and should actually instruct the user to use capacitor-assets rather than cordova-res, correct?

If I'm correct in this assessment, I'll make the needed PR.

Error with the configuration of the plugin Motion

Describe the bug
Hello,
An error appears when I try to set the plugin @capacitor/motion.

To reproduce
Steps to reproduce the behavior:

  1. Install an blank ionic project + add www and ìos`
  2. Install the plugin using these commands: npm install @capacitor/motion npx cap sync
  3. Open the file app.component.ts
  4. Add the imports on the top of the file
  5. In the function ngOnInit(), add the method to request the permission `await DeviceMotionEvent.requestPermission();``
  6. See the error (red underline below requestPermission): Property 'requestPermission' does not exist on type '{ new (type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; prototype: DeviceMotionEvent; }'

Screenshot
render

Expected behavior
Don't have any error when I try to setup the plugin following the instructions.

Browser and OS (please complete the following information)

  • OS: MacOs Monterey 12.6
  • Browser: Chrome
  • Version: 105.0.5195.125

Thank you for your help,
Loïc

feat: improve doc with viewcontroller

Hi,

I'm struggling to create a plugin with ios. Despite the documentation https://capacitorjs.com/docs/plugins/ios, I cannot run a plugin that present a new viewController. I tried with storyboard (inside the plugin), with xib files, but I cannot reach the goal.

I opened a stackoverflow https://stackoverflow.com/questions/64693531/new-view-in-ios-with-capacitor-plugin

I think it would be great to improve the doc, with an example with a xib and storboard file. Because not all capacitor developpers know very well the ios native development (this is my case)

Or if usage of storyboard or xib is not possible in a plugin, then mention it in documentation

capacitor run androd --l build error

Describe the bug
No problems building the app in Android studio, build error shows up running --livereload in VScode

To reproduce
Steps to reproduce the behavior:

  1. Download openJDK 8 and configure JAVA_HOME
  2. Install VScode
  3. Install Android Studio
  4. Install Node.js and NPM
  5. Install ionic cli via terminal (npm i -g @ionic/cli)
  6. "ionic start myApp blank --type react" via terminal
  7. install capacitor via terminal (npm i @capacitor/core -> npm i -D @capacitor/cli)
  8. "code myApp" to open VScode project via terminal
  9. "ionic build" in VScode terminal
  10. "ionic cap add android" in VScode terminal
  11. "cap open android" -> it opens android studio and it build successfully
  12. "ionic cap run android --l" command generate the error below

Expected behavior
I expect to build and run the app also via VScode using "ionic cap run android --l" command

Screenshots
VScode terminal output:
image

Android studio build successfully:
image

Android studio configs:
image
image

Browser and OS (please complete the following information)

  • OS: WINDOWS
  • Version: 10

Additional context
Thank you for any help, I'm looking for a solution for days trying to change JDK (1.7 and 1.8) and gradle versions (7.6.1 and 8.0) but the result is always the same.

P.S. I was following this video course, the steps are the same except the installation of the software (not shown in the video) https://www.youtube.com/watch?v=K7ghUiXLef8

Choose the name of the starting HTML file in webDir

Most apps I build with Capacitor have a landing page + the app itself.

When I ship the app, I wish it would directly load the app.html or dashboard.html instead of the index.html (the landing page, usually)

For now, I do some routing in useEffect as a fix. But the user sees the landing page for a few ms.

It would be dope to be able to choose which HTML file the app opens.

Thanks!

The `Update kotlin_version` title in Updating plugins to 5.0 page is shown in markdown format

Describe the bug
The Update kotlin_version title in Updating plugins to 5.0 page is shown in markdown format.

To reproduce
Steps to reproduce the behavior:

  1. Go to Updating plugins to 5.0 page
  2. Scroll down to the bottom of the page
  3. See ### Update kotlin_version title is shown in markdown format

Expected behavior
The ### Update kotlin_version should be shown as a HTML title (should be same as the Update to Java 17 title above).

Screenshots
Screenshot 2023-05-20 at 5 04 43 PM

Browser and OS (please complete the following information)

  • OS: macOS
  • Browser: Firefox
  • Version: 113.0.1

Additional context
Somehow, only this title is not being converted to HTML and is shown in markdown format.

[v3] npx cap doctor command is not mentioned anymore

Hello

In the workflow section of the v2 doc, the npx cap doctor command was briefly presented :
https://github.com/ionic-team/capacitor-site/blob/main/pages/docs/v2/basics/workflow.md

This is not the case anymore in the v3 version of the same document:
https://github.com/ionic-team/capacitor-site/blob/main/pages/docs/v3/basics/workflow.md

Does it mean that the doctor command is now deprecated? Or should we document back this command in v3 docs?

Thanks

[Bug]: locally "Custom Native iOS Code" not working (Capacitor 6)

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 5.7.1
@capacitor/core: 5.7.1
@capacitor/android: 5.7.1
@capacitor/ios: 5.7.1

Installed Dependencies:

@capacitor/cli: 6.0.0-rc.0
@capacitor/core: 6.0.0-rc.0
@capacitor/android: 6.0.0-rc.0
@capacitor/ios: 6.0.0-rc.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Other API Details

npm 10.2.4
node v20.11.1
pod 1.14.3

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

I was trying Capacitor 6 today and just discovered that the local Echo plugin from the tutorial is not working (https://capacitorjs.com/docs/ios/custom-code). If I rollback to Capacitor 5.7.1 it works as usual.

Note: I'm using it directly through window.Capacitor.Plugins.Echo (which is now undefined).

Note 2: Another plugin installed and created with https://github.com/ionic-team/create-capacitor-plugin works fine.

Note 3: On Android is working well.

Expected Behavior

Plugin invocation should work as described in the docs.

Project Reproduction

N/A

Additional Information

No response

'Deep Links' doc may need to be updated for new Apple deeplinks API?

URL
https://capacitorjs.com/docs/guides/deep-links#create-site-association-file

What is missing or inaccurate about the content on this page?
First, thank you for Capacitor and for great docs! I make this suggestion uncertainly, so please accept in that spirit.

In the apple site association file, the doc uses the syntax for details of associating to each appID a paths property which contains URL's. And, I can find this syntax in an archived document from the Apple Developer Library.

Ex.

{
  "applinks": {
    "details": [
      {
        "appID": "TEAMID.BUNDLEID",
        "paths": ["*"]
      }
  ]

But in what seems to be the latest and greatest docs from Apple, they use a whole different syntax for details, which associates components instead of paths. Components are pattern matchers that seem to logically serve as an alternate to a simple path, but more flexibly and powerfully.

Ex.

{
  "applinks": {
      "details": [
           {
             "appIDs": [ "ABCDE12345.com.example.app", "ABCDE12345.com.example.app2" ],
             "components": [
               {
                  "#": "no_universal_links",
                  "exclude": true,
                  "comment": "Matches any URL with a fragment that equals no_universal_links and instructs the system not to open it as a universal link."
               }
            ]

Source(s):

In all of those documents, I see the component syntax consistently repeated, and no evidence that a paths syntax is operative, at least not in recent versions of iOS.

Again, I am totally new to this topic, and am learning it by working through your excellent guide, so it's entirely possible I'm missing something. But... when I use the paths syntax with iOS 14... I can't get it to work. So, I checked the Apple docs, and found what seems like a mis-match in the API... Please share feedback about whether this is a valid point or noob confusion. Thanks!

Deep links: incorrect React setup documentation

URL
Deep links - React docs

What is missing or inaccurate about the content on this page?
The React docs state that the association files should be hosted under the public folder (domain.com/public/.well-known). But when done so, the online validators and the operating systems don't pick up the files.
Moving the files to the root (domain.com/.well-known) ensures the files are properly read and only then the deep links start working (verified both on Android and iOS).

Online validators used:

P.S.: A big thank you to the entire Ionic and Capacitor team for making a complex topic like Deep links so easy to understand and implement!

npx cap build docu is incomplete

URL
https://capacitorjs.com/docs/cli/commands/build
OR
https://github.com/ionic-team/capacitor-docs/blob/main/docs/cli/commands/build.md

What is missing or inaccurate about the content on this page?

Hi,
I guess there is a missing documentation regarding the creation of a Android 11+ compatible version of an apk. I would like to create a Android apk file which is correctly signed. This can be done with using the apksigner. So i used this command:
npx cap build android --keystorepath keystore.jks --keystorepass keystorepass --keystorealias keystorealias --keystorealiaspass keystorealiaspass --androidreleasetype APK
It will create an apk which can not be installed on Android 11+ because it uses the jarsigner as default instead of the apksigner. Regarding a PR in the capacitor repo here: ionic-team/capacitor#6442 @markemer has mentioned in this comment ionic-team/capacitor#6442 (comment) that one has to use --signing-type apksigner in order to create an android 11+ compatible version.

But this is not documented and it would be helpful to clarify this.

Missing Crucial Information To Send JSON Data With CapacitorHttp

URL
Capacitor Official Plugins HTTP

What is missing or inaccurate about the content on this page?
I only found the issue at Android platform. The API server does not receive JSON data if you try to request it without explicity send header Content-Type application/json.

I have read the Java base code and it actually skips the process of writing data if you try to request data without Content-Type header.

If you want to send data JSON with Android platform, you need to add header Content-Type with application/json like this.

const ret = await CapacitorHttp.post({
    ...
    data: {
        message: 'Hello World!'
    },
    headers: {
        "Content-Type": "application/json"
    },
    ...
});

For other type of data, if I had time, I would try one by one.

Capacitor plugin import format outdated

I just realised that in some parts of capacitor 5 documentation there are outdated info
Eg importing plugins like status bar

Instead of import {Camera} from "@capacitor/core"

Its still
import {Camera} from "@capacitor/camera"
Advice if thats correct

It is available to add my own template (community)?

Is your feature request related to a problem? Please describe.
I want to share with the community a template I developed myself.

Describe the solution you'd like
Add a section Community Templates/Recipes

Describe alternatives you've considered

Additional context
Page - Recipes

docs: provide information how to build a partly native plugin

Bachground:
There are some things within the SDKs of Android and iOS and also the capabilities of the Webviews which make it necessary to implement a plugin for one platform und use the web version for the other.

e.g. iOS has a great PDFKit SDK and and the same time a bad pdf implementation in the Webview (yes, pdf.js is not very great as well, some edge cases are not working at all and the performance is bad)
Android is good enough with the build in viewer.

Propose:
Document how to create such plugins.
You have to include the web part in the index.ts

const CustomPlugin = registerPlugin< CustomPlugin >('Custom', {
  android: () => import('./web').then(m => new m.CustomWeb()),
  web: () => import('./web').then(m => new m.CustomWeb()),
});

And in this case remove android from the capacitor property of the package.json

Incorrect Method Types information

Method Types page contains incorrect information.

The Void Return section is incorrect, PluginMethod.RETURN_NONE returns nothing, not a promise.

method1(): Promise<void>; should be changed to method1():void; and the texts need to change accordingly to not say it returns a promise, and maybe add an example of returning a void promise.

Usage of deprecated `getConfigValue` method for iOS platform

URL
Configuration Values > Accessing Configuration Values

For iOS, use the getConfigValue() method:

if let style = getConfigValue("style") as? String {
  // Set the style
}

What is missing or inaccurate about the content on this page?
Docs encourage use of getConfigValue method for iOS platform, but it has been deprecated in Capacitor 4.0.0-beta.0 here: ionic-team/capacitor#5495

Documentation should be updated for v4, v5 and v6 to use getConfig() method, I'd say there doesn't have to be a distinction between iOS and Android platforms

For reference I found a commits with migration getConfigValue -> getConfig in

NSLocationAlwaysUsageDescription - Deprecated

https://capacitorjs.com/docs/apis/geolocation
The URL at which the content is missing or inaccurate

What is missing or inaccurate about the content on this page?
It is indicating to add NSLocationAlwaysUsageDescription (Privacy - Location Always Usage Description) to Info.plist but NSLocationAlwaysUsageDescription is deprecated since ios 11 as stated here https://developer.apple.com/documentation/bundleresources/information_property_list/nslocationalwaysusagedescription and at the same Apple page it is suggesting to use NSLocationAlwaysAndWhenInUseUsageDescription. The same suggestion is made at the related cordova location plugin NSLocationAlwaysUsageDescription describes the reason that the app is requesting access to the user's location at all times. Use this key if your app accesses location information in the background and you deploy to a target earlier than iOS 11. For iOS 11 and later, add both NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription to your app’s Info.plist file with the same message..

NSLocationAlwaysUsageDescription is deprecated since ios 11 and Capacitor minimum required iOS version is 13.

Am I missing something?

Thanks.

Docs don't show which params are optional

If the type has a ?, it's not displayed, so it's not possible to know which params are optional and which ones are mandatory.

Docs should show the ? or some text that specify which one is optional and which one is mandatory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.