apache / apache/cordova-plugin-camera
iOS 13 env() value being altered after opening the camera
- Dominant language
- Objective-C
- Stars
- 976
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
I have an app written with Ioinc v1, Cordova and AngularJS 1.5.3.
I am using this plugin to open the Gallery and Camera in my application.
I have an issue on iOS 13 and the iPhoneX suite.
When I open the gallery or the camera with this plugin, it alters the env(safe-area-inset-top) value. It goes from 0 to 44px. It's causing issues as it pushes my app down.
iPhoneX accommodations:
https://blog.phonegap.com/displaying-a-phonegap-app-correctly-on-the-iphone-x-c4a85664c493
css
```
body {
padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left); //iOS 11.2
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.bar-footer {
margin-bottom: constant(safe-area-inset-bottom);
margin-bottom: env(safe-area-inset-bottom);
}
```
html
` `
```
ionic info
Ionic:
ionic (Ionic CLI) : 4.10.3 (C:\Users\User\node_modules\ionic)
Ionic Framework : ionic1 1.3.5
@ionic/v1-toolkit : 1.0.22
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 8.1.0, browser 5.0.4, windows 4.4.3
Cordova Plugins : cordova-plugin-ionic-webview 4.1.3, (and 17 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\User\Documents\Android\sdk)
NodeJS : v10.21.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.4
OS : Windows 10
```
` `
See the padding-top value change after I visit the camera:


Contributor guide
Research direction
Reproduce the issue on iOS 13 and the iPhone X suite with cordova-plugin-camera 4.0.3, opening both the gallery and camera. Inspect the body padding and env(safe-area-inset-top) before and after returning to the app; done means the safe-area value is not incorrectly changed and the app layout no longer shifts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, ios, javascript, objective-c
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100