Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect when TSMessage is closed manually #179

Open
dpbataller opened this issue Sep 5, 2014 · 2 comments
Open

Detect when TSMessage is closed manually #179

dpbataller opened this issue Sep 5, 2014 · 2 comments

Comments

@dpbataller
Copy link

Hi! I need to know if it is possible detect when user close a Notification TSMessage sliding up (not from close button or touching inside it) and then, do some actions...

@Kjuly
Copy link

Kjuly commented Nov 18, 2014

TSMessageView has a private property called callback, u can set it by:

[TSMessage showNotificationInViewController:yourViewController
                                              title:@"title"
                                           subtitle:@"subtitle"
                                              image:nil
                                               type:TSMessageNotificationTypeSuccess
                                           duration:TSMessageNotificationDurationAutomatic
                                           callback:^{
                                               // here do whatever u want after user tapped the banner
                                           }
                                        buttonTitle:nil
                                     buttonCallback:nil
                                         atPosition:TSMessageNotificationPositionTop
                               canBeDismissedByUser:YES];

However, I find there's a problem that when callback added, it'll invoke handleTap: instead of fadeMeOut, which means, the notification banner won't dismiss itself when u tap on it.

@Kjuly
Copy link

Kjuly commented Nov 18, 2014

Created a PR for the issue I mentioned. Hope it helps ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants