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

MessageCenterNotification not responding immidiately after sending reply from Message Centre #16

Open
kiransn-647 opened this issue Jun 19, 2023 · 3 comments

Comments

@kiransn-647
Copy link

kiransn-647 commented Jun 19, 2023

We migrated our apptentive-kit-android to sdk 6.0.5 version, We observed that when reply is sent from message centre it take 5-10 mins to get update from callback. MessageCenterNotification data class will not trigger immediately at the same time when we open message centre chat it updates all the message quickly.

Tested in Android 13 Samsung and Pixel devices
Please suggest changes as to get quick update from message centre data

Reference: https://learn.apptentive.com/knowledge-base/android-integration-guide/#message-center-data-monitoring

@AlchemerMobile
Copy link

AlchemerMobile commented Jun 21, 2023

The Apptentive SDK uses a message polling technique, which can result in a delay of up to 5 minutes between sending messages from the dashboard and receiving them in the app​. This might explain why you're experiencing a delay before the MessageCenterNotification data class triggers.

If you're not getting any callbacks on the unread messages but can see messages in Message Center, you can try the following code snippet (or something similar) to verify that the callback still gets invoked (be careful not to use your current callback when you check this, as it'll overwrite the first callback):

val configuration = ApptentiveConfiguration(APPTENTIVE_KEY, APPTENTIVE_SIGNATURE)
Apptentive.register(*replace with app instance*, configuration, object : Apptentive.RegisterCallback {
    override fun onResult(success: Boolean) {
        if (success) {
            Apptentive.addUnreadMessagesListener { unreadMessages ->
                Log.d("Apptentive", "Unread message count: $unreadMessages")
            }
        }
    }

    override fun onError(error: Exception) {
        Log.e("Apptentive", "Can't register Apptentive:\n${error.message}")
    }
})

@kiransn-647
Copy link
Author

kiransn-647 commented Jun 22, 2023 via email

@AlchemerMobile
Copy link

AlchemerMobile commented Jun 22, 2023

Hey Kiran,

Sorry about that. Try using onUnreadMessageCountChanged instead. Here's method summary as well: https://learn.apptentive.com/docs/android/api/index.html?index-all.html

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