alvises / FPPopover

FPPopover provides an alternative to the native iOS UIPopoverController, adding support for iPhone and additional opportunities to customize the look and feel of the popovers.
http://www.poeticoding.com/fppopover-a-customizable-uipopovercontroller-for-iphone-and-ipad/
Other
901 stars 250 forks source link

Remote Notification app issue with FPPopover #38

Open smsivabe opened 11 years ago

smsivabe commented 11 years ago

Hello, I am using FPPopover in my project and i was successful in displaying the popup in one of my view controller uibutton. I am using remote notification as well in my app. when i open the app through notification which i recieved and try to click the uibutton for popup, i was not able to get the popup. Can you please help me out?

alvises commented 11 years ago

Hi. Can you paste here the related code where you are showing the popover please?

smsivabe commented 11 years ago

My application using remote notification function in AppDelegate page. UIbutton click to show FPPopover controller in viewcontroller page, FPPopover working fine in the ViewController when the application is open through normal application navigation. But the issue arises when i navigate to the view controller through push notification.

AppDelegate.m

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert |UIRemoteNotificationTypeBadge| UIRemoteNotificationTypeSound)]; NSDictionary *remotenotification= [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];

if(remotenotification){
         ViewController *Vc =[[ViewController alloc] initWithNibName:nil bundle:nil];
          self.window.rootViewController = Vc;
    [self.window makeKeyAndVisible];
}

ViewController.m

-(IBAction)btnAction:(id)sender{ FPViewController fpvc=[[FPViewController alloc]init]; UIBarButtonItem cancel =[[UIBarButtonItem alloc]initWithTitle:@"Cancel" style:UIBarButtonItemStyleBordered target:self action:@selector(didclickCancelButton)]; UIBarButtonItem submit =[[UIBarButtonItem alloc]initWithTitle:@"Submit" style:UIBarButtonItemStyleBordered target:self action:@selector(Submit)]; fpvc.navigationItem.leftBarButtonItem=cancel; fpvc.navigationItem.rightBarButtonItem=submit; UINavigationController navigation =[[UINavigationController alloc]initWithRootViewController:fpvc]; popover = [[FPPopoverController alloc] initWithViewController:navigation]; //popover.arrowDirection = FPPopoverArrowDirectionAny; popover.tint = FPPopoverDefaultTint; if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { popover.contentSize = CGSizeMake(300, 600); } else { popover.contentSize = CGSizeMake(300, 600); } popover.delegate=self; popover.arrowDirection = FPPopoverArrowDirectionAny; [popover presentPopoverFromView:(btnPostion)]; }

FPPopover popup displays without any issue when i open the application normally. It doesnt show only when the application is opened through push notification.