Application hosting extensions must comply with Application Extensions Programming Guide

I submitted an iPhone app to the AppStore with an iOS 8 extension. It was rejected for AppStore reason. The "Share" extension is full screen and unlimited.

I am creating UI for extension by extending UIViewController and using Xib. My app is for iPhone only, when I installed the app in iPad and open the extension via safari that shows full screen and it is not limited to the iPhone screen.

The reasons

25.1: Application hosting extensions must comply with the Application Extensions Programming Guide ----- 25.1 -----

We found that your app extension is not in line with the App Extension Programming Guidelines as required by the App Store Review Guidelines.

In particular, we found the "Share" extension to be full screen and unlimited.


source to share

1 answer

I needed a UI to extend the sharing and did it by extending the UIViewController. I submitted my app to AppStore without implementing preferredContentSize and modalPresentationStyle, which deviates from AppStore because the extension is showing full screen on iPad.

The Apple doc mentions that: Apple Doc When you have additional content to display, you can rely on Auto Layout constraints to adjust the views height as needed. If you are not using auto layout, you can use the UIViewController's preferredContentSize property to specify the new heights.

I am using XiB, so in the content distribution extension add NSExtensionPrincipalClass to InitialViewController.

In InitialViewController

- (void)viewDidLoad {

    [super viewDidLoad];

    ShareViewController *vcShare = [[ShareViewController alloc] initWithNibName:@"ShareViewController" bundle:nil];
    vcShare.extensionContext = self.extensionContext;
    UINavigationController *ncController = [[UINavigationController alloc] initWithRootViewController:vcShare];

    [self.navigationController pushViewController:vcShare animated:NO];
    ncController.preferredContentSize = CGSizeMake(300.0, 420.0);
    ncController.modalPresentationStyle = UIModalPresentationFormSheet;
    ncController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    [self presentViewController:ncController animated:NO completion:nil];


It shows full screen on iPhone, but it won't show full screen on iPad. I made the above changes and then the app accepted in the AppStore.



All Articles