tikhop / Mercato

Lightweight StoreKit 2 Wrapper
MIT License
66 stars 13 forks source link

watchOS compilation errors #3

Open ticky opened 2 years ago

ticky commented 2 years ago

This library looks perfect for my fairly simple independent watchOS app's needs, thanks for sharing!

Unfortunately, v0.0.1, as well as the current HEAD revision, don't build under a watchOS deployment target, giving these errors;

Mercato/Sources/Mercato/Mercato.swift:56:59: Cannot find type 'UIWindowScene' in scope
Mercato/Sources/Mercato/Mercato.swift:118:72: Cannot find type 'UIWindowScene' in scope
Mercato/Sources/Mercato/Mercato.swift:125:73: Cannot find type 'UIWindowScene' in scope
Mercato/Sources/Mercato/Mercato.swift:134:55: Cannot find type 'UIWindowScene' in scope
Mercato/Sources/Mercato/Mercato.swift:61:39: Value of type 'Transaction' has no member 'beginRefundRequest'
Mercato/Sources/Mercato/Mercato.swift:136:22: Type 'AppStore' has no member 'showManageSubscriptions'

(paths trimmed for clarity)

I've seen these errors both in my actual project, and in an out of the box Swift-based Xcode watchOS app project template, each with Mercato imported using Xcode's package management UI

My experience isn't deep in writing this sort of cross-platform code, but it seems as though the code specific to iOS isn't guarded sufficiently for the watchOS platform. If you have suggestions I'm all ears!

tikhop commented 2 years ago

Hi @ticky, I don't think it's still relevant, but I'm planing to make some improvements in a week.

tikhop commented 2 years ago

@ticky I see that you forked the project and made some fixes. It would be awesome, if you have a chance to make a PR. Thank you!

ticky commented 2 years ago

I'm not highly experienced at this, and couldn't get it working without just brute-force removing everything that wasn't implemented on watchOS https://github.com/ticky/Mercato/commit/6be6e66270357ac65528a126868ff6e20f73d2d5 so I'm not sure that's a great PR for your project 😅