I’m trying to set up Purchases on a watchOS app which has a companion iOS app.
I thought I could consume a Swift package for multiple targets at the same time but as per this post on SO it’s not quite straightforward as I thought it would be.
I followed Diego Carrera’s solution and added the Purchases framework in the Watch extension like this:
General tab, and in Frameworks, Libraries and Embedded Content press +, select the package and press Add
This did the trick for me and on my Watch App Extension I can finally see the import Purchases option.
I also added a shared singleton class to manage Purchases’ delegate, both for the iOS and the watchOS app. There, I configure everything, set the delegate to self and retrieve the purchaser info.
This is all good if I run everything on the iOS app but when I do the same on my watch, Purchases won’t work and I get no information at all:
<PurchaserInfo
originalApplicationVersion: (null),
latestExpirationDate: (null)
activeEntitlements: {
},
activeSubscriptions: {
},
nonConsumablePurchases: {(
)},
requestDate: 2022-02-21 13:39:30 +0000
firstSeen: 2022-02-21 13:39:00 +0000,
originalAppUserId: $RCAnonymousID:ec49...,
entitlements: {
},
>
What am I doing wrong? Is this the right way to set up Purchases on WatchOS?
Thank you!
My specs:
MacOS Big Sur 11.6.2
Xcode: 13.2.1
Purchases: 3.14.1