Blackberry - open application on message notification click - blackberry

My app sending messages notification to the home screen notification bar, but when I'm clicking on some message there, "Message Preview" window opens.
I am aware of
SO - Opening application from notification bar in blackberry
SO - Blackberry ApplicationIndicator click handler on Home Screen
While I have implemented ApplicationMessageFolderListener and adding it to ApplicationMessageFolder, still actionPerformed is never called when I'm clicking on message in notification bar.
Is there a way to handle notification message click event from own application?
Same question on BB forums.

I recently struggled with this very same problem. When a user opens an ApplicationMessage object, ApplicationMessageFolderListener.actionPerformed() is not notified. It is notified if the user marks the message as opened without actually opening it. After some digging, this is by design.
To get notified when the message is actually opened, you have to implement a class that extends the ApplicationMenuItem class and overrides its run() method. The context parameter will be set to the ApplicationMessage object that is being opened. You can then register that menu item using the ApplicationMessageFolderRegistry.registerMessageMenuItems() method for the particular message state combinations that the menu item applies to, such as ApplicationMessage.Status.UNOPENED.

Related

Open input text field when clicked on notification not on notification action

Here, I am trying to implement "reply from notification" feature like WhatsApp,
I am able to open text field from action button but it takes few taps to do that.
When you click (single tap) on the notification got from WhatsApp (while phone is locked) it will directly opens the text field where I can add reply message.
Currently when I click on the notification (while phone is locked) it will directly opens the app which I don't want to be happen. App should not be launched.
Also I have used Notification Content Extension too.

Getting crash when click interactive notification body in iOS

I have implemented interactive notification into app. Into interactive notification have two action buttons 'Ok' and 'Cancel'.
I have implemented a code on click of particular button. But when I click interactive notification body and not on action button that time app gets opened but after that it's crashed.
How to handle this issue? I have added code for remote notification's delegate method which is 'didReceiveRemoteNotification'. Is this method is necessary for interactive notification?
Please anyone clarify my two questions.
Thanks

Remote Notification 'application:didFinishLaunchingWithOptions:' method not called

Target: 7.0 and UP
Testing on: iPhone6 Device
I have been testing Regular Push Notifications (Remote).
I have discovered that if a user clicks on the app icon -- the "applicationDidFinishLaunching:" method is never called.
I have been reading and re-reading the guide on "Handling Local and Remote Notifications" and to confirm that I understood everything referred to: Handling Remote Notifications
It says If a user taps the default button in the alert or taps (or clicks) the app icon, then the app should call its delegate "application:didFinishLaunchingWithOptions" method. And if its a remote notification, it should call "application:didReceiveRemoteNotification:fetchCompletionHandler:".
Neither one of these methods get called if I click on the app icon.
The only method that does get called is applicationWillEnterForeground.
I do have a storyboard file. So the way it loads:
--> navigation controller --> table view controller --> so on
Am I supposed to somehow set the appDelegate in the storyboard file?
I have done a lot of research and so far I have had no luck.
My push alerts do come through so I know that it works. I just haven't been able to determine why these other methods are not being called when the user clicks on the app icon.
Any suggestions or help is appreciated.
The only solution if you want to handle when a user clicks on the app icon is to either A.) set up silent notifications or B.) Set up something on your server so that you can make a request to it to find out if there was a new update.

PushNotification in iOs and Application icon is clicked

I receive PushNotification as badge as well as alert and are displayed as badges on the app icon.
I receive the payload successfully when I click on alert, which appears at top area of the screen.
But, if the notification is received and I click on the application icon i don't get the payload in any of below mentioned the methods.
application:didFinishLaunchingWithOptions:
application:didReceiveRemoteNotification:
So, what could be the problem or have I missed something in handling such case.
That would be expected behavior. You don't want to show the push notification for the user if he himself did not actively chose to to tap on the alert. If user is in your app while receiving notification you can ask the user if he wants to view it or dismiss it.

Opening application from notification bar in blackberry

For my application I need to creat an icon in notification bar.I am able to do this.
My problem is I need to open this application from notification bar.
When ever user selects notification screen my app status should display. when user selects my app my application should open directly.
Have a look at the following classes:
ApplicationMessageFolder
ApplicationMessageFolderRegistry
And the following interfaces:
ApplicationMessage
ApplicationMessageFolderListener
Register a folder for your app, add a listener to the folder, and use the AppicationMessageFolder.fireElementAdded() method to add status messages to the folder. When the user clicks on the notification bar, the Messages app displays the available folders and their contents. When the user clicks on one of your status messages, the folder's listener will notify your app so it can react accordingly.

Resources