By using the following code, I can receive PurchasesDelegate callback, when user subscribes to a free trial plan.
However, I am not able to receive PurchasesDelegate callback, when user cancels the free trial plan.
class AppDelegate: UIResponder, UIApplicationDelegate {
// https://www.revenuecat.com/docs/integrations/attribution/apple-search-ads
// https://www.revenuecat.com/docs/integrations/attribution/facebook-ads#3-send-revenuecat-events-into-facebook-ads-manager
private func initRevenueCat() {
Purchases.configure(with:
.init(withAPIKey: "appl_???")
.with(
purchasesAreCompletedBy: .myApp,
storeKitVersion: .storeKit2
)
)
Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()
// Automatically collect the $idfa, $idfv, and $ip values
Purchases.shared.attribution.collectDeviceIdentifiers()
// REQUIRED: Set the Facebook anonymous Id
Purchases.shared.attribution.setFBAnonymousID(FBSDKCoreKit.AppEvents.shared.anonymousID)
Purchases.shared.delegate = self
}
}
extension AppDelegate: PurchasesDelegate {
func purchases(_ purchases: Purchases, receivedUpdated customerInfo: CustomerInfo) {
// handle any changes to customerInfo
}
}
May I know how I can fix this? Thanks.