问题标签 [watchos-2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1205 浏览

ios - watchOS 2 上的钥匙串访问在实际手表上不起作用

我在 Apple 开发者论坛上读到,与 watchOS 1 不同,watchOS 2 不与手机应用程序共享其钥匙串,所以 bam!默认情况下未启用钥匙串共享,我们必须为此做一个解决方法。

好的,来解决我的问题,我试图在运行最新测试版(beta4)的实际手表设备上运行一个非常基本的钥匙串访问程序,使用 git 库https://github.com/jrendel/SwiftKeychainWrapper

在模拟器上它就像一个魅力但是当我尝试在实际手表上运行它时它给了我一个状态代码-34018

没有关于这个错误代码的公开文档,但我做了一点挖掘发现它原来是

来源: http: //opensource.apple.com/source/Security/Security-55471/sec/Security/SecBasePriv.h

实际上,我花了一整天的时间对此进行了大量研究,人们向我指出了各个方向,例如内存问题、权利、配置文件问题、钥匙串中的错误等。

这里的问题是,大多数报告此问题的开发人员并没有像我在每次运行应用程序时都得到它一样,他们只在某些地方有它,比如当应用程序在后台时等等。总而言之,

我的问题是

任何帮助表示赞赏。

仅供参考,我还尝试了 Apple 的 KeychainItemWrapper,海关代码直接与 SecItem 方法对话,结果没有任何结果。

更新,我也试过了,它像往常一样失败

更新 2:问题已在 watchOS2 beta 5 中得到修复。

0 投票
3 回答
2269 浏览

ios - watchOS 2:后台触觉反馈

我想我已经知道这个问题的答案了,但我想问的只是彻底。

考虑一下 Apple Watch 内置的地图应用程序。当您使用转向指示时,当需要左转或右转时,手表会播放自定义触觉模式 - 即使屏幕关闭且应用程序处于后台。另一个例子是当你在锻炼时——如果你设定了一个目标,当你达到 50% 和 100% 时,即使你没有看手表,你也会在手腕上轻拍一下当时(屏幕关闭,应用程序后台)。

在 watchOS 2 中,我们第 3 方开发人员有什么办法可以让应用在屏幕关闭且应用处于后台时播放特定的触觉模式?我知道该playHaptic:方法在应用程序处于活动状态时有效,可让您播放几种不同类型的触觉模式,而且我知道当应用程序处于非活动状态时,您可以收到通知 - 但通知只会播放“通知”触觉的感觉,别无选择。

0 投票
1 回答
952 浏览

ios - watchOS 错误:控制器接口描述中的未知属性

我在情节提要中添加了一个 WKInterfacePicker 并将其连接到接口控制器中的 IBOutlet。运行应用程序时,它会在控制台中显示一条错误消息:

控制器的接口描述('watchPicker')中的未知属性

代码:

我该如何解决?

0 投票
1 回答
195 浏览

xcode - 无法打开 HealthKit 功能

我正在尝试在 iOS 9 和 WatchOs 2.0 上使用 HealthKit,但是当我尝试在项目的 Capabilities 页面中打开 HealthKit 时,我收到以下错误消息:

链接 HealthKit.framework

在此目标的 SDK 中找不到框架“HealthKit.framework”。

iOS App 和 WatchKit App Extension 也是如此。

我试图在Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library中手动找到框架,但它也不存在。

我正在使用 XCode 7.0 Beta 4。

有小费吗?

谢谢!

0 投票
1 回答
1923 浏览

contacts - 如何在 Apple Watch 上访问联系人信息?

使用 watchOS 1 或 2,我希望能够使用图片访问最喜欢的联系人或我观看时的所有联系人。我知道我将不得不使用setItem电话,但我仍然不知道如何从 Apple Watch 本身访问联系人。

0 投票
0 回答
165 浏览

watchkit - watchOS 2 的 Lister 在设备上崩溃

我想在设备上构建 Apple 的示例代码“Lister”,但我无法构建“Lister Watch App”方案(不是旧的“Lister WatchKit App”)。

Lister(适用于 watchOS、iOS 和 OS X)

有人在 Apple Watch 上成功构建 Lister 吗?

注意:开启EMBEDDED_CONTENT_CONTAINS_SWIFT无效。

0 投票
1 回答
869 浏览

watchkit - 以编程方式强制 Apple Watch Display 保持开启状态

我注意到,Apple Watch 将关闭它的显示(意味着调用方法 WKInterfaceController.didDeactivate)。但是,我不想要这个。无论如何我可以在我的应用程序的生命周期内强制显示保持打开状态吗?我的是 Watch OS 2 Beta 4

0 投票
1 回答
127 浏览

ios - 在 WatchSimulator 上播放但在 AppleWatch 上不播放的 .gif 图像序列

我在watchOS2 b4上。

我有一个正确连接的WKInterfaceImage名字animatedImage,我正在使用

动画几个图像。这适用于模拟器,但图像不会显示在 AppleWatch 上。

我在 Watch-target 中添加了一个文件夹,其中包含所有图像。他们都被命名image0.gif image1.gif等等。

还有其他人遇到这种情况吗?

0 投票
1 回答
1780 浏览

reachability - watchOS 2 可达性

如何确定 watchOS2 中的可达性?

如果我导入reachability.h,Xcode 找不到SystemConfiguration.h 框架。

0 投票
1 回答
342 浏览

watchkit - Unable to "Upload to App Store" Xcode 7 beta 4, watchOS 2

I have to upload my app on the App Store in order to do some internal testing with Test Flight. Even if I am still using beta version, this is possible according to this question Is it possible to upload an iOS app to App Store for internal testing from Xcode 7 beta?

Unfortunately I am not able to do it. First some details, my app name is Workout and I have created an application for both iOS 9 and watchOS 2. In the photo you can see the largest of my project (automatically created by Xcode).

enter image description here

I have tried a lot of configurations, here are some a) (there are six settings, like the six icons in the image)

b) The same Provisioning Profiles but everything on iPhone Developer except for WorkoutTests and WorkoutUITest where, since I have chosen automatic Provisioning Profile, I only had the option iOS Distribution and not iPhone Distribution c) Similar to b) but I have set App Store Distribution provisioning profile for WorkoutTests and WorkoutUITests d) I followed this guide http://basememara.com/submitting-apple-watch-apps-to-the-app-store/ and I have set the options like it is suggested, except for Workout WatchKit App where if I didn't chose any Provisioning Profile, Xcode gave me a compile error, so I put one.

I think all Certificates and App ID are ok, I think I am only messing up with Code Sign in. Every time I create the archive and press Upload to App Store after some work it appears this error.

enter image description here

I have also created a new iOS+watchOS project afraid of having accidentally changed some important settings, but nothing. I have also tried to create an Ad Hoc Distribution provisioning profile, nothing. I have also tried to upload the WatchKitApp version (while the above mentioned guide told to upload the iOS version), nothing. It is always been displaying the same error.

I do not know what to do, please help.

Additional information, I created the certificates, the App ID et cetera following the above mentioned guide http://basememara.com/submitting-apple-watch-apps-to-the-app-store/ so if you ask how have I done something (for instance what target I have compiled), in that (short) guide there are all the details.