apple-watch

How to realize communication between Cordova App and Native WatchKit Extension

百般思念 提交于 2019-12-13 15:23:00
问题 I would like to extend a ionic / Cordova IOS App by a WatchKit App (native written in swift). I am wondering which is the best way for communication between both. I checked the plugin: github.com/leecrossley/cordova-plugin-apple-watch which allows me to make basic communication, after changing to: MMWormholeTransitingTypeSessionMessage transition type on both sides. (Using Xcode9 and watchOS 4.0). Now I am asking myself if this MMWormhole is the best choice, as development stopped 2-3 years

Dictionary becomes nil when trying to pass back CLLocation object to iOS app extension

落花浮王杯 提交于 2019-12-13 13:37:48
问题 I'm trying to pass a stored CLLocation object from my iOS app back to an extension (in that case: an Apple Watch extension). For that, I'm using the recommended openParentApplication(userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!, NSError!) -> Void)!) -> Bool function from the WKInterfaceController class in the extension code. I'm successfully receiving the request in my iOS app through the application delegate's application(application: UIApplication!,

Can we open the contacts on watch extension

浪尽此生 提交于 2019-12-13 00:40:00
问题 How to open up the contacts of iPhone programmatically in watch extension as we do in iOS using AddressBook. Thanks in advance 回答1: Your app runs on the phone, so you can fetch the contacts and send it to watch 回答2: In general to communicate with iPhone from your WatchKit extension you use + (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void(^)(NSDictionary *replyInfo, NSError *error)) reply; // launches containing iOS application on the phone. userInfo must be non-nil method of

No debugging symbols are available for the OS version installed on Apple Watch

末鹿安然 提交于 2019-12-12 20:08:20
问题 You may get a message in Xcode that states: No debugging symbols are available for the OS version installed on [Apple Watch Name]. Verify that your internet connection is functional, then disconnect and reconnect the companion device to retry downloading symbols. Screenshot: 回答1: After disconnecting the phone, watch, rebooting, nothing worked. Ultimately, it appears that this is a bug appears to be caused by a failed installation of the WatchKit debugging package. Steps install the package

How to launch different screen of apple watch app from different notification?

浪子不回头ぞ 提交于 2019-12-12 19:01:22
问题 Problem: How to launch different screen of apple watch app from different notification? This is my setup: I have 2 static WKUserNotificationInterfaceController: 1) awardsCategory 2) otherCategories This is my PushNotificationPayload.apns file for "awardsCategory" notification: { "aps": { "alert": { "body": "Hello world!", "title": "Optional title" }, "category": "salaryCategory" }, "WatchKit Simulator Actions": [ { "title": "Details", "identifier": "detailsButtonAction" } ], "customKey": "Use

Socket connection from WatchOS 2 and CFStream

三世轮回 提交于 2019-12-12 18:31:28
问题 I have to connect a remote server via tcp socket from the Watch. I have already written a piece of code using CFStream which works perfectly from the Watch simulator. When I run it on the Watch I get this error: The operation couldn’t be completed. Can't assign requested address (Code = 49) when I try to open the connection to the server using CFStreamCreatePairWithSocketToHost . The Apple documentation declares that CFStreamCreatePairWithSocketToHost is Available in watchOS 2.0 and later. so

Get WKInterfaceController reference while pushing interfaceController

孤街醉人 提交于 2019-12-12 18:11:17
问题 I have a Dashboard Controller in Apple watch and I am navigating to next WKInterfaceController without using Segue . pushControllerWithName("Messages_Detail",context: ["Data": messageDetailData]) Now I need to pass data from Dashboard to Messages_Detail later on after it has been loaded. I don't have any reference of it in Dashboard. How can I pass data to it? 回答1: Here you have a regular task of passing data between controllers and it is not a Watch-specific task generally speaking. Actually

Apple Watch: Can one Watchkit App communicate with more than one iOS App?

≡放荡痞女 提交于 2019-12-12 12:35:25
问题 I'd like to write a Watchkit App that can communicate with more than one iPhone App. For example, let's call this Watchkit App, "PingPong." All it does is set up an observer, and respond to a request--similar to an ICMP ping request. So, when an App sends a "PING" to the watch, the PingPong Watchkit app responds with "PONG." How can I make this functionality accessible to multiple apps? In other words, I would like to expose this very simple interface, so that different apps can use it. Note

Keep Apple Watch awake

耗尽温柔 提交于 2019-12-12 10:47:10
问题 I'm building an Apple Watch app which is controlled using motion. Right now, I'm looking for a way to keep the app awake without the user interacting with the screen. Any ideas? 回答1: You can't keep Apple Watch awake programmatically. You can change the end-user settings in Apple Watch settings app or in the Apple Watch app on iPhone, but there is no way to do this programmatically and with coding. The screen will be turned off after a certain amount of time (which is adjustable in Apple Watch

HealthKit: Workout saved on iPhone not visible in Activity App

笑着哭i 提交于 2019-12-12 10:39:27
问题 Using HealthKit, I am saving A Workout Corresponding Active Energy Samples Corresponding Walk/Run distance samples I'm running the same code on the apple watch and on the iPhone. When I'm saving on the iPhone I can select the workout and samples in my iPhone App I can see the workout and samples in the iPhone Health App The workout and samples are not in the iPhone activity app (bad) When I'm saving on the apple watch I can select the workout and samples in my iPhone App I can see the workout