Je dois suivre le code pour afficher une notification si l'application est active. Je l'ai mis dans AppDelegate.mEffectuer une transition après avoir appuyé sur un bouton de notification
Ce que je veux faire est d'effectuer une transition (ou segue) à un contrôleur de vue lorsque l'utilisateur appuie sur le second bouton. Comment puis-je faire cela depuis AppDelegate?
Je pense que j'ai besoin de configurer le contrôle de la navigation à appdelegate .. Mais je ne pouvais pas réaliser cela.
Merci
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateActive) {
NSString *cancelTitle = @"Close";
NSString *showTitle = @"Show";
//NSString *message = [[userInfo valueForKey:@"aps"] valueForKey:@"alert"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Social Dilemma"
message:@"Next round is ready to play!"
delegate:self
cancelButtonTitle:cancelTitle
otherButtonTitles:showTitle, nil];
[alertView show];
}
}
-(void) alertView: (UIAlertView *) alertView
clickedButtonAtIndex: (NSInteger) buttonIndex {
if (alertView.tag == 1)
{
//check the button index
//create and display the other alert view (set the tag property here to 2)
}
else if (alertView.tag == 2)
{
}
}