-
Notifications
You must be signed in to change notification settings - Fork 301
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
Postpone initialization of Adjust config, and Adjust instance #341
Comments
Hi @hearbeathorror We tend to think that there is no reason for SDK initialisation to be delayed unless maybe you are awaiting some kind of response from you backend in order to attach that information to install session as a callback/partner parameter. For this purpose, we have added an option to "delay start" of the SDK (more info in this chapter: https://github.com/adjust/android_sdk#delay-start). Idea of this feature is to leave SDK initialisation where it should be according to README, but if this option is set, SDK will wait for your input with some additional info you might want to get from your backend in order to attach it as session/callback parameters. If you attached them within delay time (10 seconds max), SDK will pick them up and send with install session. This feature however doesn't have abort mechanism. If your requirement is to decide whether to initialise SDK at all based on some info you will obtain from your backend, then I guess mentioned feature is not the thing you're looking for and in that case you simply need to wait for input from your backend to initialise SDK or not. The only advice in this case is that if you decide to initialise SDK when your initial activity is already displayed (first ever call to In case your use case is different from what I described, please explain it a bit more to see if there's anything else you can possibly do. Cheers |
So my case is this, there are some customers who would like to have adjust as their functionality and some dont want so. Based, on the api response i would like to track adjust fully or never at all. And there are probabilities that their choice might vary in the middle of the application usage, so in such cases, adjust should track for sure. I tried setting offline mode to true initially until i get a response, and it works fine till then, and if the value is false so adjust is disabled completely. But if in the middle, i set adjust to enabled state, and setOfflineMode to false, session event gets fired, but i get 404. Does this mean, whether or not the app is enabled, offline mode will continue queueing up the events? (That's an added question I had). So considering this use-case, how best could i go about it? Thanks |
I see. Hm. Maybe you can give
Maybe you can give this scenario a shot and see if it fits your needs. Also one thing to have in mind is that disable/enable setting is |
Sure, this solutions seems to be feasible. I will try it. Also, since after every launch i am hitting this api, and enabling adjust , i presume that will overcome the issue of persistence right? I noticed that adjust gives me a wierd token sesison not found error , is it because i have over-used it? That is how it looks on charles unfortunately , and no other events seem to get tracked. |
Seems like it might work for you, be sure to test this flow well on your side. On these sessions note, can you show the response our backend is sending? Make sure to obfuscate your sensitive data when pasting in here backend reply. |
Hi @uerceg 👍 sometimes as a response i would get token not found , or 404. |
@hearbeathorror If queue size was saying Not sure where does 404 come from. Can you share maybe the response from backend in that case? Token not found can mean that you either set app or event token wrongly in your setup. |
@hearbeathorror Any update on this one? |
@uerceg : i did not do this. I changed code to simply ignore adjust method tracking if that was the case for specific users. It was queuing it up, but that is not what i wanted. I did not want to let it queue up and then send it over to the server when it is enabled again. |
Hi,
I would like to delay the creation of Adjust instance until i get a response from the server, is there a way this can be done in adjust itself?
I have tried using setOfflineMode method, but this stores everything in a queue, and it makes me get a 404 when the offline mode is turned false and adjust re-enabled.
Kindly assist.
The text was updated successfully, but these errors were encountered: