Paywalls in Objective-c

  • 16 November 2023
  • 3 replies

Badge +1

I don’t know if paywalls do not work in objective-c or if I’m doing something wrong. Well it currently doesn’t work that way and crashes on initialisation:

RCPaywallViewController *paywallController = [[RCPaywallViewController alloc] init];

[self presentViewController:paywallController animated:YES completion:nil];

3 replies

Userlevel 4
Badge +8


It looks like they can be implemented in ObjC, but we don’t have a code example (yet)

In the meantime, you could take this SwiftUI example as a framework and translate it to ObjC (

Badge +1

I made it to work, like this:

        [[RCPurchases sharedPurchases] getOfferingsWithCompletion:^(RCOfferings *offerings, NSError *error) {

          if (offerings.current) {

              RCPaywallViewController *paywallController = [[RCPaywallViewController alloc] initWithOffering:offerings.current displayCloseButton:YES];

              [self presentViewController:paywallController animated:YES completion:nil];


          } else if (error) {

              [SentrySDK captureError:error];


            // optional error handling

              NSLog(@"Offerings error: %@", error);



But delegate doesn’t work. So I can’t get back info that user purchased subscription.


I ran in to this yesterday and submitted a PR to expose the delegate variable to Objective-C.