最近の検索
最近の検索はありません
Zendesk Android push notifications issue
投稿日時:2022年8月24日
Hi,
I'm using chat sdk v2 and following this link to enable push notifications. https://developer.zendesk.com/documentation/classic-web-widget-sdks/chat-sdk-v2/android/push_notifications/
Also, this link to show the push notifications as per Android docs. https://developer.android.com/training/notify-user/build-notification
I'm stuck at this point where the pending intent for the MessagingActivity needs to be created.
// Create an explicit intent for an Activity in your app
val intent = Intent(this, AlertDetails::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
}
val pendingIntent: PendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)
val builder = NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("My notification")
.setContentText("Hello World!")
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
// Set the intent that will fire when the user taps the notification
.setContentIntent(pendingIntent)
.setAutoCancel(true)
We use this inside our application to start the chat screen.
MessagingActivity.builder()
.withEngines(ChatEngine.engine())
.show(view.getContext(), chatConfiguration);
Please guide me on how to show this screen via pending intent from the push notification.
Eric Nelson
0
3
3件のコメント
Arnaud Joly
as the Chat SDK doesn't handle the display of the Push Notification, it's a custom implementation and we cannot advise on how to proceed.
I tested successfully in my own app following the android documentation, essentially using their code and replacing the Intent by the a Messaging intent.
Hope that this helps!
0
Karthik Suresh
Hi,
Thank you for the reply. I have managed to associate the chat screen from notification. I have one more issue now. I don't get the push messages if the app is killed from recent apps screen whereas it works for any other major applications on Android.
Please let me know if this is something which has affected you before.
0
Priddy Broderickson
If you are offering Zendesk Chat through your own mobile app, you can enable push notifications to alert customers to responses and updates to their chats.
For Zendesk Chat accounts on paying plans, push notifications can be configured to notify the user even when the app is in the background on their mobile device. These notifications can be enabled for multiple mobile apps, if needed.
To enable push notifications, administrators must add their mobile apps to the Mobile SDK list, which is accessed through your Chat dashboard. When an app is added to this list, an app ID is generated, which is then shared with your mobile development team.
To add an app to the Mobile SDK list
On your Chat dashboard, go to Settings > Account > API & SDKs.
In the Mobile SDK section, click Add App.
On the Add App page, enter your app’s information, including:
Name: A name for your app that developers and other administrators will recognize.
Description: A brief statement about what the app does.
FCM server key (for Android) and/or upload a PEM certificate (for iOS).
Click Save Changes.
0