-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more community guides to APIs and comm guides pages
- Loading branch information
Showing
10 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"title":"Camera","description":"Camera API","url":"/docs/apis/camera","contributors":["mlynch","jcesarmobile"],"lastUpdated":"2018-06-01T00:00:00.000Z","headings":[{"id":"camera","level":1,"text":"Camera"},{"id":"ios-notes","level":2,"text":"iOS Notes"},{"id":"android-notes","level":2,"text":"Android Notes"},{"id":"example","level":2,"text":"Example"},{"id":"angular-example","level":2,"text":"Angular example"},{"id":"api","level":2,"text":"API"}],"srcPath":"./docs-md/apis/camera/index.md","content":"<p><plugin-platforms platforms=\"pwa,ios,android,electron\"></plugin-platforms></p>\n\n<h1 id=\"camera\">\n \n Camera\n \n</h1>\n<p>The Camera API allows a user to pick a photo from their photo album or take a picture. On iOS, this uses <code>UIImagePickerController</code>, and on Android this\nAPI sends an intent which will be handled by the core Camera app by default.</p>\n<p><plugin-api index=\"true\" name=\"camera\"></plugin-api></p>\n\n<h2 id=\"ios-notes\">\n <a class=\"heading-link\" href=\"#ios-notes\"><ion-icon name=\"ios-link\"></ion-icon>\n iOS Notes\n </a>\n</h2>\n<p>iOS requires the following usage description be added and filled out for your app in <code>Info.plist</code>:</p>\n<p>Name: <code>Privacy - Camera Usage Description</code><br>Key: <code>NSCameraUsageDescription</code></p>\n<p>Read about <stencil-route-link url=/docs/ios/configuration>Setting iOS Permissions</stencil-route-link> in the <a href=\"../../ios/\">iOS Guide</a> for more information on setting iOS permissions in Xcode</p>\n\n<h2 id=\"android-notes\">\n <a class=\"heading-link\" href=\"#android-notes\"><ion-icon name=\"ios-link\"></ion-icon>\n Android Notes\n </a>\n</h2>\n<p>This API requires the following permissions be added to your <code>AndroidManifest.xml</code>:</p>\n\n <highlight-code-line >\n <pre class=\"language-xml\"><code class=\"language-xml\"><uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /></code></pre>\n </highlight-code-line>\n <p>The storage permissions are for reading/saving photo files.</p>\n<p>Read about <stencil-route-link url=/docs/android/configuration>Setting Android Permissions</stencil-route-link> in the <a href=\"../../android/\">Android Guide</a> for more information on setting Android permissions.</p>\n<p>Additionally, because the Camera API launches a separate Activity to handle taking the photo, you should listen for <code>appRestoredResult</code> in the <code>App</code> plugin\nto handle any camera data that was sent in the case your app was terminated by the operating system while the Activity was running.</p>\n\n<h2 id=\"example\">\n <a class=\"heading-link\" href=\"#example\"><ion-icon name=\"ios-link\"></ion-icon>\n Example\n </a>\n</h2>\n\n <highlight-code-line >\n <pre class=\"language-typescript\"><code class=\"language-typescript\"><span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> Plugins<span class=\"token punctuation\">,</span> CameraResultType <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">'@capacitor/core'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">const</span> <span class=\"token punctuation\">{</span> Camera <span class=\"token punctuation\">}</span> <span class=\"token operator\">=</span> Plugins<span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">async</span> <span class=\"token function\">takePicture</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n <span class=\"token keyword\">const</span> image <span class=\"token operator\">=</span> <span class=\"token keyword\">await</span> Camera<span class=\"token punctuation\">.</span><span class=\"token function\">getPhoto</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n quality<span class=\"token punctuation\">:</span> <span class=\"token number\">90</span><span class=\"token punctuation\">,</span>\n allowEditing<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n resultType<span class=\"token punctuation\">:</span> CameraResultType<span class=\"token punctuation\">.</span>Uri\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n <span class=\"token comment\">// image.webPath will contain a path that can be set as an image src. </span>\n <span class=\"token comment\">// You can access the original file using image.path, which can be </span>\n <span class=\"token comment\">// passed to the Filesystem API to read the raw data of the image, </span>\n <span class=\"token comment\">// if desired (or pass resultType: CameraResultType.Base64 to getPhoto)</span>\n <span class=\"token keyword\">var</span> imageUrl <span class=\"token operator\">=</span> image<span class=\"token punctuation\">.</span>webPath<span class=\"token punctuation\">;</span>\n <span class=\"token comment\">// Can be set to the src of an image now</span>\n imageElement<span class=\"token punctuation\">.</span>src <span class=\"token operator\">=</span> imageUrl<span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre>\n </highlight-code-line>\n \n<h2 id=\"angular-example\">\n <a class=\"heading-link\" href=\"#angular-example\"><ion-icon name=\"ios-link\"></ion-icon>\n Angular example\n </a>\n</h2>\n<p><stencil-route-link url=/docs/guides/ionic-framework-app>Follow this guide</stencil-route-link> to implement the Camera API in an Ionic Angular app.</p>\n\n<h2 id=\"api\">\n <a class=\"heading-link\" href=\"#api\"><ion-icon name=\"ios-link\"></ion-icon>\n API\n </a>\n</h2>\n<p><plugin-api name=\"camera\"></plugin-api></p>\n"} | ||
{"title":"Camera","description":"Camera API","url":"/docs/apis/camera","contributors":["mlynch","jcesarmobile"],"headings":[{"id":"camera","level":1,"text":"Camera"},{"id":"ios-notes","level":2,"text":"iOS Notes"},{"id":"android-notes","level":2,"text":"Android Notes"},{"id":"example","level":2,"text":"Example"},{"id":"example-guides","level":2,"text":"Example Guides"},{"id":"api","level":2,"text":"API"}],"srcPath":"./docs-md/apis/camera/index.md","content":"<p><plugin-platforms platforms=\"pwa,ios,android,electron\"></plugin-platforms></p>\n\n<h1 id=\"camera\">\n \n Camera\n \n</h1>\n<p>The Camera API allows a user to pick a photo from their photo album or take a picture. On iOS, this uses <code>UIImagePickerController</code>, and on Android this\nAPI sends an intent which will be handled by the core Camera app by default.</p>\n<p><plugin-api index=\"true\" name=\"camera\"></plugin-api></p>\n\n<h2 id=\"ios-notes\">\n <a class=\"heading-link\" href=\"#ios-notes\"><ion-icon name=\"ios-link\"></ion-icon>\n iOS Notes\n </a>\n</h2>\n<p>iOS requires the following usage description be added and filled out for your app in <code>Info.plist</code>:</p>\n<p>Name: <code>Privacy - Camera Usage Description</code><br>Key: <code>NSCameraUsageDescription</code></p>\n<p>Read about <stencil-route-link url=/docs/ios/configuration>Setting iOS Permissions</stencil-route-link> in the <a href=\"../../ios/\">iOS Guide</a> for more information on setting iOS permissions in Xcode</p>\n\n<h2 id=\"android-notes\">\n <a class=\"heading-link\" href=\"#android-notes\"><ion-icon name=\"ios-link\"></ion-icon>\n Android Notes\n </a>\n</h2>\n<p>This API requires the following permissions be added to your <code>AndroidManifest.xml</code>:</p>\n\n <highlight-code-line >\n <pre class=\"language-xml\"><code class=\"language-xml\"><uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /></code></pre>\n </highlight-code-line>\n <p>The storage permissions are for reading/saving photo files.</p>\n<p>Read about <stencil-route-link url=/docs/android/configuration>Setting Android Permissions</stencil-route-link> in the <a href=\"../../android/\">Android Guide</a> for more information on setting Android permissions.</p>\n<p>Additionally, because the Camera API launches a separate Activity to handle taking the photo, you should listen for <code>appRestoredResult</code> in the <code>App</code> plugin\nto handle any camera data that was sent in the case your app was terminated by the operating system while the Activity was running.</p>\n\n<h2 id=\"example\">\n <a class=\"heading-link\" href=\"#example\"><ion-icon name=\"ios-link\"></ion-icon>\n Example\n </a>\n</h2>\n\n <highlight-code-line >\n <pre class=\"language-typescript\"><code class=\"language-typescript\"><span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> Plugins<span class=\"token punctuation\">,</span> CameraResultType <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">'@capacitor/core'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">const</span> <span class=\"token punctuation\">{</span> Camera <span class=\"token punctuation\">}</span> <span class=\"token operator\">=</span> Plugins<span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">async</span> <span class=\"token function\">takePicture</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n <span class=\"token keyword\">const</span> image <span class=\"token operator\">=</span> <span class=\"token keyword\">await</span> Camera<span class=\"token punctuation\">.</span><span class=\"token function\">getPhoto</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n quality<span class=\"token punctuation\">:</span> <span class=\"token number\">90</span><span class=\"token punctuation\">,</span>\n allowEditing<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n resultType<span class=\"token punctuation\">:</span> CameraResultType<span class=\"token punctuation\">.</span>Uri\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n <span class=\"token comment\">// image.webPath will contain a path that can be set as an image src. </span>\n <span class=\"token comment\">// You can access the original file using image.path, which can be </span>\n <span class=\"token comment\">// passed to the Filesystem API to read the raw data of the image, </span>\n <span class=\"token comment\">// if desired (or pass resultType: CameraResultType.Base64 to getPhoto)</span>\n <span class=\"token keyword\">var</span> imageUrl <span class=\"token operator\">=</span> image<span class=\"token punctuation\">.</span>webPath<span class=\"token punctuation\">;</span>\n <span class=\"token comment\">// Can be set to the src of an image now</span>\n imageElement<span class=\"token punctuation\">.</span>src <span class=\"token operator\">=</span> imageUrl<span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre>\n </highlight-code-line>\n \n<h2 id=\"example-guides\">\n <a class=\"heading-link\" href=\"#example-guides\"><ion-icon name=\"ios-link\"></ion-icon>\n Example Guides\n </a>\n</h2>\n<p><a href=\"/docs/guides/ionic-framework-app\">Building an Ionic Framework Camera App</a></p>\n\n<h2 id=\"api\">\n <a class=\"heading-link\" href=\"#api\"><ion-icon name=\"ios-link\"></ion-icon>\n API\n </a>\n</h2>\n<p><plugin-api name=\"camera\"></plugin-api></p>\n"} |
Oops, something went wrong.