Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/abtesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: macOS-latest
strategy:
matrix:
target: [ios, tvos, macos]
target: [ios, tvos, macos, watchos]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remoteconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

strategy:
matrix:
target: [ios, tvos, macos]
target: [ios, tvos, macos, watchos]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
Expand Down
3 changes: 3 additions & 0 deletions Example/watchOSSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ target 'SampleWatchAppWatchKitExtension' do
pod 'FirebaseCoreDiagnostics', :path => '../../'
pod 'FirebaseInstallations', :path => '../../'
pod 'FirebaseStorage', :path => '../../'
pod 'FirebaseRemoteConfig', :path => '../../'
pod 'FirebaseABTesting', :path => '../../'


end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,42 @@ import WatchKit

import FirebaseCore
import FirebaseMessaging
import FirebaseRemoteConfig

/// Entry point of the watch app.
class ExtensionDelegate: NSObject, WKExtensionDelegate, MessagingDelegate {
/// Initialize Firebase service here.
func applicationDidFinishLaunching() {
FirebaseApp.configure()
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert, .sound]) { granted, error in
center.requestAuthorization(options: [.alert, .sound]) { granted, _ in
if granted {
WKExtension.shared().registerForRemoteNotifications()
}
}
Messaging.messaging().delegate = self
let remoteConfig = RemoteConfig.remoteConfig()
remoteConfig.fetchAndActivate { _, error in
guard error == nil else {
print("error:" + error.debugDescription)
return
}
let defaultOutput = "You have not set up a 'test' key in Remote Config console."
let configValue: String =
remoteConfig["test"].stringValue ?? defaultOutput
print("value:\n" + configValue)
}
}

/// MessagingDelegate
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
print("token:\n" + fcmToken)
func messaging(_: Messaging, didReceiveRegistrationToken fcmToken: String?) {
print("token:\n" + fcmToken!)
Messaging.messaging().subscribe(toTopic: "watch") { error in
if error != nil {
guard error == nil else {
print("error:" + error.debugDescription)
} else {
print("Successfully subscribed to topic")
return
}
print("Successfully subscribed to topic")
}
}

Expand Down
13 changes: 10 additions & 3 deletions FirebaseABTesting.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ Firebase Cloud Messaging and Firebase Remote Config in your app.
}

s.social_media_url = 'https://twitter.com/Firebase'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
ios_deployment_target = '10.0'
osx_deployment_target = '10.12'
tvos_deployment_target = '10.0'
watchos_deployment_target = '6.0'

s.ios.deployment_target = ios_deployment_target
s.osx.deployment_target = osx_deployment_target
s.tvos.deployment_target = tvos_deployment_target
s.watchos.deployment_target = watchos_deployment_target

s.cocoapods_version = '>= 1.4.0'
s.prefix_header_file = false
Expand All @@ -44,6 +50,7 @@ Firebase Cloud Messaging and Firebase Remote Config in your app.

s.test_spec 'unit' do |unit_tests|
unit_tests.scheme = { :code_coverage => true }
unit_tests.platforms = {:ios => '10.0', :osx => '10.12', :tvos => '10.0'}
unit_tests.source_files = 'FirebaseABTesting/Tests/Unit/**/*.[mh]'
unit_tests.resources = 'FirebaseABTesting/Tests/Unit/Resources/*.txt'
unit_tests.requires_app_host = true
Expand Down
3 changes: 3 additions & 0 deletions FirebaseABTesting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# unreleased
- [added] Added community support for watchOS. (#7481)

# v7.0.0
- [removed] Removed `FIRExperimentController.updateExperiments(serviceOrigin:events:policy:lastStartTime:payloads:)`, which was deprecated. (#6543)

Expand Down
12 changes: 9 additions & 3 deletions FirebaseRemoteConfig.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ app update.
:tag => 'CocoaPods-' + s.version.to_s
}
s.social_media_url = 'https://twitter.com/Firebase'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
ios_deployment_target = '10.0'
osx_deployment_target = '10.12'
tvos_deployment_target = '10.0'
watchos_deployment_target = '6.0'

s.ios.deployment_target = ios_deployment_target
s.osx.deployment_target = osx_deployment_target
s.tvos.deployment_target = tvos_deployment_target
s.watchos.deployment_target = watchos_deployment_target

s.cocoapods_version = '>= 1.4.0'
s.prefix_header_file = false
Expand Down
3 changes: 3 additions & 0 deletions FirebaseRemoteConfig/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# unreleased
- [added] Added community support for watchOS. (#7481)

# v7.6.0
- [fixed] Fixed build warnings introduced with Xcode 12.5. (#7432)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ macOS/tvOS/watchOS/Catalyst.
To install, add a subset of the following to the Podfile:

```
pod 'Firebase/ABTesting' # No watchOS support yet
pod 'Firebase/ABTesting'
pod 'Firebase/Auth' # Limited watchOS support
pod 'Firebase/Crashlytics'
pod 'Firebase/Database' # No watchOS support yet
pod 'Firebase/Firestore' # No watchOS support yet
pod 'Firebase/Functions' # No watchOS support yet
pod 'Firebase/Messaging'
pod 'Firebase/Performance' # No macOS, tvOS, watchOS, and Catalyst support yet
pod 'Firebase/RemoteConfig' # No watchOS support yet
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
```

Expand Down