helpcrunch / android-sdk-demo

Public demo for HelpCrunch Android SDK
Apache License 2.0
9 stars 1 forks source link

Error with 3.2.4 #63

Closed francescogatto closed 2 years ago

francescogatto commented 2 years ago

Hi

I'm trying to implement the new version of the sdk, but is not working (compilation errors). it works great with 3.2.3. Note that in my app nothing is changed with dependencies between helpcrunch versions

here the error:

Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: class com.helpcrunch.library.ui.screens.main.HelpCrunchMainActivity, unresolved supertypes: com.helpcrunch.library.j4.b, com.helpcrunch.library.l4.b, com.helpcrunch.library.x4.b Adding -Xextended-compiler-checks argument might provide additional information.

Can you tell me which classes are broken so i can correct my dependencies (or you can update yours?) Another hint, HelpcrunchExt is not working anymore, is not found

TalbotGooday commented 2 years ago

Hello! Thanks for the reporting! I'll check what's wrong ASAP

francescogatto commented 2 years ago

also HCOptions.createDefault() is not found

TalbotGooday commented 2 years ago

I can't reproduce none of these issues :thinking: Let me spend some time on it

francescogatto commented 2 years ago

After a lot of tests, i found the problem and sincerly i don't know why is happening. In my application i use a registerActivityLifecycleCallbacks and in on destroyed i check in the activity is an HelpcrunchMainActivity. If i remove it, the app build and compiles (but createDefault and HelpcrunchExt is not found anyway so i commented this code for now). How is it possible?

You can reproduce it in your sdk app demo (but before convert app to .kt)

Edit: You can reproduce also the problem of missing createDefault and HelpCrunchExt) converting for example the messagingservice class in kotlin and paste this code:

override fun onMessageReceived(remoteMessage: RemoteMessage) { super.onMessageReceived(remoteMessage) showChatScreen(HCOptions.createDefault(), null) if (remoteMessage.isHelpCrunchMessage()) { showNotification(remoteMessage) } else { //Do something yours } }

ISo i resolved the isHelpcrunchMessage, but createDefault no. please let me know

TalbotGooday commented 2 years ago

@francescogatto HelpcrunchExt is only available for java classes. It's just a JvmName. Call showChatScreen directly or use HelpCrunch.showChatScreen instead

Also, can I ask why do you need that registerActivityLifecycleCallbacks check for HelpcrunchMainActivity :sweat_smile:

francescogatto commented 2 years ago

It s a secret 😏 anyway i resolved with classname check.

Thanks

Il Mer 14 Set 2022, 19:07 Alexey Mostovoy @.***> ha scritto:

@francescogatto https://github.com/francescogatto HelpcrunchExt is only available for java classes. It's just a JvmName. Call showChatScreen directly or use HelpCrunch.showChatScreen instead

Also, can I ask why do you need that registerActivityLifecycleCallbacks check for HelpcrunchMainActivity 😅

— Reply to this email directly, view it on GitHub https://github.com/helpcrunch/android-sdk-demo/issues/63#issuecomment-1247063077, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAGC7DCZ5TSNTV4PAZLNTDV6IA5TANCNFSM6AAAAAAQMNSZN4 . You are receiving this because you were mentioned.Message ID: @.***>

TalbotGooday commented 2 years ago

@francescogatto LOL, ok :D But I mean if you want to check if the chat screen is opened or closed you can use buil-in broadcast receiver's events like HelpCrunch.Event.SCREEN_OPENED or HelpCrunch.Event.SCREEN_CLOSED

TalbotGooday commented 2 years ago

Can I close the the issue?

francescogatto commented 2 years ago

I will try! Yes. Thx

Il Mer 14 Set 2022, 19:39 Alexey Mostovoy @.***> ha scritto:

Can I close the the issue?

— Reply to this email directly, view it on GitHub https://github.com/helpcrunch/android-sdk-demo/issues/63#issuecomment-1247097405, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAGC7EKJL33MCOKMUSU7QDV6IEUFANCNFSM6AAAAAAQMNSZN4 . You are receiving this because you were mentioned.Message ID: @.***>

TalbotGooday commented 2 years ago

Glad to help :handshake: