Here's my problem.
I have implemented push notification in my app and it works just fine.
- The app receives a message
- Captured in appDelegates: didReceiveRemoteNotification
- Creates a new UIView to display that a new message is received
Only problem I have is that I want the user to be able to tap on the message so that the app will open the message viewcontroller. But I can't seem to figure out how to capture this touch and then do something with it in the appDelegate. I have an NSLog in the method that should open the new viewcontroller but it seems that it is never called.
Any help would be appreciated!
Here's the code, it is in the didReceiveRemoteNotification method:
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoMessages)];
UIView *messageView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 45)];
messageView.userInteractionEnabled = YES;
messageView.backgroundColor = [UIColor darkGrayColor];
[messageView addGestureRecognizer:recognizer];
[self.window addSubview:messageView];
Thanks!