CleverTap / clevertap-ios-sdk

CleverTap iOS SDK
https://clevertap.com
MIT License
56 stars 54 forks source link

APP Inbox messages are not shown ( Inbox Message count is 0) #274

Open sarojraut opened 1 year ago

sarojraut commented 1 year ago

As per the documentation describe here https://developer.clevertap.com/docs/app-inbox-ios , I have implemented APP inbox View and created the campaign but not able to receive any messages. I have created campaign for push and inapp messages and received push and in app messages but while creating campaign for app inbox no any message received.

IMG_0326

Environment:

akashvercetti commented 1 year ago

@sarojraut Could you please your app inbox initialisation code?

sarojraut commented 1 year ago

@sarojraut Could you please your app inbox initialisation code?

 private func registerAppInbox() {
        CleverTap.sharedInstance()?.registerInboxUpdatedBlock {
            let messageCount = CleverTap.sharedInstance()?.getInboxMessageCount()
            let unreadCount = CleverTap.sharedInstance()?.getInboxMessageUnreadCount()
            print("Inbox Message:\(String(describing: messageCount))/\(String(describing: unreadCount)) unread")
        }
    }

    private func setUpAppInbox() {
        // Initialize the CleverTap App Inbox
        CleverTap.sharedInstance()?.initializeInbox(callback: ({ _ in
            let messageCount = CleverTap.sharedInstance()?.getInboxMessageCount()
            let unreadCount = CleverTap.sharedInstance()?.getInboxMessageUnreadCount()
            print("Inbox Message:\(String(describing: messageCount))/\(String(describing: unreadCount)) unread")
        }))
        let appInboxButton = UIBarButtonItem(image: AppConstants.AppImages.Common.appInbox, style: .plain, target: self, action: #selector(openAppInbox))
        appInboxButton.tag = NavBarItems.appInbox.tag
        addLeftItemOnNavBar(true, item: appInboxButton)
    }

    @objc private func openAppInbox() {
        let style = CleverTapInboxStyleConfig()
        style.title = "Notifications"
        style.backgroundColor = .white
        style.navigationBarTintColor = AppConstants.Color.mportGreen
        style.navigationTintColor = .white
        style.tabUnSelectedTextColor = .white
        style.tabSelectedTextColor = .white
        style.tabSelectedBgColor = AppConstants.Color.BodyMappPrimaryBlue
        if let inboxController = CleverTap.sharedInstance()?.newInboxViewController(with: style, andDelegate: self) {
            let navigationController = UINavigationController(rootViewController: inboxController)
            present(navigationController, animated: true, completion: nil)
        }
    }
akashvercetti commented 1 year ago

@sarojraut Code looks fine. We gave it a try in our sample apps and we seem to be getting messages for both "live" and "past" behavior campaigns. Could you please raise a ticket through the CleverTap dashboard? Our technical account managers can take a look at the issue closely. Alternatively, you could also check/run our sample app and give it a try: https://github.com/CleverTap/clevertap-ios-sdk/tree/master/SwiftStarter

thatduy commented 1 year ago

I faced the same issue. It only works when I build my app from Xcode and It does not work when I use the production app

litongde commented 1 year ago

@akashvercetti I also encountered a similar problem, clevertap sdk version 5.1.1 still exists, app can not receive clevertap push notification. clevertap console prompt APNSBadDeviceToken, Unable to send a notification. If you roll back to version 4.2.0, everything is normal

akashvercetti commented 1 year ago

@sarojraut we have identified the source of this issue and are in middle of fixing/testing it. Please expect a release for this next week 👍

akashvercetti commented 1 year ago

@sarojraut We have released a fix for this in our latest release v5.1.2 https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.1.2

litongde commented 1 year ago

@sarojraut We have released a fix for this in our latest release v5.1.2 https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.1.2

Does version 5.1.2 just roll back to the inbox section after version 4.2.0? Because the inbox section after version 4.2.0 causes a problem with probabilistic thread jams. The current version 4.2.0 inbox is normal.

bakoushin commented 9 months ago

should the app inbox display newly published messages in the realtime?