watchkit

Playing sound in Apple Watchkit

时间秒杀一切 提交于 2019-11-28 07:22:42
问题 I'm trying to play a sound through the watchkit extension using WKAudioFilePlayer however no sound gets played. I'm using the haptic feedback code as a sort of debug to be sure it executes it (which it does). As a side note, mute is not on and the filename is correct. NSURL *falcon = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"falcon" ofType:@"mp3"]]; WKAudioFileAsset *asset = [WKAudioFileAsset assetWithURL:falcon]; WKAudioFilePlayerItem *sound = [WKAudioFilePlayerItem

Apple Watch, WatchKit Extension and main application

余生长醉 提交于 2019-11-28 07:03:54
There is main application with logic and we extend app to Apple Watch. After adding target xCode creates 2 more applications: extension with code and watch kit application. Question: How code from extension can reuse logic of ready and already made main iOS app? How extension app can communicate with main App and send commands. To communicate to the containing iPhone app you can use (BOOL)openParentApplication:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *replyInfo, NSError *error))reply In your WKInterfaceController From the Apple Docs Use this method to communicate with your

WatchKit: unable to find interface controller class

笑着哭i 提交于 2019-11-28 06:48:04
I tried adding an interface controller to a storyboard, setting its Custom Class to a WKInterfaceController subclass, launched the app in the simulator and navigated to the specified interface controller. When I do so, I get the following error: WatchKit error - unable to find interface controller class 'TestController' to instantiate If I try to interact with the controller (e.g. try launching its button's action), I get the following error: *********** ERROR -[SPRemoteInterface _interfaceControllerClientIDForControllerID:] clientIdentifier for interfaceControllerID:(null) not found *********

How to Handle Action Buttons in Push Notifications

让人想犯罪 __ 提交于 2019-11-28 06:01:36
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 the action button is the only option for Apple Watch, How to send it from server in Notification

iPhone and Apple Watch not sharing App Group

一笑奈何 提交于 2019-11-28 05:22:13
问题 I've been pulling my hair out over this problem for two days now. I generate a small movie file in the iPhone App that I want to send from the iPhone to play on an Apple Watch. As I proof of concept, I put a similar .mov in the Bundle of the Apple Watch App and was able to play it with no problems. So I figured, easy peasy, now when I want to send a new little clip to the watch, I will just put it in an App Group Shared container and access it from there instead of from the Bundle. Nope! I

How to simulate the Local Notification in apple Watch App?

﹥>﹥吖頭↗ 提交于 2019-11-28 05:03:25
I am trying to simulate the local notification view in apple watch simulator. Does any one known how to simulate the local notifications in apple watch ? I have done some research for that but didn't found any answer for the above. There is a way to simulate the PUSH NOTIFICATION but not for the LOCAL NOTIFICATION. It is not possible to have a Watch app react to a UILocalNotification in the simulator. However, it is almost identical to reacting to a push notification, except it gets routed through a couple of different methods. If you're presenting an actionable notification, your

Apple Watch: dynamic Long Look not shown, when push opened from Notification Center

半城伤御伤魂 提交于 2019-11-28 03:43:38
问题 I implemented a custom dynamic Long Look for push notifications on the Apple Watch. This dynamic long look is shown correctly, when I immediately raise my arm after receiving a push notification. However, if I respond later, and tap on the push notification from within Notification Center on the Watch, only the static long look is shown. Is this normal behavior or am I doing something wrong? How are your dynamic long looks behaving? For clarity here are the steps to reproduce . This will

Notify WatchKit app of an update without the watch app requesting it

心不动则不痛 提交于 2019-11-28 03:36:25
I'm aware of the capabilities of WKInterfaceController openParentApplication and handleWatchKitExtensionRequest methods for the watch app to open the parent app and send/receive data. But how about this... In the instance where the user is using the parent app and performs an action in the parent app (ie changes the color of the background), how would I notify the watch app immediately and perform the relevant action on the watch also? I believe MMWormhole would suffice in this example, is this is the best approach I should take or is there an alternative? Background First off all let's sum up

Watchkit AppIcon - The app icon set named “AppIcon” did not have any applicable content

谁说我不能喝 提交于 2019-11-28 03:22:39
There is the Images.xcassets file in my WatchKit App. As soon as I put any icon in that asset build failed with the error message: "The app icon set named "AppIcon" did not have any applicable content." This is an easy method to generate your WatchKit icons, which worked well for me: Upload a source image to http://makeappicon.com Go to Images.xcassets in the WatchKit app Right click on the pane which includes AppIcon, select "Import...", and choose the watchkit folder that makeappicon.com generated for you Most likely your watchKit app icons are not of the correct size. You need the following

WatchKit Extension bundle identifiers

前提是你 提交于 2019-11-28 03:15:21
I am trying to build my app but it failed. I am shown the message below. error: WatchKit Extension doesn't contain any WatchKit apps whose bundle identifiers match "com.domain.appname.watchkitapp". Verify that the value of WKAppBundleIdentifier in your WatchKit Extension's Info.plist matches the value of CFBundleIdentifier in your WatchKit App's Info.plist. I have recently changed "com.domain.appname.watchkitapp" to "com.domain.differentappname.watchkitapp" . I cannot find where to change this. Dejan Skledar You have to be careful when changing the bundle identifiers, here's how they should be