Skip to content

Add support for watchOS #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

daltonclaybrook
Copy link
Contributor

Resolves #388

This PR updates the SDK to include support for watchOS. It also adds a new demo project for Watch that demonstrates the use of the SDK on that platform. The only consequential change to the SDK is the addition of a new type: WatchBackgroundNotifier. The doc comment in that file explains its purpose:

watchOS adds support for background notifications in watchOS 7.0 with WKExtension.applicationDidEnterBackgroundNotification and related notifications. But since this SDK is backward-compatible with watchOS 3.0, these notifications are not available. Instead, the user should implement the appropriate background methods on their Extension Delegate and call the WatchBackgroundNotifier from those methods.

Because this notifier is only used on watchOS, the file structure has been changed slightly to include a Shared folder and a watchOS folder, and the Podspec has been updated to include the appropriate paths for supported platforms. Please let me know if you have another idea about how to solve this problem. Also, feel free to make changes to this branch as you see fit.

@jaeopt
Copy link
Contributor

jaeopt commented Feb 23, 2021

@daltonclaybrook Thanks for your contribution. We'll take a look at it.
If not done yet, can you sign our CLA?
https://github.com/optimizely/swift-sdk/blob/master/CONTRIBUTING.md

@daltonclaybrook daltonclaybrook force-pushed the dalton_c/watchos-support branch from f5c1ece to 730312b Compare February 25, 2021 17:24
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daltonclaybrook The changes and additions for watchOS look great!
One changes I pushed is to change the source structure (bring down "watchOS" codes inside the source module).

Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jaeopt jaeopt merged commit 5301725 into optimizely:master Mar 11, 2021
@daltonclaybrook daltonclaybrook deleted the dalton_c/watchos-support branch March 11, 2021 17:34
@daltonclaybrook daltonclaybrook restored the dalton_c/watchos-support branch March 11, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for watchOS
2 participants