Skip to content

CleverTapInboxMessagesDidUpdateHandler not working in Android #85

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

Closed
tyfoo1603 opened this issue Dec 15, 2021 · 4 comments
Closed

CleverTapInboxMessagesDidUpdateHandler not working in Android #85

tyfoo1603 opened this issue Dec 15, 2021 · 4 comments
Assignees

Comments

@tyfoo1603
Copy link

tyfoo1603 commented Dec 15, 2021

After setCleverTapInboxMessagesDidUpdateHandler, CleverTapInboxMessagesDidUpdateHandler is not being called when the messages updated(Add, remove, mark as read etc). But it works fine in iOS.

*It happened on other event handler as well, like CleverTapInboxDidInitializeHandler and CleverTapPushClickedPayloadReceivedHandler.

Currently using clevertap_plugin: 1.4.0
My app/build.gradle file

 implementation 'com.clevertap.android:clevertap-android-sdk:4.1.2'
    // #region Dependencies for cleverTap
    implementation 'androidx.core:core:1.3.0'
    implementation 'androidx.fragment:fragment:1.3.6'
    //MANDATORY for App Inbox
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.viewpager:viewpager:1.0.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    
    //For CleverTap Android SDK v3.6.4 and above add the following -
    implementation 'com.android.installreferrer:installreferrer:2.2'
    
    //Optional ExoPlayer Libraries for Audio/Video Inbox Messages. Audio/Video messages will be dropped without these dependencies
    implementation 'com.google.android.exoplayer:exoplayer:2.15.1'
    implementation 'com.google.android.exoplayer:exoplayer-hls:2.15.1'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.15.1'
    // #endregion
@william-ct
Copy link
Contributor

Hi @tyfoo1603 , In your app/build.gradle file can you update 'com.clevertap.android:clevertap-android-sdk:4.1.2' to 'com.clevertap.android:clevertap-android-sdk:4.3.1' and let us know if this issue still persists?

@san-sitesurface
Copy link

@tyfoo1603 have you integrated firebase as well ? If that's the case you can try removing all firebase messaging listeners like FirebaseMessaging.onMessage.listen or onBackgroundMessage then it will work

@darshanclevertap
Copy link
Contributor

@tyfoo1603 Closing this due to inactivity. Please feel free to reopen the issue if it still persists.

@josh88versa
Copy link

josh88versa commented Nov 11, 2022

Hi Team, I'm facing the same issue. The in app message appears but when I click on the dismiss or button, event handler is not being called.

my flutter plugin version: clevertap_plugin: ^1.5.4

here is the current log for flutter doctor -v

[✓] Flutter (Channel stable, 3.3.7, on macOS 12.6.1 21G217 darwin-x64, locale en-US)
    • Flutter version 3.3.7 on channel stable at /Users/apple/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e99c9c7cd9 (9 days ago), 2022-11-01 16:59:00 -0700
    • Engine revision 857bd6b74c
    • Dart version 2.18.4
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/apple/Library/Android/sdk
    • Platform android-33, build-tools 30.0.3
    • ANDROID_SDK_ROOT = /Users/apple/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A400
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.73.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.52.0

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 12.6.1 21G217 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 107.0.5304.110

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

My gradle dependencies:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation group: 'com.zendesk', name: 'support', version: '5.0.3'
    implementation 'com.clevertap.android:clevertap-android-sdk:4.6.3'
    implementation 'com.google.firebase:firebase-messaging:23.0.8'
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.fragment:fragment-ktx:1.5.2'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.viewpager:viewpager:1.0.0'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'com.android.installreferrer:installreferrer:2.2'
    implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
    implementation 'com.google.android.exoplayer:exoplayer-hls:2.18.1'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.1'
    implementation 'com.huawei.agconnect:agconnect-core:1.6.5.300'
}

I've copied the same implementation describe in the documentation.

void initState() {
    super.initState();
    clevertap.setCleverTapInAppNotificationButtonClickedHandler(_handleInApp);
}

void _handleInApp(Map<String, dynamic>? map) {
    print("inAppNotificationButtonClicked called = ${map.toString()}");
}

I've looked at the CleverTap plugin source code and realise that the print() call is not being called in the _platformCallHandler function (line 62)
Screen Shot 2022-11-11 at 10 57 29 AM

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

5 participants