Storekit2 Looking in the prebuilt native libraries...
# ios
m
Storekit2 Looking in the prebuilt native libraries (for 2.2.20) it looks (to my not very experienced eye) that the library only contains StoreKit1 definitions, they're SK<Name> structures rather than just <Name>, for example there's no "Product" structure, only "SKProduct". Presumably this explains why I can't import platform.storekit.Product into the isoMain folder of my shared module. Have I just misunderstood? Where are the storekit2 definitions?
a
Hello there. StoreKit2 is a Swift-only framework, IIRC. And Kotlin have no support for importing Swift declarations. Please vote for the according ticket if you need this functionality.
👍 1
m
Thanks for that @Artem Olkov, I've voted for it. StoreKit2 (Apple's preferred i/f for 4 years now) relies on try/await. Presumably I could just call functions containing a call like this in the iosApp module from suspend functions in iosMain and all will be pretty straight forward...
a
There are always 2 approaches to import swift code: 1/ define an interface on kotlin side, implement it on swift side, pass in back to kotlin via any DI 2/ wrap original swift code into an Objective-C code (swift wrappers marked as
@objc
is good enough) and pass this wrapper through cinterop back to kotlin (there are helpers to do that, like, https://github.com/frankois944/spm4Kmp )
🙏 1
❤️ 1