cometchat / chat-sdk-ionic

Voice & Video Calling and Text Chat SDK for Cordova & Ionic
Other
12 stars 10 forks source link

Tap on Push Notification doesn't open up the app #6

Closed agrajj closed 3 years ago

agrajj commented 3 years ago

Describe the problem

I am using this SDK and able to configure it to receive Push Notification for new messages. However when I tap on the notification same doesn't open up my Ionic App. I want to redirect user to the chat conversations screen upon tapping the notification for new messages.

This has to do something with how Comet Chat Server is sending out push notifications because when I use FCM api to send notifications my app does open up without any issue.

What was the expected behavior?

App should come to foreground if already running or start afresh when tapping on push notification.

Ionic Info

Ionic:

Ionic CLI : 6.12.1 (/Users/agraj/.nvm/versions/node/v12.18.3/lib/node_modules/@ionic/cli) Ionic Framework : ionic-angular 3.9.10 @ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 10.0.0 Cordova Platforms : android 8.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.3, (and 27 other plugins)

Utility:

cordova-res (update available: 0.15.3) : 0.15.1 native-run (update available: 1.3.0) : 1.1.0

System:

Android SDK Tools : 26.1.1 (/Users/agraj/Library/Android/sdk) ios-deploy : 1.10.0 ios-sim : ios-sim/9.0.0 darwin-x64 node-v12.18.3 NodeJS : v12.18.3 (/Users/agraj/.nvm/versions/node/v12.18.3/bin/node) npm : 6.14.8 OS : macOS Big Sur Xcode : Xcode 12.4 Build version 12D4e

package.json

... "@cometchat-pro/cordova-ionic-chat": "^2.2.0" ...

mayur-bhandari commented 3 years ago

Hello @agrajj,

Currently, CometChat sends a "click_action": "FCM_PLUGIN_ACTIVITY" so you would have to add the following lines in your AndroidManifest.xml,

<intent-filter><action android:name="FCM_PLUGIN_ACTIVITY" /><category android:name="android.intent.category.DEFAULT" /></intent-filter>

I have created a feature request to customize the payload and I have added you to the feature request. You can follow the feature request here.

Warm Regards,

CometChat Pro Mayur Bhandari

proveshapyne commented 3 years ago

Hello @agrajj,

Hope this was helpful. Please feel free to reach out to us at help@cometchat.com if you need technical aid.

Regards, Provesha