Tag: watchkit

Watchkit地图:显示当前位置

我已经提出申请,在哪里我们可以计算目前的位置在扩展应用程序,我想显示在手表。 这个怎么做? 有一种方法只显示不同颜色的针。

使用WatchKit进行开发时,部署目标必须是8.2吗?

现在,Xcode 6.2和SDK 8.2被发布了。 我想开发基于iOS应用程序的Watch App,部署目标是7.0,如果我想开发我的Watch应用程序,我必须将部署目标设置为8.2吗?

如何从iphone设备传递一些消息或string到配对的苹果手表

我想知道一个特定的消息或string可以从我的iPhone设备传递给配对的iWatch。 我真的很想知道这是如何从发展的angular度来处理的。 是否有任何特定的WKInterfaceController方法或API将信息从iPhone传递给iWatch? 我在开发者论坛上看到openParentApplication:回复:从iWatch和应用程序通知iPhone应用程序:handleWatchKitExtensionRequest:回复在iPhone上处理特定的通知请求。 但是我想要相反。 比方说,我有一个UITextField和UIButton的iPhone应用程序故事板场景。 用户input“你好!” 在文本字段上,并点击button。 现在,我在同一个项目中使用了一个iwatch故事板。 这个故事板场景有一个“WKInterfaceLabel”。 我想让我的iPhone控制器与WKInterfaceController进行交互,以便在iPhone上input消息(本例中的“Hello!”)可以传递给iWatch控制器并显示在iWatch上。

本地通知只能振动苹果手表而不发声吗?

我想在电话上安排一个本地通知。 当手机被locking,手表正在睡眠时,我想通知振动手表,但不发声。 这可能吗? 我的下面的代码运行在iPhone上安排通知,但不知道如何抑制在手表上播放声音。 UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.fireDate = [[NSDate date] dateByAddingTimeInterval:60]; notification.alertTitle = [NSString stringWithFormat:@"Hi # %d", i]; notification.alertBody = @"Hello!"; notification.soundName = UILocalNotificationDefaultSoundName; [[UIApplication sharedApplication] scheduleLocalNotification:notification];

在苹果手表中调用URL的最佳做法是什么?

从Apple Watch调用API的最佳做法是什么? 使用苹果手表的sendMessage“watchConnectivity”到iPhone来调用API 要么 使用NSURLSession从手表本身调用API?

苹果手表CMDeviceMotion不给我很好的阅读

目前,我只是logging一堆运动数据并将其保存到文件中。 但是,当我绘制数据时,我很难相信我正在读取正确的数据。 这是我的手表代码: – (IBAction)startStopRecording { if (!recording){ NSLog(@"starting to record"); recording = YES; data = [[NSMutableArray alloc] init]; [self.startRecording setTitle:@"Stop Recording"]; if (self.motionManager.deviceMotionAvailable) { [self.motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion *motion, NSError *error) { [data addObject:[NSString stringWithFormat:@"%f, %f, %f, %f, %f, %f, %f, %f, %f", motion.attitude.pitch, motion.attitude.roll, motion.attitude.yaw, motion.userAcceleration.x, motion.userAcceleration.y, motion.userAcceleration.z, motion.rotationRate.x, motion.rotationRate.y, motion.rotationRate.z]]; NSLog(@"."); }]; […]

打开父应用程序(WatchOS 2.x +)

我试图从父应用程序获取更新,但是当Apple Watch发送请求时,我不想将父应用程序放到前台。 我最终希望将父应用程序置于后台状态,让它运行所需的方法并将其发送回手表。 具体来说,有没有办法打开父应用程序,并让它暂时驻留在WatchOS 2.0 +的后台状态? 我已经看过这个: [WKInterfaceController openParentApplication:[NSDictionary new] reply:nil]; 但是,这显然无法启动Watch OS 2.0。 (家长应用)应用委托: @interface InterfaceController() <WCSessionDelegate> @property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *networkConnectionLabel; @end @implementation InterfaceController – (void)awakeWithContext:(id)context { [super awakeWithContext: context]; } – (void) willActivate { [super willActivate]; [self startSessionToParentDevice]; } – (void) startSessionToParentDevice { if ([WCSession isSupported]) { [[WCSession defaultSession] setDelegate: self]; […]

与WatchKit一起使用Firebase

我正在尝试在watchKit应用程序中使用Firebase数据库。 我已经在我的iPhone应用程序上开发了这个function,但是发现很难在我的Watch应用程序上做同样的事情。 当我试图在手表应用程序中将Firebase导入到VC类中时,它会创build一个no such module 'firebase'的错误。 是否有可能在手表应用程序内使用Firebase?

identifierForVendor或类似的watchOS(2.0+)

在watchOS(2.X)上有替代identifierForVendor吗? 我一直在阅读文档,但看起来没有任何类似的方法来识别设备。 谢谢!

应该更新现有的watchOS应用程序吗?

https://developer.apple.com/news/?id=04222016a 上面的博客文章说“所有新的watchOS应用程序提交”。 参考这篇博文。 我应该更新我现有的watchOS 1应用程序吗? 我可以更新我的主应用程序,离开watchOS1应用程序,因为它是?