Closed iMark21 closed 9 years ago
By action launcher I assume you mean a callback or selector call?
What you can do is set up a CRToastInteractionResponder that will call your own method. That would look something like this:
[CRToastManager showNotificationWithOptions:@{
kCRToastInteractionRespondersKey: @[CRToastInteractionResponder interactionResponderWithInteractionType: CRToastInteractionTypeTap automaticallyDismiss:NO block:^{
// your code
}]]
}
appearanceBlock:nil
completionBlock:nil];
Thanks @jadar.
Please re-open if that doesn't answer your question.
Thanks @jadar but using your solution I'm getting the next issue: "Unexpected interface name 'CRToastInteractionResponder' expectede expression, ...
NSDictionary *options = @{ kCRToastTextKey : messageTitleToast, kCRToastTextColorKey : [UIColor darkGrayColor], ... }
I only need the key and the value to add to the dictionary options to CRToastManager. Any clue?
Thank you!!
It looks like maybe you're doing this in the wrong place.. http://stackoverflow.com/questions/7375292/what-is-unexpected-interface-name-in-objective-c-iphone-development
In terms of keys and values, this might help to show you how to add an interaction responder better..
CRToastInteractionResponder *responder = [CRToastInteractionResponder interactionResponderWithInteractionType:CRToastInteractionTypeTap
automaticallyDismiss:NO
block:^{
// your interaction code.
}];
NSDictionary *options = @{
kCRToastInteractionRespondersKey : @[responder]
}
Yeah! It works!! thank you @jadar
Is it possible to add an action launcher when tap the notification?