OK, so after a bit of wailing and gnashing of teeth, I've come up with something more simplified - hopefully as much as possible. The attached code is just for iOS, however hopefully it meets these basic requirements:
Requests permissions that allow creation of an album that can be accessed by the app
If permissions are too limited, or denied, prompts the user to change the app settings, which is the only way to make subsequent changes if the permissions are not granted.
If the prompt is declined, a value is set in the user defaults, so that the user is not prompted again. If they wanted to grant access again later, either this would need to be coded in the app, or they would need to do a manual change
Once permissions are granted, the Create/Find Album button becomes enabled, and clicking that either locates the existing album, or fires off a change request to add the album
Once the album has been created or found, the Save Image button becomes enabled. Tapping it fires off a request to save the image in the TImage component to the album
Notes:
The attached demo does not have any dependencies other than what comes with Delphi, and the units provided with it.
It contains a "re-import" of the Photos framework with the newer classes, methods etc.
It assumes that the device has iOS 14+, so the code would need to be modified to support older versions
Feel free to ask about whatever I may have missed 🙂
The plan is to eventually update Kastri with the new import, and include some of the code in the demo as well.
SaveImageDemo.zip