watchkit

watchkit , iOS sending data between watch and iphone

瘦欲@ 提交于 2019-12-22 01:27:59
问题 I want to create one button in watch and while tapping on watch start one process to my ios app. How can I send the data between 2 devices -(void)viewWillAppear:(BOOL)animated { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(sayHello:) name: @"sayHelloNotification" object: nil]; } plus [[NSNotificationCenter defaultCenter] postNotificationName: @"sayHelloNotification" object: nil]; in my button watch but it doesn't work 回答1: AFAIK, you can not share data directly,

openParentApplication only works when the app is running in the foreground

会有一股神秘感。 提交于 2019-12-21 17:52:12
问题 I'm trying to request data from the server by using openParentApplication and use it in the watch extension, but I don't get anything back when the main app is not running in the foreground. When the main app is running in the foreground everything works fine. 回答1: I had this issue before and the reason was that you haven't registered long running background operation and the system kill it. This is how I sorted this, please see comments for explanations, this is all in AppDelegate file and

Is it possible to trigger a haptic feedback without the accompanying sound on apple Watch OS 2

陌路散爱 提交于 2019-12-21 14:38:26
问题 Assuming the user has not muted their watch sounds. Is it possible for an apple watch app to trigger a haptic feedback (i.e vibrate) without the accompanying sound. This is different than receiving a notification which is handled automatically by the watch. In this case I'm invoking the haptic feedback using a watch app. like this: [[WKInterfaceDevice currentDevice] playHaptic:WKHapticTypeClick]; 回答1: There is a hacky way to do so. You can start to play WKAudioFilePlayer right before haptic

Is it possible to trigger a haptic feedback without the accompanying sound on apple Watch OS 2

旧街凉风 提交于 2019-12-21 14:37:21
问题 Assuming the user has not muted their watch sounds. Is it possible for an apple watch app to trigger a haptic feedback (i.e vibrate) without the accompanying sound. This is different than receiving a notification which is handled automatically by the watch. In this case I'm invoking the haptic feedback using a watch app. like this: [[WKInterfaceDevice currentDevice] playHaptic:WKHapticTypeClick]; 回答1: There is a hacky way to do so. You can start to play WKAudioFilePlayer right before haptic

How to reference non-supported frameworks in Watch OS 2

情到浓时终转凉″ 提交于 2019-12-21 07:55:27
问题 I updated my app to the latest swift 2.0 syntax. In doing so, My watchkit app has become broken. The issue is the watchkit app references a class that references the framework AVFoundation. WatchOS2 apparently now no longer supports some of the standard frameworks: Support for network-based operations includes the following technologies: WatchKit extensions can access the network directly through an NSURLSession object. WatchKit extensions have full access to the NSURLSession capabilities,

How to trigger notifications using WatchKit

限于喜欢 提交于 2019-12-21 06:59:04
问题 In the WatchKit developer guide, there are instructions on how to render custom notifications and it also says: Apps are not required to do anything to support notifications. The system provides a default notification interface that displays the alert message from the notification. However, apps can customize the notification interface and include custom graphics, content, and branding. I can get local notifications to trigger banner alerts on the phone, but they don't happen on the WatchKit

Getting black screen on Watchkit simulator and “Waiting to Attach” when adding to existing project

纵饮孤独 提交于 2019-12-21 06:18:19
问题 I'm interested in adding a Watchkit Extension to my existing app already in the app store. I've done my research, followed some tutorials, and now am ready to actually implement. The problem I'm having is, I can't seem to add a Watchkit App to my existing project and get it to run in the simulator. If I start a new project and do some tutorials or whatever, the Watchkit App runs fine. Adding to my existing project, I just get a black screen in the simulator window. Not even the status bar is

WKInterfaceGroup bottom corner radius

我只是一个虾纸丫 提交于 2019-12-21 06:09:09
问题 I am trying to set the corner radius for the bottom left and bottom right corners for a WKInterfaceGroup. I was able to set only one single radius value and that would change it for all the corners. I couldn't find a way to access the CALayer to specify it there either. Is there a way this can be done? Thanks! (The group would contain 2 labels and would be in contact with the sash in the dynamic notification interface.) 回答1: You asked about WKInterfaceGroup, but from your response to

Debugging on real Apple Watch

夙愿已清 提交于 2019-12-21 04:21:18
问题 I updated my app for Apple Watch, but I should have weighed it too much and now it's definitely slow. I can't understand the reasons of this slowdown so I would like to debug app but I don't know how to do that because in the simulator app works normally, slowdowns manifest only on the device. I tried running app directly from xCode on Watch but once xCode launched the installation of the app on the Watch, it stops the run so I can't see what happens while running (for instance when run

Debugging on real Apple Watch

China☆狼群 提交于 2019-12-21 04:20:59
问题 I updated my app for Apple Watch, but I should have weighed it too much and now it's definitely slow. I can't understand the reasons of this slowdown so I would like to debug app but I don't know how to do that because in the simulator app works normally, slowdowns manifest only on the device. I tried running app directly from xCode on Watch but once xCode launched the installation of the app on the Watch, it stops the run so I can't see what happens while running (for instance when run