Seeking 'beta' testers - MacOS and iOS

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Seeking 'beta' testers - MacOS and iOS

Post by Simon Knight » Sun Dec 18, 2022 12:41 pm

Hi,

I have written a library that provides commands to read event data from the users calendar on MacOS and iOS. I have no way of knowing if the library works on iOS as I do not have room for Xcode on my machine.

I will attempt to attach a LCB library .lcb and a test application that runs on macOS Big Sur. Failed! Dropbox links below.

If you are willing to run some tests then please run the built application which may be downloaded from my dropbox. The recent issue that I struggled with is one of requesting authorisation from the user for the application to access calendar events. Please note that the application will also request access to your contacts as calendar and contacts work hand in glove.

To run a test :

1. Run the test application.
Screenshot 2022-12-18 at 11.16.37.png
The test application.
2. Choose the start and end dates.
3. Press the button "Populate Data Grid with Events".
This action should cause MacOS to prompt for permission to access both Calendar and Contacts and then if granted it will return an array of Events data which should populate the datagrid. When complete the application should be listed in your privacy pane. The log panel may give me some idea of what is going wrong should the application fail.
4. From this point on you should be able to request event data that falls between two dates.
5. The button "Remove App from System Privacy Settings" does exactly that and allows you to run multiple tests from the same start position.
6. I enclose the .lcb file so that you may review it to confirm you are happy it is not attempting to empty your bank accounts or run off with your first born ;-) Its not as I'm not that clever or evil.....

Download Test Application : https://www.dropbox.com/s/aqh3zjwstp45v ... p.zip?dl=0
Download Library that app uses for review : https://www.dropbox.com/s/1lrtvycaygp89 ... b.zip?dl=0

Thanks, I await your comments,

Simon
Attachments
Screenshot 2022-12-18 at 10.43.46.png
App listed in Privacy Pane following first run.
best wishes
Skids

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Seeking 'beta' testers - MacOS and iOS

Post by stam » Sun Dec 18, 2022 1:18 pm

Hi Simon,

installed and run without any issues. I was surprised that it given access to Calendar by just clicking the button in the app, without me having to give express authorisation in security prefPane, but maybe that's normal. It did not request or receive permission to access my contacts and seemed quite happy with that.

However it did not retrieve any events from my 'calendar'. I put that in quotes because I have about 20 different calendars in iCal (on-call commitments, academic commitments, etc) so not sure which calendar the app attempts to access but certainly no events are retrieved.

The 'log' reports:
Calling CalCheckCalendarAuth
tAuthStatus is set to : Authorized
Access is Authorized, calling local handler GetListOfEvents
GetListOfEvents fires.
Requesting events from :2021-02-01 to 2022-02-28
The permissions were removed as expected on clicking the 'remove permissions' button.

For permissions, as it's a sensitive issue, consider using the sheet command to show a dialog box similar to what one expects in MacOS - would be more reassuring for users I think.

HTH
S

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Seeking 'beta' testers - MacOS and iOS

Post by Simon Knight » Sun Dec 18, 2022 3:08 pm

Hi Stam,

Many thanks for the test and debrief. The dialog box that gets presented is not controlled from within my app but is generated by MacOS following a complex call back call requesting permission. However, I believe that I can change the explanation text via the plist file but I have not tried that. Unfortunately the end user is no longer trusted to edit their Privacy Pane, apps are added by calling objective-C / Swift request permission calls and are removed via a system call issued from Terminal. It is all rather cumbersome. Once listed all the user can do is deny the application by unticking it in the Privacy List.

I am concerned that no events were returned. It should be returning every event across all calendars between the two dates. What OS version are you using ? I ask as recently Apple has changed the call to the EventKit and I wonder if older versions of the OS need the depreciated call. Also did you wait for a while for the data to be returned? Apple state that creating the object that holds all the selected events is resource intensive. However my own computer returns a years worth in approximately five seconds.

This is how my log file looks on completion :
Screenshot 2022-12-18 at 13.52.44.png
Log file when events are returned.
If you are willing I'll rewrite my stack to remove the calendar widgets so that you may test from within Livecode IDE. This is no good for testing the permissions as it will use Livecode's permissions but may shed some light on what is going wrong. It seems that the call is not being returned because I would expect the log to show zero events being read.

best wishes

Simon
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 3:16 pm

macOS 13.2 'Ventura'

Off-putting start:
-
SShot 2022-12-18 at 16.09.43.png
SShot 2022-12-18 at 16.09.43.png (37.61 KiB) Viewed 2846 times
-
Here's my December Apple Calendar (pretty unexciting):
-
SShot 2022-12-18 at 16.11.27.png
-
and no joy, I am afraid:
-
SShot 2022-12-18 at 16.13.52.png
-
and, as to running off with my first-born . . .

https://youtu.be/GgESJW-NyBA

what can I say?

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Seeking 'beta' testers - MacOS and iOS

Post by Simon Knight » Sun Dec 18, 2022 4:46 pm

#Richmond
perhaps not then!

As to the library, it sounds like I'm back to the drawing board.

My limited understanding of the "sandbox" is that the first warning is posted because I am not a registered developer. The return of "denied" just seems wrong given that the application has clearly been given permission to read the events.

Thanks for trying,

Simon
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 5:02 pm

Keep up the good work, and let's hope
that in due course you are as proud of your application as
I am of both my sons. :D

Here's the other one: https://www.youtube.com/@acrillics2669

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Seeking 'beta' testers - MacOS and iOS

Post by mwieder » Sun Dec 18, 2022 5:13 pm

I got the same initial screen as Richmond: "as blocked from use because it is not from an identified developer."

Then after loading the Security panel of System Preferences and clicking "Open Anyway"
I get the "cannot check it for malicious software" box. Fair enough.
Click Open and there we are.

The initial dates come up with Feb 2021 through Feb 2022, so I upped them a year to get some real data.
Click the button to load data and get the two permissions requests.
And I've got a nice grid full of lots of information about events in my calendar.

From the log:
Calling CalCheckCalendarAuth
tAuthStatus is set to : NotDetermined
Access is NotDetermined, calling CalRequestAuthorization()
EventKitRequestPermissionsCallBack fires!!!!
GetListOfEvents fires.
Requesting events from :2022-02-01 to 2023-02-01
70 events have been read from your calendar.

<g> I tend to use paper calendars on the wall rather than computerish ones, so there's not much there.
But it looks like it does/did as expected.

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Seeking 'beta' testers - MacOS and iOS

Post by Simon Knight » Sun Dec 18, 2022 5:25 pm

I suspect that I need to add further entitlements to the compiled application but Apple is far from clear on this.

I have attached an archive which contains a slightly modified stack file - I removed the calendar widgets as they are not available to all, and a library bundle which I hope the Extension Builder knows how to process. If and when run from the IDE the stack will use the access rights granted to Livecode.

Simon
Attachments
LivecodeStackFilePlusLibraryPackage.zip
Test stack and beta calendar library
(25 KiB) Downloaded 59 times
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 5:57 pm

macOS 13.2 / LC 9.6.3:
-
SShot 2022-12-18 at 18.55.36.jpg
-
SShot 2022-12-18 at 18.55.55.png

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Seeking 'beta' testers - MacOS and iOS

Post by Simon Knight » Sun Dec 18, 2022 6:09 pm

Here is a link to a copy of the built application that now includes a wild guess at an entitlements file; it may make a difference.
https://www.dropbox.com/sh/m9b9eoeqvoke ... nLhba?dl=0
clutching at straws - who me ?
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 6:30 pm

SShot 2022-12-18 at 19.29.42.png
SShot 2022-12-18 at 19.29.42.png (5.64 KiB) Viewed 2798 times
-
Something funny there when I unzipped it. :?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 6:39 pm

SShot 2022-12-18 at 19.38.42.png
-
Even screwier: well, at least I have an app to try out. :)

Or, maybe not. :cry:
-
SShot 2022-12-18 at 19.40.02.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 6:46 pm

Oh: I found this hiding behind a video of a Porpora Opera I was listening to
on my left-hand monitor:

https://youtu.be/7iLVjSlKoQw
-
SShot 2022-12-18 at 19.44.30.png
-
I didn't know resource forks existed nowadays, I thought they went the way of the mammoth when
Apple moved from Mac OS 9 to Mac OS X.

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Seeking 'beta' testers - MacOS and iOS

Post by Simon Knight » Sun Dec 18, 2022 7:11 pm

Yes that was my understanding as well.

Third time lucky ......
net.anvic.smk.readcalendarevents.1.1.4.lce.zip
zip of a zip - the library
(14.99 KiB) Downloaded 61 times
Test_os_Eventkit_NilWidgets.livecode.zip
zip of the stack file
(10.03 KiB) Downloaded 58 times
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Seeking 'beta' testers - MacOS and iOS

Post by richmond62 » Sun Dec 18, 2022 7:51 pm

This is a bit odd when it has already been done:
-
SShot 2022-12-18 at 20.50.18.png
-
Calling CalCheckCalendarAuth
tAuthStatus is set to : Denied
Access is Denied

Aaaaah:
-
SShot 2022-12-18 at 20.53.01.png
-
Which is hilarious as I am running LC 9.6.3.

Post Reply

Return to “Talking LiveCode”