watchkit

watchOS - Complication shows previous entry

半腔热情 提交于 2019-12-13 02:13:12
问题 I'm creating a watchOS 3 complication that shows departure times from a public transit service. I've created a data model with an array that contains Train objects with a stationName (String) and departureTime (NSDate). I've implemented the getCurrentTimelineEntry() method and the entries are showing on the watch. The problem is that the watch shows only the previous entry. For example, I've the following departure times: Train(startStation: "Station name", endStation: "Station name",

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

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

How to upload application with app groups to Apple store?

假如想象 提交于 2019-12-12 16:24:00
问题 I create an app with Watchkit extension using App Groups function. Now I want to upload this app to Apple store. I do like this: Create App ID for my App (ex:com.standardApplication.tictactoe) Enable appGroup in Capabilities in Xcode for IOS app and Watchkit app using identifier: "group.com.standardApplication.ticTacToe" Create Provisioning Profiles for Development and Distribution on Certificates, Identifiers & Profiles center with my App ID that I create before. Download it and double klick

WatchKit Extension is not seeing data saved in NSUserDefaults with App Group

我与影子孤独终老i 提交于 2019-12-12 12:50:17
问题 I've been through a ton of SO posts, and this USED to work, but it stopped working. I'm not sure what happened. I developed this iPhone+WatchKit app with watchOS 1.0 and everything worked fine. I've upgraded my app, project, and Apple Watch to watchOS 2.0, and now I can't get any data via NSUserDefaults using my App Group. App Groups is enabled in Xcode on the host App, and WatchKit Extension. I even tried turning it on for the WatchKit App as well. My group name is called "group.com

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

How can I reference a Swift class in my WatchKit extension from the core iOS code?

懵懂的女人 提交于 2019-12-12 11:24:55
问题 I am trying to make my iOS application send the WatchKit Extension a set of data each time that data is updated from the server. This is what the code in my iOS app looks like (names changed) [WatchKitDataModel loadDataFromSource: currentData] However, the iOS application does not recognize the WatchKitDataModel. The error is "use of undeclared modifier." Please help me make my apps talk to one another! 回答1: Ensure that your offending class is added to both the App target and the WatchKit

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