I am getting an iCloud docListener event.isError = true in an app that runs in OS X.
All provisioning profiles etc. appear ok as an XCode app that correctly runs accesses the same iCloud container defined in the provisioning profile.
My code:
local iCloud = require( "plugin.iCloud" ) local function docListener( event ) print("####JTD idocListener called" ) if event.isError then print( "####JTD iCloud file storage is not available!" ) else print( "####JTD iCloud file storage is available!" ) local id = iCloud.identityToken() if id ~= nil then print ("####JTD iCloud.identityToken:" .. id) else print ("####JTD iCloud.identityToken:" .. "nil") end end end iCloud.docInit( { onComplete=docListener } ) print("####JTD iCLoudHandler loaded" )
My console:
Platform: iMac12,1 / x86_64 / 10.11.3 / AMD Radeon HD 6750M OpenGL Engine / 2.1 ATI-1.40.16 / 2016.2830 / en-US | IT | en_IT | en
Retries would not help for sure. I would recommend to print whole event output - it may contain additional info, other than “isError=true”. You can do it with [lua]print(json.prettify(event))[/lua]
What does console outputs? You can check by running your app from command line (like /Applications/TextEdit.app/Contents/MacOS/TextEdit) or checking out Console app.
Third option to look into is to check entitlements of the signed app. Something like
Oops sorry bout that… So, running my OSX app, here’s what I get from terminal:
...(some other stuff)... 2016-03-22 16:03:18.894 Alpha Omega[27136:3457366] NSUbiquitousKeyValueStore error: com.borderleap.alphaomega.osx does not have a valid com.apple.developer.ubiquity-kvstore-identifier entitlement
Also, iCloud available only for applications distributed through Mac App Store, as I wrote, I asked if your app is built for with AppStore distribution provisioning profile.
I just noticed something bad. May I ask to do same with tomorrows daily build? There is something weird about OS X provisioning profiles, and I added workaround. Current build can result in bad entitlements (you’ll get error message in console, but build will succeed)
OK. Tanks for your patience. It seems that 2016.2846 signs a valid binary, with proper entitlements for KVS and other iCloud services. Sorry for inconvenience. Download latest build and try again.
Reminder. To make OS X synchronize between iOS and tvOS you’ll have to set it’s kvs store ID, because OS X app probably will have different app ID that your iOS/tvOS app which can share it. Here’s small example (for explanations look on iCloud plugin doc page); distilled version of build.settings from Corona Cannon:
Retries would not help for sure. I would recommend to print whole event output - it may contain additional info, other than “isError=true”. You can do it with [lua]print(json.prettify(event))[/lua]
What does console outputs? You can check by running your app from command line (like /Applications/TextEdit.app/Contents/MacOS/TextEdit) or checking out Console app.
Third option to look into is to check entitlements of the signed app. Something like