Before determining that the extension is never called, you should check the Watch (console) log messages via the Devices pane. It's possible that the extension is launched in the background, and not attached to the debugger, so you would not see the NSLog
message in the Xcode console.
More significantly, you may have transferred some complication userInfo
from the phone to the watch but don't appear to do anything with that dictionary once the watch received it. You have to do more than merely transfer the current complication info. The complication data source would need to access that information when getCurrentTimelineEntryForComplication
is called (as a result of the timeline being reloaded).
Possible reasons
You didn't share very much code, so I addressed how transferCurrentComplicationUserInfo actually works
, and mentioned an unrelated issue I saw with your code.
Without more code, it's difficult to provide a specific answer, but I'll try to help for the sake of anyone else who may have this problem in the future.
Here are some possibilities why your extension's didReceiveUserInfo
is not called.
- You activated
WCSession
in more than one place, and the transfer is (not) being handled by another delegate.
- You didn't hold a reference to your activated session, and it went out of scope.
- The app hasn't been opened on the Watch.
- The session isn't activated soon enough or in the right place.
transferCurrentComplicationUserInfo
failed with an error because your phone was locked. (This is a known issue that Apple has acknowledged, and there is a workaround.)
How code would help improve your question and our answers
The purpose of providing code is to identify or eliminate reasons why something isn't working. Code is generally necessary to help answer "Why doesn't this work?" programming questions.
Just because it happens to work in the simulator, that doesn't guarantee that you "set things up correctly." It's reasonable that testing on a device reveals bugs you'd never discover by testing in the simulator.