Skip to main content
Question

Payflow unexpectedly comes in portrait, when my app and paywall is in landscape


Forum|alt.badge.img+4

My app and pawwall is in landscape. I want the payflow, when I click ‘subscribe’ in my paywall to come in landscape too. However, it is coming in portrait. How do I change? Here’s my code

 

#ifndef PAID_APP

-(IBAction)premiumButtonPressed:(id)sender{

    NSLog(@"premiumButtonPressed");

    

    // Start Progress

    [progressIndicator startAnimating];

    

#ifndef PAID_APP

    [FIRAnalytics logEventWithName:@"ShopViewController"

                        parameters:@{@"ShopPremiumButtonPressed": @"Monthly"}];

#endif

    

    

    

    // TEST HARNESS

    //[self processPremiumSubscriber];

    //return;

    // TEST END

    

    NSLog(@"RevenueCat - Purchase monthly product called");

    

    [progressIndicator startAnimating];

    

    [[RCPurchases sharedPurchases] purchaseProduct:rcStoreMonthlyProduct withCompletion:^(RCStoreTransaction *transaction, RCCustomerInfo *customerInfo, NSError *error, BOOL cancelled) {

     

        //if (customerInfo.entitlements.all[@"your_entitlement_id"].isActive) {

            // User is "premium"

        //}

       

        [progressIndicator stopAnimating];

        

        NSLog(@"RevenueCat - Purchase monthly product completed cancelled:%d error:%@",cancelled,error);

        

        // Need to show message

        if (error!=nil){

            

#ifndef PAID_APP

    [FIRAnalytics logEventWithName:@"ShopViewController"

                        parameters:@{@"ShopPurchaseMonthly":  [NSString stringWithFormat:@"Error:\n%ld",(long)error.code] }];

#endif

                       

            [self showErrorAlert:[NSString stringWithFormat:@"Sorry but subscribing failed.\n\nError:%@ %ld\n\nPlease try again later." ,error.domain,error.code]];

        }

        

        if (customerInfo.entitlements[REVENUECAT_PREMIUM_ENTITLEMENT].isActive) {

            

            NSLog(@"RevenueCat - Purchase monthly product completed and active.");

            

            // Unlock that great "pro" content

            [self processPremiumSubscriber];

        }

        else{

#ifndef PAID_APP

    [FIRAnalytics logEventWithName:@"ShopViewController"

                        parameters:@{@"ShopPurchaseMonthly": @"Not Active" }];

#endif

        }

    }];

             

}

#endif

7 replies

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • January 4, 2024

Hey @TomV,
 
It looks like this is our logic for determining a landscape paywall: https://github.com/RevenueCat/purchases-ios/blob/3bd3b7f101edd522a811cf584eab69e9e0f2de46/RevenueCatUI/Data/Constants.swift#L88-L90
 
Do you know if your app is running in full screen and if the vertical size class is compact? 


Forum|alt.badge.img+4
  • Author
  • Member
  • 6 replies
  • January 5, 2024

The app pages take up the entire full screen. Is there anyway to determine programmatically this? Not sure what you mean by vertical class size? I’ve attached an image to show my paywall is correctly rendered in landscape. Just when the subscription button is pressed the payment flow comes in sideways.


Forum|alt.badge.img+4
  • Author
  • Member
  • 6 replies
  • January 5, 2024

I can also confirm that in my paywall page, which is in landscape, the vertical size is in compact. As this logging gets called. 

    if (self.traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact) {

        // The current vertical size class is compact

        // Adjust your UI or logic here if needed

        NSLog(@"Vertical size is compact");

    }

I can also confirm that the app is full screen and landscape for all the app. Please see attachment.


Forum|alt.badge.img+4
  • Author
  • Member
  • 6 replies
  • January 8, 2024

Still hoping for help. Anyone any ideas or is it a bug at Revenue Cat system?


sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • February 20, 2024

Hey @TomV,

I apologize for the delay, are you still having this issue? I saw in your screenshot the iOS payment sheet is not in landscape. This is Apple’s standard payment sheet so unfortunately RevenueCat doesn’t have control over how it is presented. I believe there is a setting in Xcode that can fix this but I’m not sure which one it is. What orientations do you allow in your Xcode project?


Forum|alt.badge.img+4
  • Author
  • Member
  • 6 replies
  • February 21, 2024

Hi, Yes. This is still an issue. We would love to have a solution.

We only allow landscape in this app. See attachments to confirm. At no point is there any behaviour in portrait, until the user calls subscribe and we use 3rd party code (Revenue Cat/Apple payment sheet)  

 

Tom.


sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • February 27, 2024

Hey @TomV,

I looked into this more and apparently iOS always shows the payment sheet in portrait regardless of whether the app allows the portrait orientation: https://stackoverflow.com/questions/46198111/is-it-possible-to-display-a-landscape-in-app-purchase-sheet-on-ios-11. Unfortunately it looks like it’s out of our control. It may make sense to reach out to Apple developer support to confirm that this is indeed the case.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings