WatchKit

RSS for tag

Build apps that leverage watchOS features like background tasks, extended runtime sessions, and access to the Digital Crown using WatchKit.

WatchKit Documentation

Posts under WatchKit tag

138 Posts
Sort by:
Post not yet marked as solved
0 Replies
283 Views
I'm making a watchOS app, which has WKNotificationScene for dynamic notification, and button for open sms app. I've tried to open sms app via url with following orders, but I always get error below: Press Notification on watchOS, which is made of WKNotificationScene (a.k.a. dynamic notification) watchOS App comes to foreground. Press button, which executes WKApplication.openSystemURL(_:) to open SMS App Error occurs. Failed to open URL sms:01022221111&body=%EB%82%98%EC%A4%91%EC%97%90%20%EC%A0%84%ED%99%94%EB%93%9C%EB%A6%AC%EA%B2%A0%EC%8A%B5%EB%8B%88%EB%8B%A4.: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.MobileSMS" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: Security ("Entitlement com.apple.springboard.openurlinbackground required to open URLs while backgrounded")., NSLocalizedDescription=The request to open "com.apple.MobileSMS" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x176bf6b0 {Error Domain=FBSOpenApplicationErrorDomain Code=3 "Entitlement com.apple.springboard.openurlinbackground required to open URLs while backgrounded." UserInfo={BSErrorCodeDescription=Security, NSLocalizedFailureReason=Entitlement com.apple.springboard.openurlinbackground required to open URLs while backgrounded.}}, FBSOpenApplicationRequestID=0xaecb} -[SPApplicationDelegate extensionConnection:openSystemURL:]_block_invoke:2386: Attempting to open url sms:01011112222&body=%EB%82%98%EC%A4%91%EC%97%90%20%EC%A0%84%ED%99%94%EB%93%9C%EB%A6%AC%EA%B2%A0%EC%8A%B5%EB%8B%88%EB%8B%A4. with scheme sms failed: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.MobileSMS" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: Security ("Entitlement com.apple.springboard.openurlinbackground required to open URLs while backgrounded")., NSLocalizedDescription=The request to open "com.apple.MobileSMS" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x176bf6b0 {Error Domain=FBSOpenApplicationErrorDomain Code=3 "Entitlement com.apple.springboard.openurlinbackground required to open URLs while backgrounded." UserInfo={BSErrorCodeDescription=Security, NSLocalizedFailureReason=Entitlement com.apple.springboard.openurlinbackground required to open URLs while backgrounded.}}, FBSOpenApplicationRequestID=0xaecb} I've tried to check WKApplicationState.active before executing WKApplication.openSystemURL(_:), but it always failed. Does anyone know how to fix it?
Posted
by blindWM23.
Last updated
.
Post not yet marked as solved
1 Replies
279 Views
Hi, we have an old cordova/phonegap app that we are trying to upload through Transporter, but suddenly we started getting the following error: "Missing Info.plist value. A value for the key “WKApplication”, or “WKWatchKitApp” if your project has a WatchKit App Extension target, is required in “.app/.app” bundle. For details, see:" We don't support Apple Watch and there is no target for Apple Watch, there does not seem to be anything to do with Apple Watch in our XCode project, yet we are getting the above complain. We using the following versions: XCode 15.0 Cordova: 12.0.0 cordova-ios: 6.3.0 There has been no change to our provisioning profile. Any idea why we are getting the above complain?
Posted Last updated
.
Post not yet marked as solved
0 Replies
256 Views
Enable Developer Mode - Missing Trust this computer - Missing, if the prompt happens and you accidentally tap the verbiage or the crown before scrolling to the buttons, you never ever see the trust this computer again. Double tapping the side button or crown to kill apps is a game of roulette. If you don’t swipe the app in mere seconds the list disappears or one of the background apps becomes active. After upgrading all watches to 10.4 and pairing to a phone guess what? Enable developer mode - missing. Now I have a few watches that cannot be used for development. When is Apple going to address this glaring bug people have been reporting and talking about in the forums for almost a year with versions of watchos from as early as 9.x and iOS 16?
Posted
by MobileTen.
Last updated
.
Post not yet marked as solved
1 Replies
280 Views
Hi everyone, We have a sports app that helps track your game scores. Still, when you are in the middle of a game and receive a notification (e.g., an activity notification, a WhatsApp or third-party app), that notification will pop up on the screen, overlapping the app. This forces you to scroll all the way down the notification and close it before you can continue using the app. Some users are complaining about this, and it's indeed very annoying. I was wondering if there's any way to control that during matches, no notifications pop up on your screen (it's ok to have the red dot on top, but having the notification overlapping is what kills the app's usability). Users can avoid this by choosing the right "focus" mode before starting a new match. However, many don't even know this feature exists or how to deal with it. Is there any way to block incoming notifications from appearing on the screen while the app is being executed?
Posted
by Ataliano.
Last updated
.
Post not yet marked as solved
0 Replies
256 Views
I want to make apple watch app with Siri Kit. So I integrated siri intents and code on Xcode. But I caught the following build error during debugging of intents. Please advice me. Failed to install the app on the device. Domain: com.apple.dt.CoreDeviceError Code: 3002 User Info: { DVTErrorCreationDateKey = "2024-03-11 02:38:02 +0000"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; NSURL = "file:///Users/cion/Library/Developer/Xcode/DerivedData/Hydrator-dqlkxgxzgyjnzwhgguipzumyovfi/Build/Products/Debug-iphoneos/Hydrator.app/"; } “Hydrator”をインストールできません Domain: IXUserPresentableErrorDomain Code: 6 Failure Reason: このアプリはこのデバイス用に作成されていません。 Recovery Suggestion: This app was not built to support this device family; app is compatible with ( 1, 2 ) but this device supports ( 4 ) This app was not built to support this device family; app is compatible with ( 1, 2 ) but this device supports ( 4 ) Domain: MIInstallerErrorDomain Code: 10 User Info: { FunctionName = MIIsApplicableToCurrentDeviceFamilyWithError; LegacyErrorString = DeviceFamilyNotSupported; SourceFileLine = 86; } Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_isCoreDevice" = 1; "device_isWireless" = 1; "device_model" = "Watch5,2"; "device_osBuild" = "10.3.1 (21S651)"; "device_platform" = "com.apple.platform.watchos"; "dvt_coredevice_version" = "355.7.7"; "dvt_mobiledevice_version" = "1643.60.2"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = "arm64_32"; "operation_duration_ms" = 4026; "operation_errorCode" = 6; "operation_errorDomain" = "com.apple.dt.CoreDeviceError.3002.IXUserPresentableErrorDomain"; "operation_errorWorker" = IDEInstallCoreDeviceWorker; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 1; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 1; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.watchos"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 2; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.app-extension"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "watchos10.2"; "sdk_osVersion" = "10.2"; "sdk_variant" = watchos; } System Information macOS Version 14.3.1 (Build 23D60) Xcode 15.2 (22503) (Build 15C500b) Timestamp: 2024-03-11T11:38:02+09:00
Posted Last updated
.
Post not yet marked as solved
0 Replies
301 Views
We have a watch app, that contains TabView with two child views. First Child View have a slider control that supports digitalCrownRotation. Second child view have a normal text on the screen “Hello” When app is launched, the slider in the first view got highlighted when user rotates the Digital Crown but when we moved to Second tab and navigate back to first view, and rotates the Digital Crown, the slider view never gets highlighted but the value of Slider gets changed and value gets changed by any step. This issue was introduced after WatchOS 10.2. Prior to WatchOS10.2 everything worked fine. Could you please assist me to find the solution to resolve this issue?
Posted Last updated
.
Post not yet marked as solved
8 Replies
886 Views
Hello! I'm working on the watchOS app that provides user with multiple fancy complication sets. There are about 50 widgets in our WidgetBundle now. With this amount we reached memory limit and the app crashes: Thread 1: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=15 MB) I inspected complicationExtension.appex content and find out that most volume is occupied by the executable: Localized strings (12 langs) altogether - 165 KB Assets.car - 1.1 MB Imported fonts TTF files altogether - 866 KB complicationsExtension executable file - 8.2 MB Why it takes so much space and how can it be made smaller?
Posted
by kelin.
Last updated
.
Post not yet marked as solved
0 Replies
334 Views
Is there a way to migrate WidgetKit extensions made using dual-target watchOS apps to single-target apps? When you create a widget extension with a dual-target app, the bundle identifier includes the extra extension domain (com.company.app.watchkitapp.watchkitextension.widgets). When Xcode 15 migrates a dual-target to single-target, it removes “.watchkitextension” from both the watchOS app bundle identifier and the widget extension bundle identifier. watchOS seems to handle migrating the main app just fine, but any complications created with the dual-target do not get migrated and are just blank until the user re-configures, which would be a huge bummer to have to ship. If I try to manually set the bundle identifier back to include “.watchkitextension”, the OS rejects the installation because of the extraneous dot after the parent app’s prefix.
Posted
by bbatsell.
Last updated
.
Post not yet marked as solved
1 Replies
325 Views
I currently own an Apple Watch SE2 device. However, when I try to debug from the watch to the actual device, the connection loss issue occurs all too often. Once the connection is lost, it continues to try to connect in the Disconnected list on the Xcode "Devices and Simulators" screen and is in a loading state. Very often, even when the connection is established and you are trying to start debugging, it drops out. Xcode cannot debug properly on the actual device. I later found out that the Apple Watch SE2 does not support 5.0 Hz Wi-Fi, only 2.5 Hz. I think that might be the cause. Is this phenomenon less likely to occur if you debug on an actual device such as a regular Apple Watch 7/8/9 or Ultra model? In fact, if debugging is difficult with the Apple Watch SE model, I am wondering whether I should purchase an additional Apple Watch. Or is there another way to improve this issue? It would be nice if the Apple Watch could be debugged by connecting it to a Mac with an actual cable like the iPhone. I am wondering if there is a way to disable and enable network debugging in Xcode. In the past, debugging the watch using only Bluetooth with the iPhone in Xcode seemed to be more stable. Except for the Watch, the iPad doesn't have any major issues with Wi-Fi debugging on the iPhone.
Posted Last updated
.
Post not yet marked as solved
0 Replies
225 Views
Hi, I am new to MAC development and not sure if this is possible at all, but I would like to test how my app reacts to NSWorkspaceWillSleepNotification and NSWorkspaceDidWakeNotification events. So I want to setup googletest which will: initialize my own stuff from another thread send an event to my tested code that will make it "think" system will go to sleep perform "OnSleep" logic after some time, from another thread, mimic wake event detect in tested code I am awaken and check if my code works ok Additionally, if there are multiple handlers registered to sleep/wake events - did they all get executed (I guess - yes) and in which order (in order of registration)? Many thanks in advance
Posted
by bebadsp.
Last updated
.
Post not yet marked as solved
0 Replies
471 Views
There's another thread on here with similar Q but seems to have no resolution. So starting my own. The basics Xcode 15.3.0 beta 3 iOS 17.4 The WatchOS 10.4 I have an iPhone app with a companion watch app. In Xcode if I set the scheme to my iOS app it installs on my phone but the companion watch app does not auto install on my watch. Automatic App Install is turned on in Watch app on iPhone. To run the app on watchOS I have to run it directly from the watch scheme on Xcode. If I delete the app from the watch then go into the iOS watch app on the iOS device to install on my watch I receive an error "This app could not be installed at this time" Is there a known cause solution?
Posted
by RyanTCB.
Last updated
.
Post not yet marked as solved
5 Replies
829 Views
I have a Watch companion app. The SwiftUI previews fail to build for the watch app. The errors indicate it is trying to build Swift package targets that are meant for iOS only, not the watch. The watch does not include these dependencies so it is perplexing it will try to build them. Digging into the scheme for the watch app, it includes the iOS target as you can see the screenshot. This seems to be the default when you create a new watch target. If I uncheck the boxes for the iOS target, previews will build fine. But I think this means that each time I build my Watch target, it will not simultaneously build my iOS target. I'm not sure of the impact of that. Is this a known limitation with Previews? Is there another workaround?
Posted Last updated
.
Post not yet marked as solved
2 Replies
435 Views
I am developing issuer non-UI extension. In function status i have to return remotePassEntriesAvailable (boolean) and to do that i have to activate WCSession from that Extension to get the remoteSecureElementPasses which are already added to the remote wallet (watch). I have implemented WCSessionDelegate inside the non-UI extension but i can not enable the WCSession. I always get: Error: WCSession has not been activated I saw a comment in this post -> WCSession is not available from iOS extensions, only from the main iOS app. To the point... If the WCSession is not available from iOS extensions how can I properly set remoteSecureElementPasses and implement function remotePassEntries if i can't connect to the watch to see which cards are already enrolled?
Posted Last updated
.
Post not yet marked as solved
2 Replies
424 Views
We have an IOS app and its watch extension. The watch extension having complications as well created with clockKit Also we are providing a watch face with our custom complications for the user. Everything working fine watch series 6 and above Now we have an issue reported by a customer in watch series 3 (the watch Os version in 8.8), in which the watch face is not able to add as it showing the error "Watch Face Unavailable" So when we tried to create a another watch face for watch series 3, the complication list on the watch extension as well as the watch app of iPhone are not listing our app name Because of this issue we can't create a custom watch face for the watch series 3 with our complications So why the watch app in iPhone is not listing our watch app name in the list of complications Please update if anyone having similar issues
Posted Last updated
.
Post not yet marked as solved
3 Replies
477 Views
watchOS 10.4 Beta2 (21T5196d) broke its browser component! You can send youtube.com to your Apple Watch via iMessage, and then open it! Everything worked fine in the official version of watchOS 10.3; you couldn't watch videos because the Apple Watch's WebView doesn't have a video component, but you could at least browse web pages normally. However, in watchOS 10.4, WebView is completely broken, and you can't even view the homepage recommendations or try searching for content properly — web pages refresh automatically within seconds and keep crashing repeatedly. Please revert everything back to the state of watchOS 10.3! The minimal demonstration link to reproduce this bug: https://ling-bucket.oss-cn-beijing.aliyuncs.com/apple/minimalVideo.MOV
Posted Last updated
.
Post not yet marked as solved
1 Replies
388 Views
My watch APP needs to keep Bluetooth connected with peripherals whether it is in the foreground or background, but the results of my test show that the connection in the background is very unstable, sometimes you can keep the Bluetooth on for a day, but sometimes it will be disconnected 50 times a day, and every time it is disconnected, I will immediately initiate a reconnection, it is certain that there is no problem with the peripheral Bluetooth, because I have another iOS device that has been stably connected to the peripheral, I want to know what causes this instability, and if there is any solution, if someone can provide relevant advice, I will be very grateful
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.4k Views
I’ve created a single-target watchOS app in Xcode 14, but I can’t seem to get ClockKit complications working. I’ve added a CLKComplicationDataSource class to my watch target, and in the Info pane for my target I have set the CLKComplicationPrincipalClass key to MODULE-NAME.ComplicationController I haven’t yet added Complication placeholder images to my Assets.xcassets, but as far as I am aware, that shouldn’t be a problem while I am still testing. However, when I run it on a watchOS simulator, the complications never show up on the watch complications list when adding a complication. All of the tutorials I can find for ClockKit complications reference older two-target WatchKit apps. Do the newer single target apps no longer support ClockKit? If so, how can I make a two-target WatchKit app with Xcode 14? Unfortunately I cannot use WidgetKit for my complications because I need to support watchOS 7 at least, and WidgetKit only supports watchOS 9+ Thanks for your help
Posted
by AlwardK.
Last updated
.