Unable to Sync with NSUbiquitousKeyValueStore on Sierra

I am unable to save any changes to the NSUbiquitousKeyValueStore on macOS Sierra. I wrote a dead-simple app just for testing. On pressing a button, the app does the following:


    [[NSUbiquitousKeyValueStore defaultStore] setString:@"Mac" forKey:@"TestString"];
    BOOL sync = [[NSUbiquitousKeyValueStore defaultStore] synchronize];
    NSLog(@"Did sync change from memory to disk: %i", sync);

    [[NSUserDefaults standardUserDefaults] setObject:@"Mac" forKey:@"TestString"];


The return BOOL sync value there is NO on macOS 10.12 Sierra, and the change is never noticed by an iOS 9 device which is monitoring for key-value changes for the same App ID.


The entitlements are all set up properly, and I have verified that the code works properly when the test app is run under OS X 10.11, and the change is noticed in my test app running iOS 9.


Is this a bug? Is anyone else experiencing this?


Or is this expected behavior—i.e. a beta OS is not allowed to write to NSUbiquitousKeyValueStore?

Replies

I also have NSUbiquitousKeyValueStore problem.

Although I do not know if the same as the your problem,,,


I tested mac<-->mac, and mac<-->iPhone.


Experiment environment:

#1 iMac (OSX EI Capitan 10.11.6)

#2 Parallel:VM (OSX EI Capitan 10.11.6 Bata 15G26a)

#3 MacBook Air (macOS Sierra 10.12 Bata8 16A313a)

#4 IPhone5 (iOS9.3.5)

#5 iPhone6 (iOS10.0 Beta8 16A313a)

--- Xcode8 Bata6 (8S201h) + Swift2.3.


More is OK all other than the pair #3 (MacOS Sierra). They can communicate with each other.


1. The similarity of your test code (Swift), made to #3. Only result = false


let result = NSUbiquitousKeyValueStore.defaultStore (). synchronize ()

if result == false {

NSLog ( "error: \ (result)") <<— #3 only error

}


2. In #3, NSUbiquitousKeyValueStoreDidChangeExternallyNotification has not arrived even cloud side is changed


PS

This statement is using automatic translation.

same problem here, as Sierra has a GM versio now it would be time to fix this serious issue, it will break KV storage based applications.

i've sent several related bug reports, no results yet :/

macOS Sierra GM was slightly updated to build 16A322, so I installed it (clean). Still the same error when calling synchronize(), with "Refusing TCCAccessRequest for service kTCCServiceUbiquity from client [APPID] in background session" in the Console app.

Problem has been confirmed by DTS. Now waiting for comments of the engineering team.

Also, I have receive a similar e-mail from DTS.

I have a similar problem in my app. Any word on a fix?

Same problem here. Still not fixed.

It seems to work correctly in "macOS 10.12.1 beta 3 (16B2338c)".

Although, confirmation is required.