apple-watch

Check if iPhone is paired with apple watch?

断了今生、忘了曾经 提交于 2019-12-03 02:01:01
In my app, I need to find if my phone is paired with a apple watch and get some information about the paired watch like its name. I tried reading the documentation but I couldn't seem to find any thing specific to my use case. Any help is appreciated. So since WatchOS 2 that is possible ! You have to do on iPhone side : First : import WatchConnectivity Then : if WCSession.isSupported() { // check if the device support to handle an Apple Watch let session = WCSession.default() session.delegate = self session.activate() // activate the session if session.isPaired { // Check if the iPhone is

ERROR ITMS-90512: Invalid sdk value… 8.2 is higher than maximum allowed value of 10.3?

戏子无情 提交于 2019-12-03 00:40:26
问题 Trying to upload a binary, which includes a watch app. The error I'm getting (which I wasn't getting a couple days ago) is the value provided for LC_VERSION_MIN_IPHONEOS for the watchkit extension is 8.2 which is greater than the maximum allowed value of 10.3... apparently 8.2 > 10.3? I'm updated to the latest XCode, 8.3, that didn't fix the problem. Tried changing the iOS deployment target for the watch app and extension, no apparent effect on the message. 回答1: Update: it's fixed! I have

HKWorkoutSession isn't keeping app at front of Apple Watch

ⅰ亾dé卋堺 提交于 2019-12-03 00:32:18
It has been stated that an app running a HKWorkoutSession will have special privileges over other watchOS 2 apps, so when a user looks at their Apple Watch, it will go to the view showing running a workout rather than the watch face. Currently, on both my device and simulator, this is not the case. If I start a HKWorkoutSession and then leave for 5 minutes and then interact with either the Apple Watch, or the Watch Simulator, it presents the watch face. If I then open my app, it appears to have been frozen, rather than terminated (which is what I imagine happens to other apps). As the UI will

How can you download WatchKit? [closed]

狂风中的少年 提交于 2019-12-02 21:19:46
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Does anyone know when WatchKit will be available for download for iOS developers? Will Xcode 6 include an emulator to allow for a Apple Watch app to be created/tested on a Mac? Update: 11/18/14 - WatchKit is officially available on apple's website . You must download the latest version of Xcode from the developer center. WatchKit allows developers to build Apple Watch apps. According to apple, Apple Watch apps using the

iOS7 and Apple Watch

不问归期 提交于 2019-12-02 20:34:20
I have a app with the minimum iOS target iOS7. I am considering in add some extra features with the apple watch. Theres is any option to maintain the iOS7 as the minimum target and still add support for apple watch if the app is running on a iOS 8? Something like the extensions/widgets of the iOS8. Thanks in advance You can set your deployment target to iOS7.x and make sure you build against iOS8.2 SDK. You will need to set the frameworks as optional (weak linking) in your build settings and perform run time checks to ensure you don't attempt anything with them on an iOS7.x device. Optional

How to automatically set the version and build number of a Watchkit app target

喜欢而已 提交于 2019-12-02 20:23:48
The version and build number (or version and short version) of a Watchkit app and extension have to be set to the same value as the containing app. I use environment variables to set the apps version in the Info.plist dynamically at build time. That also works fine for the Watchkit extension, but not for the Watchkit app. The environment variables I use have to be provided in the plist for the main app and extension without ${} (for variable ${VERSION} I set VERSION ). if I do the same for the Watchkit app, it is taking the string itself, not the value. If I provide it with dollar & brackets

iOS: Watch Kit paired device unavailable for development

旧时模样 提交于 2019-12-02 20:11:18
I can't run my Apple Watch application in XCode. My phone+watch is listed as a "Unavailable Device" and says "paired device unavailable for development". When I try to launch the app it says the same thing. How can I resolve this? I'm using XCode 7.1, iOS 9.0, WatchOS 2.0.1. This is what worked for me, and it is a lot easier and faster than un-pairing so I would try this first. From the Clock Face Swipe up, and click on the Ping iPhone button. After it makes a sound, go back in Xcode it should change no longer be unpaired or unavailable for development. I had the same issue on iOS 9.1 +

How to tell if current running Apple Watch size/dimension is 38mm or 42mm?

♀尐吖头ヾ 提交于 2019-12-02 19:26:12
We know that there are two screen sizes for Apple Watch: 38mm and 42mm. The WKInterfaceDevice class provides a readable property named screenBounds . I wrote an extension for WKInterfaceDevice , trying to add a method to detect current device type. import WatchKit enum WatchResolution { case Watch38mm, Watch42mm } extension WKInterfaceDevice { class func currentResolution() -> WatchResolution { let watch38mmRect = CGRectMake(0.0, 0.0, 136.0, 170.0) let watch42mmRect = CGRectMake(0.0, 0.0, 156.0, 195.0) let currentBounds = WKInterfaceDevice.currentDevice().screenBounds if CGRectEqualToRect

How to hide API keys in GitHub for iOS (SWIFT) projects?

旧街凉风 提交于 2019-12-02 17:34:30
Hello I'm trying to publish a iOS (SWIFT) personal project in GitHub but I'm afraid of sharing my private API keys and secrets with everybody. I'm using parse so I have in my AppDelegate something like this: let applicationId = "mySecretApplicationId" let clientKey = "mySecretClientKey" Parse.setApplicationId(applicationId!, clientKey: clientKey!) I would like to hide "mySecretApplicationId" and "mySecretClientKey", is there private place or directory in my project where I can put this variables? Thanks! You can use a .plist file where you store all your important keys. It is very important to

How to set apple watch code signing identity and provisioning profile for push notification?

南楼画角 提交于 2019-12-02 12:11:00
Got this error: Failed to code sign "xxx WatchKit App". The provisioning profile specified in your build settings (“xxxWatchAppPushProvisionProfile”) has an AppID of “com.yyy.xxxAppleWatchApp” which does not match your bundle identifier “com.yyy.xxxAppleWatchApp.watchkitapp”. Xcode can attempt to fix this issue. I've renamed "com.yyy.xxxAppleWatchApp.watchkitapp" to "com.yyy.xxxAppleWatchApp" but it gives this error instead: 来源: https://stackoverflow.com/questions/30252953/how-to-set-apple-watch-code-signing-identity-and-provisioning-profile-for-push-n