简体   繁体   中英

Apps hosting extensions must comply with the App Extension Programming Guide

I submitted the iPhone app to AppStore with iOS 8 share extension. It is rejected from AppStore reason is “Share” extension is full screen and not constrained.

I am creating custom UI for extension by extending UIViewController and using Xib. My app is only for iPhone when i installed app in iPad and open extension through safari it showing in full screen and it is not restricted to iPhone screen.

Reasons

25.1: Apps hosting extensions must comply with the App Extension Programming Guide ----- 25.1 -----

We found that your app hosts extension(s) but does not comply with the App Extension Programming Guide, as required by the App Store Review Guidelines.

Specifically, we found that your "Share" extension is full screen and not constrained.

I needed the custom UI for share extension and did it by extending UIViewController. I submitted the app to AppStore without implementing preferredContentSize and modalPresentationStyle it get rejected from AppStore because extension view is showing in full screen in iPad.

In apple document its mention that : Apple Doc When you have additional content to display, you can rely on Auto Layout constraints to adjust the view's height as appropriate. If you don't use Auto Layout, you can use the UIViewController property preferredContentSize to specify the view's new height.

I am using XiB therefore in share extension plist add NSExtensionPrincipalClass set 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 is showing full screen in iPhone but in iPad it won't show in full screen. I made above changes then app get accepted in AppStore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM