{"action":"opened","issue":{"url":"https://api.github.com/repos/ionic-team/capacitor/issues/539","repository_url":"https://api.github.com/repos/ionic-team/capacitor","labels_url":"https://api.github.com/repos/ionic-team/capacitor/issues/539/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/capacitor/issues/539/comments","events_url":"https://api.github.com/repos/ionic-team/capacitor/issues/539/events","html_url":"https://github.com/ionic-team/capacitor/issues/539","id":322708798,"number":539,"title":"Capture Image(PWA)","user":{"login":"abhibly","id":15784815,"avatar_url":"https://avatars0.githubusercontent.com/u/15784815?v=4","gravatar_id":"","url":"https://api.github.com/users/abhibly","html_url":"https://github.com/abhibly","followers_url":"https://api.github.com/users/abhibly/followers","following_url":"https://api.github.com/users/abhibly/following{/other_user}","gists_url":"https://api.github.com/users/abhibly/gists{/gist_id}","starred_url":"https://api.github.com/users/abhibly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhibly/subscriptions","organizations_url":"https://api.github.com/users/abhibly/orgs","repos_url":"https://api.github.com/users/abhibly/repos","events_url":"https://api.github.com/users/abhibly/events{/privacy}","received_events_url":"https://api.github.com/users/abhibly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-14T07:57:03Z","updated_at":"2018-05-14T07:57:03Z","closed_at":null,"author_association":"NONE","body":"Hello I am building a PWA , so user will be able to my app add to his home screen(we dont have plans to use playstore ,no apk generation). And my app should have access to mobile camera. Basically user of my app should be able to take picture and upload the picture to my server just taken.\r\nI have Implememted the following steps to capture my pwa\r\nCreated a new app by the below command( Didn't integrate my new app with Cordova)\r\n`ionic start my-app`\r\n`cd my-app`\r\n`npm install --save @capacitor/core @capacitor/cli`\r\n`npx cap init`\r\n`ionic serve`\r\n\r\nBelow is the code used to capture image\r\n`\r\n              import { Component, NgZone } from '@angular/core';\r\n              import { NavController } from 'ionic-angular';\r\n              import { Plugins, CameraResultType } from '@capacitor/core';\r\n\r\n\r\n              import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\n              import { IonicPage, NavParams } from 'ionic-angular';\r\n              import { CameraSource } from '@capacitor/core';\r\n\r\n\r\n           @Component({\r\n                 selector: 'page-home',\r\n               templateUrl: 'home.html'\r\n            })\r\n            export class HomePage {\r\n\r\n           image: SafeResourceUrl;\r\n\r\n          constructor(public navCtrl: NavController, public navParams: NavParams, private zone: NgZone, \r\n             private sanitizer: DomSanitizer) {\r\n            }\r\n\r\n       async takePicture() {\r\n          const { Camera } = Plugins;\r\n\r\n         const image = await Camera.getPhoto({\r\n            quality: 90,\r\n            allowEditing: true,\r\n            resultType: CameraResultType.Base64,\r\n             source: CameraSource.Photos\r\n         });\r\n\r\n           this.image = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.base64Data));\r\n\r\n            console.log(this.image);\r\n          }\r\n\r\n      }\r\n`\r\n\r\nAs mentioned in this issue https://github.com/ionic-team/capacitor/issues/358 i have included the below line in my index.html\r\n`<script src='https://unpkg.com/@ionic/pwa-elements@0.0.11/dist/ionicpwaelements.js'></script>`\r\n\r\n\r\nIf i run my app using ionic serve and using the system IP address i access the app in my mobile browser. when i click on button to capture the image it just shows a black screen \r\n\r\nIs there anything i am doing wrong.Can anyone please help me to capture image from pwa\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"abhibly"}}