apple-watch

Launch host app from watch app

断了今生、忘了曾经 提交于 2019-11-27 11:45:30
问题 I know that the openParentApplication api in watch kit extension can open the host app in the background but not in the foreground. I also tried using openUrl() api of NSExtensionContext as below: NSExtensionContext *ctx = [[NSExtensionContext alloc] init]; NSURL *url = [NSURL URLWithString:@"myScheme://today"]; [ctx openURL:url completionHandler:^(BOOL success) { NSLog(@"fun=%s after completion. success=%d", __func__, success); }]; [ctx completeRequestReturningItems:ctx.inputItems

How to wake up iPhone app from watchOS 2?

妖精的绣舞 提交于 2019-11-27 11:20:31
问题 I have an app that has a very rich network layer and my apple watch app depends on all the models. Unfortunately the app is not modular enough to make this layer available in the watch app. I solved this problem by using openParentApplication: to wake up the iPhone app, perform the request and give back the results. In watchOS 2 this method is gone and I should use WatchConnectivity. The best way to use this would be by sending userInfo dictionaries. But how can I wake up the iPhone app to

Non-Public Library SockPuppetGizmo

早过忘川 提交于 2019-11-27 10:01:47
问题 I got an email that my latest binary submission to Apple for an iOS/Watch OS app was invalid due to: The app links to non-public libraries in PlugIns/iPrayed.appex/iPrayed WatchKit App.app/_WatchKitStub/WK: /System/Library/PrivateFrameworks/SockPuppetGizmo.framework/SockPuppetGizmo I have submitted this build before without any issues, and only made a couple of changes to a few lines of code, without adding anything at all. Any clue what this is about? 回答1: Seems to be working now. Submission

Debug on real Apple Watch: Application Verification Failed

倖福魔咒の 提交于 2019-11-27 07:02:47
I tried to debug my WatchKit app on a real Apple Watch today. After hitting the Debug button in Xcode, the main iPhone app was installed properly, but the Apple Watch only displayed the message Failed to install xxx, error: Application Verification Failed . The WatchKit app doesn't install. I was aware of this: WatchKit App Rejected for "Failing to Install" , but it didn't help because my Xcode project file is alright. How to make debug work on a real Apple Watch? It turns out you also have to add the UDID of the Apple Watch to the Apple Developer Portal, and update your Development

How to Handle Action Buttons in Push Notifications

岁酱吖の 提交于 2019-11-27 05:38:13
问题 Working on Apple Watch Notifications:- so if i add button in Notification Interface (from object Lib) then the error is : Buttons are not Supported in Notification Interface PushNotificationPayload.apns has the WatchKit Simulator Actions Like This : "WatchKit Simulator Actions": [ { "title": "View", "identifier": "firstButtonAction" } ], and the Simulator Shows this to me Now my Question is, How can I Handle this View Button when send a PushNotification from server, If the aps file contain

Is transferCurrentComplicationUserInfo more suitable for complication update?

送分小仙女□ 提交于 2019-11-27 04:56:12
What is the difference between transferCurrentComplicationUserInfo and transferUserInfo ? I want to send data from my AppDelegate to a clock kit complication. transferCurrentComplicationUserInfo seems to do exactly the same thing as transferCurrentUserInfo . Am I missing something? The distinction between these two WCSession methods involve when the data is sent, and whether the watchkit extension is woken up or not. transferCurrentComplicationUserInfo: is specifically designed for transferring complication user info meant to be shown on the watch face right now. The complication user info is

FBSOpenApplicationErrorDomain Code=3

淺唱寂寞╮ 提交于 2019-11-27 03:01:29
问题 I just added a Watch app to my project and try : override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) let res = WKInterfaceController.openParentApplication(["key" : "value"]) { (replyInfo, error) -> Void in print("replyInfo : \(replyInfo) + error \(error)") } print(res) // true here } In my AppDelegate I wrote : func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: ([NSObject : AnyObject]?) ->

How to calculate current location in WatchKit extension

随声附和 提交于 2019-11-27 02:23:34
问题 How to calculate the current user location in Watch Kit extension as we can't use CoreLocation in watch kit. Thanks in advance 回答1: You can use CoreLocation in your watch app extension very similarly to how you use it in your iPhone app. The key difference is that a user can't authorize your extension to have access to Core Location. They will need to do that from your iPhone app. So you will need to check if the user has authorized location services for your app and if they haven't, you will

Watchkit , openParentApplication with WatchKit Extension

风格不统一 提交于 2019-11-27 02:18:55
First times doesn't work "Null" ( before open App in iPhone ) and some times doesn't work but i want one loop or timer for repeat this request for get result : here is my code - (void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply { // Temporary fix, I hope. // -------------------- __block UIBackgroundTaskIdentifier bogusWorkaroundTask; bogusWorkaroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ [[UIApplication sharedApplication] endBackgroundTask:bogusWorkaroundTask

Send messages between iOS and WatchOS with WatchConnectivity in watchOS2

会有一股神秘感。 提交于 2019-11-27 01:29:38
I watched the WWDC2015 and saw that you can develop native apps on the watch now. This opened up a lot of capabilities and I am wondering how I could send data between my iOS app and my AppleWatch app. I saw that there is a new framework called WatchConnectivity. How can I use this and what are my options when sending data back and forth? Philip WatchConnectivity First the two classes that are supposed to communicate with each other (iOS and watchOS) need to conform the <WCSessionDelegate> and #import the WatchConnectivity framework Before you can send data you need to check if your device is