Skip to content

Camera is not getting dismissed on navigation change in iOS #2302

Open
@anusha-kaparapu

Description

@anusha-kaparapu

Bug Report

Plugin(s)

@capacitor/camera

Capacitor Version

"@capacitor/app": "^6.0.0",
"@capacitor/camera": "^6.0.0"

PASTE OUTPUT HERE

Platform(s)

iOS

Current Behavior

The camera is opened using below method.
Camera.getPhoto({
quality: 50,
allowEditing: false,
resultType: CameraResultType.Base64,
source: CameraSource.Camera
});
We have a push notification functionality implemented in our application. At this moment when user taps on PN while is camera screen, the navigation change is not getting detected by camera plugin in iOS hence the camera still displaying.

Expected Behavior

The camera plugin has to detect navigation changes and redirect user to respective screen instead of not dismissing the camera. (Similar to Android behaviour)

Code Reproduction

Camera opening logic:
const image = await Camera.getPhoto({
quality: 50,
allowEditing: false,
resultType: CameraResultType.Base64,
source: CameraSource.Camera
});

Navigation logic happening on tap of Push notification:

import { Router } from '@angular/router';

this.router.navigate(['tabs/trip-list/trip-details', headerTripId]);

Other Technical Details

Additional Context

However its working in android, only problem with iOS. Is this a limitation of the plugin behaviour ? or can be solved programatically ?
If yes, please provide code snippet of the solution.

This is a priority for us, as we are moving to production. Please reply ASAP.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions