Watchkit is extension to you iOS app.
To add watchkit to app follow below steps(1.File new target watchkit app which will add wathkitapp and WatchKit extension to your app.
add a new WatchKit app target, which configures the bundles and initial resources for your WatchKit app and WatchKit extension.
Those bundles are then delivered as part of your iOS app on the App Store.):-
1. In Xcode, open the project for your iOS app.
2. Select File > New > Target, and navigate to the Apple Watch section.
3. Select WatchKit App, then click Next.
4. If you plan to implement a glance or custom notification interface, select the appropriate checkboxes.
For notification interfaces, it is recommended that you select the Include Notification Scene checkbox, even if you do not plan on implementing that interface right away. Selecting that checkbox adds an additional file to your project for debugging your notification interfaces. If you do not select that option, later you must create the file manually.
4. If you plan to implement a glance or custom notification interface, select the appropriate checkboxes.
For notification interfaces, it is recommended that you select the Include Notification Scene checkbox, even if you do not plan on implementing that interface right away. Selecting that checkbox adds an additional file to your project for debugging your notification interfaces. If you do not select that option, later you must create the file manually.
5. Click Finish.
WatchKit development requires the iOS 8.2 SDK or later.
The bundle IDs for both new targets are configured automatically, based on the bundle ID of your iOS app. The base IDs for all three bundles must match; if you change your iOS app’s bundle ID, you must update the other bundle IDs accordingly.
Adding a WatchKit App target to your Xcode project creates two new executables and updates your project’s build dependencies. Building your iOS app builds all three executables (the iOS app, WatchKit extension, and WatchKit app) and packages them together. Xcode also creates a build scheme specifically for building and debugging only your WatchKit app.
The Build, Run, and Debug Process select watchkitapp as as target and run
If you are using notification then follow below steps
To configure custom build schemes for glances and notifications
- Select your existing WatchKit app scheme.
- From the scheme menu, select Edit Scheme.
-
The Build, Run, and Debug Process select watchkitapp as as target and runIf you are using notification then follow below stepsTo configure custom build schemes for glances and notifications
- Select your existing WatchKit app scheme.
- From the scheme menu, select Edit Scheme.
- Specifying a Notification Payload for TestingThe payload itself is a file that you create with a .apns filename extension.The PushNotificationPayload.apns file contains most of the keys you need to simulate a remote notification, and you can add more keys as needed. Figure 2-2 shows the default JSON file that comes with your project.
0 comments:
Post a Comment