Skip to content

Commit

Permalink
Revert "Refactor watch target into single target"
Browse files Browse the repository at this point in the history
This reverts commit 422b91e.
  • Loading branch information
GianniCarlo committed Jul 6, 2023
1 parent 8dea123 commit 37d95c6
Show file tree
Hide file tree
Showing 51 changed files with 351 additions and 48 deletions.
270 changes: 235 additions & 35 deletions BookPlayer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "32">
launchAutomaticallySubstyle = "32"
notificationPayloadFile = "BookPlayerWatch Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "8">
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "BookPlayerWatch Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand All @@ -81,7 +82,8 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "8">
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "BookPlayerWatch Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
allowLocationSimulation = "YES"
notificationPayloadFile = "BookPlayerWatch Extension/PushNotificationPayload.apns">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto"
}
}
6 changes: 6 additions & 0 deletions BookPlayerWatch Extension/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
@main
struct BookPlayerApp: App {
// swiftlint:disable:next weak_delegate
@WKApplicationDelegateAdaptor var extensionDelegate: ExtensionDelegate
@WKExtensionDelegateAdaptor var extensionDelegate: ExtensionDelegate

@SceneBuilder var body: some Scene {
WindowGroup {
Expand Down
10 changes: 10 additions & 0 deletions BookPlayerWatch Extension/BookPlayerWatch Extension.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.$(BP_BUNDLE_IDENTIFIER).files</string>
</array>
</dict>
</plist>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import SwiftUI
import WatchKit

class ExtensionDelegate: NSObject, WKApplicationDelegate {
class ExtensionDelegate: NSObject, WKExtensionDelegate {
static var contextManager = ContextManager()

/// For some reason this never gets called
Expand Down
40 changes: 40 additions & 0 deletions BookPlayerWatch Extension/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BP_BUNDLE_IDENTIFIER</key>
<string>$(BP_BUNDLE_IDENTIFIER)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>BookPlayer</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>$(BP_BUNDLE_IDENTIFIER).watchkitapp</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.watchkit</string>
</dict>
<key>WKExtensionDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).ExtensionDelegate</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct ContainerItemListView: View {
if contextManager.items.isEmpty,
contextManager.isConnecting {
ProgressView()
} else if #available(watchOS 8.0, *) {
} else if #available(watchOSApplicationExtension 8.0, *) {
ItemListView()
.navigationTitle("recent_title")
.navigationBarTitleDisplayMode(.inline)
Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions BookPlayerWatch Extension/PushNotificationPayload.apns
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"aps": {
"alert": {
"body": "Test message",
"title": "Optional title",
"subtitle": "Optional subtitle"
},
"category": "myCategory",
"thread-id":"5280"
},

"WatchKit Simulator Actions": [
{
"title": "First Button",
"identifier": "firstButtonAction"
}
],

"customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App."
}
8 changes: 2 additions & 6 deletions BookPlayerWatch/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BP_BUNDLE_IDENTIFIER</key>
<string>$(BP_BUNDLE_IDENTIFIER)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand All @@ -22,16 +20,14 @@
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>WKApplication</key>
<true/>
<key>WKCompanionAppBundleIdentifier</key>
<string>$(BP_BUNDLE_IDENTIFIER)</string>
<key>WKWatchKitApp</key>
<true/>
</dict>
</plist>

0 comments on commit 37d95c6

Please sign in to comment.