Open Website thru Notification
===

I tried many ways to do this method but I can't!
my issue is:
I sent a notification from my website with link 
when I receive it I can open it only if I closed my application from background
but I cant open the link when I open my application or when my app in background

here is my code:
            
     
   

     - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    
    
    NSString* alert = [userInfo objectForKey:@"id"];
    
    NSLog(@"Message: %@", alert);
    
    UIApplicationState state = [[UIApplication sharedApplication] applicationState];
    if (state == UIApplicationStateActive) {
        UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Notification!" message:@"Do you really want open Website?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Open", nil] autorelease];
        [alertView show];
        
       }
    }
     - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
     {
         If (buttonIndex == 0)
     {
        NSLog(@"cancel button clicked!!");
    }
    else if (buttonIndex == 1)
    {
        NSDictionary *alert0 = [[NSDictionary alloc]initWithContentsOfFile:nil];

        NSDictionary *alert = [alert0 objectForKey:@"link"];
        NSString *alert1 = [[NSString alloc]initWithFormat:@"%@",alert];
      //  self.viewController.webViewer.scalesPageToFit=YES;
       // [self.viewController.webViewer loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:alert1]]];
        NSLog(@"hi %@",alert1);

    }
    }

can someone tell me where is the wrong in my code please?

thanks