Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have not choose the images, I just click the button , it's already return 2 unknown images to me. #233

Open
ghost opened this issue Nov 20, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 20, 2020

today i got a problem . I click the imagepicker button , i have not choose yet, It has entered the callback function and selected two unknown images for me . ( I'm going to make it pop up an alert when I click on the imagepicker button to show how many images there are, and it's going to say the results.length is 2. not choose yet !!!) .

this happens only the first time I run the app and the first time I go to this page, when I went back to the previous page and re-entered , It worked again.

I haven't touched the code since last time . do you know what's wrong with it ??? thank you soso much !!

@chenjr15
Copy link

I don't know the exact reason, but it may be the permission issue.
Try to request the permission first to avoid this.

Ionic example

export class MyPage implements OnInit {

constructor( private imagePicker: ImagePicker ) {  }

 ngOnInit() {
    // try to request permission on init
    this.imagePicker.requestReadPermission()
  }

  onPick(){
   // do pick image
  }

}

read more on readme.md

https://github.com/Telerik-Verified-Plugins/ImagePicker#android-6-m-permissions

@ghost
Copy link
Author

ghost commented Nov 24, 2020

@chenjr15 thanks a lot !!!! it worked !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant