Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   iOS Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7 (https://www.delphipraxis.net/205479-sample-cameracomponent-keine-berechtigung-delphi-10-4-1-ios13-7-a.html)

jayjay77 15. Sep 2020 09:16

Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
Hallo Zusammen,

vielleicht könnt Ihr mir helfen, im Netzt finde ich immer nur Infos zu Android Apps.


Ich habe das von Embarcadero mitgelieferte CameraComponent Demo erzeugt und auf das iPad übertragen.
C:\Users\Public\Documents\Embarcadero\Studio\21.0\ Samples\Object Pascal\Mobile Snippets\CameraComponent

Die App bekommt keine Berechtigung auf die Kamera zuzugreifen?

Delphi Meldung:
Im Projekt ...ist eine Exception der Klasse ECaptureDeviceException mit der Meldung " aufgetreten

iPad Meldung:
Fehler Keine Berechtigung zum Aufzeichnen von Video

ipad 13.7
Delphi 10.4.1 Pro
MacOS 10.15.6
PAServer 12.1.10.3

Die info.plist.TemplateiOS.xml Datei habe ich auch angepasst.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<%VersionInfoPListKeys%>
<%ExtraInfoPListKeys%>
 <key>NSCameraUsageDescription</key>
 <string>This app needs access to camera</string>
<%StoryboardInfoPListKey%>
</dict>
</plist>

hier die CameraComponent.info.plist Datei
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>CFBundleName</key>
   <string>CameraComponent</string>
   <key>CFBundleDevelopmentRegion</key>
   <string>en</string>
   <key>CFBundleDisplayName</key>
   <string>CameraComponent</string>
   <key>CFBundleIdentifier</key>
   <string>XXXXXXXXXXXX</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>7.1</string>
   <key>CFBundleVersion</key>
   <string>1.0.0</string>
   <key>CFBundleShortVersionString</key>
   <string>1.0.0</string>
   <key>CFBundlePackageType</key>
   <string>APPL</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>LSRequiresIPhoneOS</key>
   <true/>
   <key>CFBundleAllowMixedLocalizations</key>
   <true/>
   <key>CFBundleExecutable</key>
   <string>CameraComponent</string>
   <key>UIDeviceFamily</key>
   <array>
      <integer>1</integer>
      <integer>2</integer>
   </array>
   <key>NSLocationAlwaysUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>NSLocationWhenInUseUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>UIBackgroundModes</key>
   <array>
   </array>
   <key>NSContactsUsageDescription</key>
   <string>The reason for accessing the contacts</string>
   <key>NSPhotoLibraryUsageDescription</key>
   <string>The reason for accessing the photo library</string>
   <key>NSPhotoLibraryAddUsageDescription</key>
   <string>The reason for adding to the photo library</string>
   <key>NSCameraUsageDescription</key>
   <string>The reason for accessing the camera</string>
   <key>NSFaceIDUsageDescription</key>
   <string>The reason for accessing the face id</string>
   <key>NSMicrophoneUsageDescription</key>
   <string>The reason for accessing the microphone</string>
   <key>NSSiriUsageDescription</key>
   <string>The reason for accessing Siri</string>
   <key>ITSAppUsesNonExemptEncryption</key>
   <false/>
   <key>NSBluetoothAlwaysUsageDescription</key>
   <string>The reason for accessing bluetooth</string>
   <key>NSBluetoothPeripheralUsageDescription</key>
   <string>The reason for accessing bluetooth peripherals</string>
   <key>NSCalendarsUsageDescription</key>
   <string>The reason for accessing the calendar data</string>
   <key>NSRemindersUsageDescription</key>
   <string>The reason for accessing the reminders</string>
   <key>NSMotionUsageDescription</key>
   <string>The reason for accessing the accelerometer</string>
   <key>NSSpeechRecognitionUsageDescription</key>
   <string>The reason for requesting to send user data to Apple's speech recognition servers</string>

   <key>UISupportedInterfaceOrientations</key>
   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
   <key>UISupportedInterfaceOrientations~ipad</key>
   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
   <key>NSAppTransportSecurity</key>
   <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
   </dict>
   <key>UIRequiredDeviceCapabilities</key>
   <array>
      <string>arm64</string>
   </array>
   <key>CFBundleSupportedPlatforms</key>
   <array>
      <string>iPhoneOS</string>
   </array>
   <key>MinimumOSVersion</key>
   <string>11.0</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>XXX requires access to your photo library</string>
<key>NSCameraUsageDescription</key>
<string>XXX requires access to your phone&#11488;camera to scan QR tags</string>
   <key>UILaunchStoryboardName</key>
   <string>LaunchScreen</string>

</dict>
</plist>
Evtl könnt Ihr das original Demo auch mal mit 10.4.1 testen.
Mit Delphi 10.3.3 hat das alles noch funktioniert.

Danke und Grüße

Rollo62 15. Sep 2020 10:31

AW: Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
Ich habe jetzt kein 13.7 installiert, nur 13.6, ich hoffe da ist keine Änderung drin.

Am Besten löschst Du nochmal die
info.plist.TemplateiOS.xml
Entitlement.TemplateiOS.xml
Dateien, die legt sich Rx10.4.1 dann neu an.

Wenn Du vorher mit 10.3.3 darauf zugegriffen hattest sind dort womöglich die alten Daten drin (das geht dann natürlich nicht).
Das frisch installierte Sample bei mir hat keine Template-Dateien drin,
es sollte diese also immer erstmalig neu anlegen, das ist eine gute Idee.

Weiterhin muss man nicht im Template was ändern, sondern nur in der VersionInfo den
Key NSCameraUsageDescription anpassen "The app needs camera to take pictures".
Am Besten gleich unter "Alle Konfigurationen", damit DEBUG/RELEASE richtig stehen.

Bei mir lief das Demo CameraComponent.dproj damit korrekt durch, und fragte auch nach der Berechtigung.

jayjay77 15. Sep 2020 14:06

AW: Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
Liste der Anhänge anzeigen (Anzahl: 1)
es geht leider immer noch nicht.

wann kam bei dir die Nachfrage, beim Appstart oder beim klick auf Start in der App?

im Anhang mal die Version Info.

kannst du bitte mal deine CameraComponent.info.plist posten?

Hier meine:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\ Samples\Object Pascal\Mobile Snippets\CameraComponent\iOSDevice64\Debug\
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>CFBundleName</key>
   <string>CameraComponent</string>
   <key>CFBundleDevelopmentRegion</key>
   <string>en</string>
   <key>CFBundleDisplayName</key>
   <string>CameraComponent</string>
   <key>CFBundleIdentifier</key>
   <string>xxxxxxxxxx</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>7.1</string>
   <key>CFBundleVersion</key>
   <string>1.0.0</string>
   <key>CFBundleShortVersionString</key>
   <string>1.0.0</string>
   <key>CFBundlePackageType</key>
   <string>APPL</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>LSRequiresIPhoneOS</key>
   <true/>
   <key>CFBundleAllowMixedLocalizations</key>
   <true/>
   <key>CFBundleExecutable</key>
   <string>CameraComponent</string>
   <key>UIDeviceFamily</key>
   <array>
      <integer>1</integer>
      <integer>2</integer>
   </array>
   <key>NSLocationAlwaysUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>NSLocationWhenInUseUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>UIBackgroundModes</key>
   <array>
   </array>
   <key>NSContactsUsageDescription</key>
   <string>The reason for accessing the contacts</string>
   <key>NSPhotoLibraryUsageDescription</key>
   <true/>
   <key>NSPhotoLibraryAddUsageDescription</key>
   <string>The reason for adding to the photo library</string>
   <key>NSCameraUsageDescription</key>
   <true/>
   <key>NSFaceIDUsageDescription</key>
   <string>The reason for accessing the face id</string>
   <key>NSMicrophoneUsageDescription</key>
   <string>The reason for accessing the microphone</string>
   <key>NSSiriUsageDescription</key>
   <string>The reason for accessing Siri</string>
   <key>ITSAppUsesNonExemptEncryption</key>
   <false/>
   <key>NSBluetoothAlwaysUsageDescription</key>
   <string>The reason for accessing bluetooth</string>
   <key>NSBluetoothPeripheralUsageDescription</key>
   <string>The reason for accessing bluetooth peripherals</string>
   <key>NSCalendarsUsageDescription</key>
   <string>The reason for accessing the calendar data</string>
   <key>NSRemindersUsageDescription</key>
   <string>The reason for accessing the reminders</string>
   <key>NSMotionUsageDescription</key>
   <string>The reason for accessing the accelerometer</string>
   <key>NSSpeechRecognitionUsageDescription</key>
   <string>The reason for requesting to send user data to Apple's speech recognition servers</string>

   <key>UISupportedInterfaceOrientations</key>
   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
   <key>UISupportedInterfaceOrientations~ipad</key>
   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
   <key>NSAppTransportSecurity</key>
   <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
   </dict>
   <key>UIRequiredDeviceCapabilities</key>
   <array>
      <string>arm64</string>
   </array>
   <key>CFBundleSupportedPlatforms</key>
   <array>
      <string>iPhoneOS</string>
   </array>
   <key>MinimumOSVersion</key>
   <string>11.0</string>

   <key>UILaunchStoryboardName</key>
   <string>LaunchScreen</string>

</dict>
</plist>

Rollo62 15. Sep 2020 14:51

AW: Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
Ich glaube die Abfrage kam beim Drücken auf Start, weiss nicht mehr genau.

Das Template:
Zitat:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<%VersionInfoPListKeys%>
<%ExtraInfoPListKeys%>
<%StoryboardInfoPListKey%>
</dict>
</plist>
die plist
Delphi-Quellcode:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>CFBundleName</key>
   <string>CameraComponent</string>
   <key>CFBundleDevelopmentRegion</key>
   <string>en</string>
   <key>CFBundleDisplayName</key>
   <string>CameraComponent</string>
   <key>CFBundleIdentifier</key>
   <string>com.Xyz.CameraComponent</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>7.1</string>
   <key>CFBundleVersion</key>
   <string>1.0.0</string>
   <key>CFBundleShortVersionString</key>
   <string>1.0.0</string>
   <key>CFBundlePackageType</key>
   <string>APPL</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>LSRequiresIPhoneOS</key>
   <true/>
   <key>CFBundleAllowMixedLocalizations</key>
   <true/>
   <key>CFBundleExecutable</key>
   <string>CameraComponent</string>
   <key>UIDeviceFamily</key>
   <array>
      <integer>1</integer>
      <integer>2</integer>
   </array>
   <key>NSLocationAlwaysUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>NSLocationWhenInUseUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
   <string>The reason for accessing the location information of the user</string>
   <key>UIBackgroundModes</key>
   <array>
   </array>
   <key>NSContactsUsageDescription</key>
   <string>The reason for accessing the contacts</string>
   <key>NSPhotoLibraryUsageDescription</key>
   <string>The reason for accessing the photo library</string>
   <key>NSPhotoLibraryAddUsageDescription</key>
   <string>The reason for adding to the photo library</string>
   <key>NSCameraUsageDescription</key>
   <string>The app needs camera to take pictures</string>
   <key>NSFaceIDUsageDescription</key>
   <string>The reason for accessing the face id</string>
   <key>NSMicrophoneUsageDescription</key>
   <string>The reason for accessing the microphone</string>
   <key>NSSiriUsageDescription</key>
   <string>The reason for accessing Siri</string>
   <key>ITSAppUsesNonExemptEncryption</key>
   <false/>
   <key>NSBluetoothAlwaysUsageDescription</key>
   <string>The reason for accessing bluetooth</string>
   <key>NSBluetoothPeripheralUsageDescription</key>
   <string>The reason for accessing bluetooth peripherals</string>
   <key>NSCalendarsUsageDescription</key>
   <string>The reason for accessing the calendar data</string>
   <key>NSRemindersUsageDescription</key>
   <string>The reason for accessing the reminders</string>
   <key>NSMotionUsageDescription</key>
   <string>The reason for accessing the accelerometer</string>
   <key>NSSpeechRecognitionUsageDescription</key>
   <string>The reason for requesting to send user data to Apple's speech recognition servers</string>

   <key>UISupportedInterfaceOrientations</key>
   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
   <key>UISupportedInterfaceOrientations~ipad</key>
   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
   <key>NSAppTransportSecurity</key>
   <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
   </dict>
   <key>UIRequiredDeviceCapabilities</key>
   <array>
      <string>arm64</string>
   </array>
   <key>CFBundleSupportedPlatforms</key>
   <array>
      <string>iPhoneOS</string>
   </array>
   <key>MinimumOSVersion</key>
   <string>11.0</string>

   <key>UILaunchStoryboardName</key>
   <string>LaunchScreen</string>

</dict>
</plist>
Ich sehe gerade das Projekt war nicht ganz jungfräulich, ich hatte schonmal eine andere BundleID eingegeben.
Ich hatte es wohl hier schonmal ausprobiert.

jayjay77 16. Sep 2020 07:40

AW: Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
Leider keine Verbesserung.
Kann es evtl auch an den Entwicklerlizenzen von Apple liegen?
Das hier ein Zertifikat oder Identifiers fehlt?
Unter Windows und Android geht die App.

Rollo62 16. Sep 2020 07:58

AW: Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
Zitat:

Zitat von jayjay77 (Beitrag 1473652)
Leider keine Verbesserung.
Kann es evtl auch an den Entwicklerlizenzen von Apple liegen?
Das hier ein Zertifikat oder Identifiers fehlt?
Unter Windows und Android geht die App.

Ja natürlich.
Provisioning Files und Permissions sind meistens die Ursache für Probleme.
Bei der Entwicklung ist das aber noch nicht so relevant, erst beim AppStore.
Es gibt aber gute Anleitungen dazu von Embarcadero im DocWiki.
Das würde ich mal Schritt für Schritt kontrollieren.

Ansonsten gibt es noch andere Samples mit Kamera, zum Testen.
Je einfacher desto besser.

jayjay77 16. Sep 2020 10:00

AW: Sample CameraComponent keine Berechtigung Delphi 10.4.1 iOS13.7
 
so, es gibt Neuigkeiten,
das andere Embarcadero Demo AccessCameraApp funktioniert.
C:\Users\Public\Documents\Embarcadero\Studio\21.0\ Samples\Object Pascal\Mobile Snippets\AccessCameraApp\AccessCameraApp

Hier kommt die Nachfrage, ob Zugriff auf die Kamera gegeben werden soll.
Allerdings nutzt das Demo nicht die TCameraComponent Komponente.
Es muss wohl an der TCameraComponent Komponente liegen,
da diese nicht in das Ereignis SampleBufferReady springt und somit wird diese Berechtigung nicht angefragt.

Wenn ich den Zugriff auf die Kamera von der AccessCamera App zulasse und danach die CameraComponent App starte habe ich Zugriff auf die Kamera.
Lösche ich die CameraComponent App und die AccessCamera App vom iPad,
übertrage die CameraComponent App neu und starte sie kommt keine Abfrage und der Zugriff ist auch wieder weg.

Evtl kommt da ein Fix für die TCameraComponent von Embarcadero.


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:33 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz