CloudKit

Can you post more complete instructions for setting this up?  The help PDF doesn't show everything.  How do I authenticate?  The login window never appears.  I have uninstalled and reinstalled the VCL CloudPack.  What settings do I use for the APPSID file?  Do I even need the CloudKitTable setting?  I have managed to add records but they disappear when I close and reopen the demo.  I guess it is because it isn't authenticating properly.


Also, I cannot find anything on the web that indicates that you can have a Windows client for CloudKit.

I know this question isn't really a TMS question but I am hesitant to use Google Datastore or Cloudkit because of possible cost.  Do you know which is more cost effective or the approximate cost?

Sorry for so many questions but I have spent a lot of time trying to get it to work.

The Google Datastore part of the demo works just fine.

Thanks,
Brent

Did you have a look at the CLoudDataSetDemo that is included? First of all , you need to obtain from the Apple dev website a CloudKit application key, setup a project and database and assign this via AdvCloudKit.App.Key, AdvCloudKit.Project and AdvCloudKit.Database and then call AdvCloudKit.DoAuth.
With respect to costs, we haven't made a detailed study / comparison of possible costs for both services.

Yes, that is what I am testing with.  The Google Datastore works for me but in the PDF it has "DATASTORE" as the project but you have to click the down arrow to get the actual project that you should use.  


But as far as the Apple Cloudkit, when I click the radio button to switch to that and click Connect nothing happens.  I have created a new token in the Cloudkit console and I use that as my CloudKitAppKey.  I use the name that appears in the upper left of the console as my CloudKitProject.  Under Record Types I have Person with BirthDate, Children, Name, Salary as fields.  I use Person as my CloudKitDatabase.

Can you try to delete a file DSTOKENS.INI in the folder where your EXE is if this exists and see if this makes a difference? Normally, when you connect it should bring up the iCloud login screen.

Yes, I tried.  In CloudBase.pas debugging shows that it goes to DoAuth, ClearTokens, SaveTokens but the variables Token_Access, Token_Auth, Token_Access_Secret, Token_Refresh, ex are empty.


Would it be because of the settings on this page?
https://www.dropbox.com/s/s4ylcpz4n3v6p2y/token.png?dl=0

after deleting and trying again, my ini file shows this:
[CloudKit]
ACCESS_TOKEN=
AUTH_TOKEN=
ACCESS_TOKEN_SECRET=
AUTH_TOKEN_SECRET=
REFRESH_TOKEN=
EXTRA_DATA=

But, when you call DoAuth, you see the iCloud login dialog? I cannot see a reason for not seeing this dialog unless you assigned AdvCloudKit.AuthBrowser. If so, please remove this assignment and the dialog should appear.

I'll try uninstalling and reinstalling Delphi XE8.  It crashes a lot even though I tried uninstalling and reinstalling for the update 1.  I am also getting a "Class TStyleObject not found" every time I close XE8.

I reinstalled XE8 and then CloudPack for VCL

When I try to connect I get an exception.  Project CloudDataSetDemo.exe raised exception class Exception with message 'Cannot open URL https://api.apple-cloudkit.com/database/1/myproject/development/private/users/current?ckAPIToken=xxxxxxxxx

Where xxxxxxxxx is part of my token

Do you have any firewall / proxy / antivirus software installed that might interfere with your app accessing internet?
What happens when you try this URL directly in a browser?

No, it wasn't a firewall issue. I copied the exe to a different system and still no login.



I figured it out. The APPIDS.INC CloudKitProject settings isn't the name that appears in the upper left corner of the CloudKit Console. It should be the Container ID that you create in the Certificates, Identifiers & Profiles on the Apple Developer site. So it would be something like iCloud.com.tmssoftware.CloudDataSetDemo



Once I set that, I got the login window. I logged in and then had to type a 4 digit code that I received on my phone since I have two factor authentication turned on.



I got a script error with each number that I typed but I think you explained that in an email where you have to change a registry setting. I'll try using chromium embedded to try and get around that issue.



Thanks for informing. The script errors are indeed most likely due to the webbrowser control IE version used and can be changed to use the latest IE engine via the registry.

Thanks Bruno.  For the IE fix, I tried the registry setting Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION


DWORD:
CloudDataSetDemo.exe 11000

I've tried switching it to use chromium embedded for a VCL application.  Do you know how to do that?

Please try to use HKEY_LOCAL_MACHINE...

I am using Windows 10.  I still get the same error.  Script Error


Unable to get property "isComputed" of undefined or null reference

Hi,


I have not been able to reproduce the Script Error on Windows 10.
After adding the registry value the login page and authentication is working as expected.