capacitor-community / privacy-screen

⚡️ Capacitor plugin that protects your app from displaying a screenshot in Recents screen/App Switcher.
MIT License
88 stars 23 forks source link

bug: When I change the screenOrientation in ios device with privacy screen enable the app crash #61

Closed juanpadel closed 1 year ago

juanpadel commented 1 year ago

Plugin version:

"@capacitor-community/privacy-screen": "^4.1.0",
"@capacitor/android": "^5.0.5",
"@capacitor/app": "5.0.3",
"@capacitor/core": "^5.0.5",
"@capacitor/haptics": "5.0.4",
"@capacitor/ios": "5.0.5",
"@capacitor/keyboard": "5.0.4",
"@capacitor/status-bar": "5.0.4",
"@fullcalendar/angular": "^6.0.3",
"@fullcalendar/core": "^6.0.3",
"@fullcalendar/daygrid": "^6.0.3",
"@fullcalendar/interaction": "^6.0.3",
"@fullcalendar/timegrid": "^6.0.3",
"@ionic/angular": "^7.0.0",

Platform(s):

IOS

Current behavior:

The app crash when I change the screen orientation in ios because in android I don't have the problem, i want to know if this is a bug or the ios device can not change screen orientation with privacy screen enable

Expected behavior:

the app does not crash when I change orientation in ios

Steps to reproduce:

When I change the screen orientation the app crash in ios

Related code:

constructor( private router: Router, private route: ActivatedRoute, private platform: Platform ){ this.platform.ready().then(() => { if (this.platform.is('android')) { this.enablePrivacyScreen(); } else if (this.platform.is('ios')) { this.enablePrivacyScreen(); } else { //fallback to browser APIs or console.log('The platform is not supported'); } }) }

public async enablePrivacyScreen(): Promise { await PrivacyScreen.enable(); }

public async disablePrivacyScreen(): Promise { await PrivacyScreen.disable(); }

insert short code snippets here

Other information:

Capacitor doctor:

insert the output from `npx cap doctor` here
robingenz commented 1 year ago

I could not reproduce the issue with the demo app.

RPReplay_Final1687783876

TripShade commented 1 year ago

62 Fixes this for me.