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

Not possible to have a delayed init as on version 5.x #13

Open
rkardo58 opened this issue Apr 20, 2023 · 2 comments
Open

Not possible to have a delayed init as on version 5.x #13

rkardo58 opened this issue Apr 20, 2023 · 2 comments

Comments

@rkardo58
Copy link

rkardo58 commented Apr 20, 2023

Hi,

I need to have the init customizable and defined by an API setting, and right now when I don't register the app just crashes or it doesn't load the views as it should.

Apptentive.INSTANCE.isRegistered does not work to prevent it.

java.lang.NoClassDefFoundError: apptentive.com.android.util.Log
                                                                                              	at apptentive.com.android.util.Log.d(Unknown Source:0)
                                                                                              	at apptentive.com.android.feedback.ApptentiveNullClient.getUnreadMessageCount(ApptentiveClient.kt:77)
                                                                                              	at apptentive.com.android.feedback.Apptentive.getUnreadMessageCount(Apptentive.kt:520)
                                                                                              	at com.smithmicro.safepath.family.core.analytics.apptentive.ApptentiveRatingEngine.getUnreadMessageCount(ApptentiveRatingEngine.java:132)
@rkardo58
Copy link
Author

Your logger only gets initialized after registering. So you try to log if not registered and it crashes because there's no logger.
I have to check before all methods if its registered.

@ChaseApptentive
Copy link
Contributor

ChaseApptentive commented May 10, 2023

@rkardo58

Yes, that's how it's currently intended to work. Apptentive needs to be registered in order for any other part of the SDK to work, including the logger.

But this is an area where we can do better, and we'll work on improving this in the near future.

In the meantime, something you can do to check if the SDK is registered is to use the register callback method shown here.

Also, if you can provide some more info (maybe code snippets) of how you're doing the "init customizable and defined by an API setting" part of your code, we could try to repro this same scenario on our end.

Thanks.

cc @CaseyApptentive @NickYeltonApptentive

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