Skip to content
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

watchOS: fixed crash when ran on single-target apps with Xcode 14 and before watchOS 9.0 #1895

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

NachoSoto
Copy link
Contributor

@NachoSoto NachoSoto commented Sep 8, 2022

Follow up to #1849. That fix was incomplete, and still crashed when ran before watchOS 9.0.
Fixes SDKONCALL-119 and CSDK-416 and #1891.

There are 3 variables we need to take into account:

  • watchOS version
  • Xcode version
  • Dual/single target app
watchOS Xcode Dual / Single target Before PR With this PR
< 9.0 < 14.x Single WKExtension WKExtension
< 9.0 < 14.x Dual N/A N/A
< 9.0 >= 14.0 Single crash ⚠️ always false
< 9.0 >= 14.0 Dual WKApplication WKExtension
>= 9.0 >= 14.0 Single WKApplication WKApplication
>= 9.0 >= 14.0 Dual WKApplication WKApplication

@NachoSoto NachoSoto added the fix A bug fix label Sep 8, 2022
@NachoSoto NachoSoto requested a review from a team September 8, 2022 17:53
…nd before watchOS 9.0

Follow up to #1849. That fix was incomplete, and still crashed when ran before watchOS 9.0.
Fixes [SDKONCALL-119] and [CSDK-416] and #1891.

There are 3 variables we need to take into account:
- `watchOS` version
- Xcode version
- Dual/single target app

| watchOS       | Xcode     | Dual / Single target | Before PR          | With this PR      |
|---------------|-----------|----------------------|--------------------|-------------------|
| < 9.0         | < 14.x    | Single               | `WKExtension`      | `WKExtension`     |
| < 9.0         | < 14.x    | Dual                 |  N/A               |     N/A           |
| < 9.0         | >= 14.0   | Single               | crash ⚠️    |  always `false`   |
| < 9.0         | >= 14.0   | Dual                 | `WKApplication`    | `WKExtension`     |
| >= 9.0        | >= 14.0   | Single               | `WKApplication`    | `WKApplication`   |
| >= 9.0        | >= 14.0   | Dual                 | `WKApplication`    | `WKApplication`   |
Copy link
Member

@aboedo aboedo left a comment

Choose a reason for hiding this comment

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

"so before watchOS 9.0 for a single-target app you can't get the state but then for watchOS 9 it works if you get it from WKApplication, then again before 9.0 in dual-target you can use WKExtension and..."
image

@NachoSoto
Copy link
Contributor Author

Yeah that gif was me this morning 🙃

@NachoSoto NachoSoto merged commit e2d4d29 into main Sep 8, 2022
@NachoSoto NachoSoto deleted the watchos-single-target-crash branch September 8, 2022 20:10
NachoSoto pushed a commit that referenced this pull request Sep 8, 2022
**This is an automatic release.**

### Bugfixes
* `watchOS`: fixed crash when ran on single-target apps with Xcode 14 and before `watchOS 9.0` (#1895) via NachoSoto (@NachoSoto)
* `CustomerInfoManager`/`OfferingsManager`: improved display of underlying errors (#1888) via NachoSoto (@NachoSoto)
* `Offering`: improved confusing log for `PackageType.custom` (#1884) via NachoSoto (@NachoSoto)
* `PurchasesOrchestrator`: don't log warning if `allowSharingAppStoreAccount` setting was never explicitly set (#1885) via NachoSoto (@NachoSoto)
* Introduced type-safe `PurchasesError` and fixed some incorrect returned error types (#1879) via NachoSoto (@NachoSoto)
* `CustomerInfoManager`: fixed thread-unsafe implementation (#1878) via NachoSoto (@NachoSoto)
### New Features
* Disable SK1's `StoreKitWrapper` if SK2 is enabled and available (#1882) via NachoSoto (@NachoSoto)
* `Sendable` support (#1795) via NachoSoto (@NachoSoto)
### Other Changes
* Renamed `StoreKitWrapper` to `StoreKit1Wrapper` (#1886) via NachoSoto (@NachoSoto)
* Enabled `DEAD_CODE_STRIPPING` (#1887) via NachoSoto (@NachoSoto)
* `HTTPClient`: added `X-Client-Bundle-ID` and logged on SDK initialization (#1883) via NachoSoto (@NachoSoto)
* add link to SDK reference (#1872) via Andy Boedo (@aboedo)
* Added `StoreKit2Setting.shouldOnlyUseStoreKit2` (#1881) via NachoSoto (@NachoSoto)
* Introduced `TestLogHandler` to simplify how we test logged messages (#1858) via NachoSoto (@NachoSoto)
* `Integration Tests`: added test for purchasing `StoreProduct` instead of `Package` (#1875) via NachoSoto (@NachoSoto)
* `ErrorUtils`: added test to verify that returned errors can be converted to `ErrorCode` (#1871) via NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants