Code Monkey home page Code Monkey logo

Comments (3)

uerceg avatar uerceg commented on July 17, 2024 1

@mihaerzen Yeah, I'd say that definitely you're right. I guess reasoning back in the days was to maybe with name give "a hint" where would be appropriate place for method to be called in the RN app itself, but obviously for your use case, it can be misguiding. By EOY we are most probably going to release next major SDK update where we have a chance to do API cleanup and this would definitely be one of the things on the list for React Native SDK.

Thanks for the suggestion! Will close this one for now, but in case you have any further questions or need assistance, feel free to comment/reopen.

Cheers!

from react_native_sdk.

uerceg avatar uerceg commented on July 17, 2024

Hi @mihaerzen

As far as initialisation of SDK is concerned, general rule of thumb is simply to try to do it ASAP in your app. Example we made with App.js was just an example how this might be done, not mandatory to be done in that place if you don't have it. So as soon as you can, would be great.

And regarding componentWillUnmount method -> this method cleans up callback methods from the app set on Adjust SDK for various things (you can check this in README, one can set callback for getting attribution, event/session tracking success/failure and deferred deep link information) and sometimes people tend to rerun SDK initialisation code multiple times so addition of this method in our API and advice where to call it was best effort to clean up these callbacks in order not to have them defined multiple times since SDK remembers only one. I'd say that if you make sure that SDK initialisation (Adjust.create) is called just once, there's no need for you to invoke unmount method.

In case you have any further questions, feel free to ping.

Cheers

from react_native_sdk.

mihaerzen avatar mihaerzen commented on July 17, 2024

Thank you for your response @uerceg! It makes sense what you wrote.

As the method is called componentWillUnmount it implies it should be used in the componentWillUnmount react lifecycle hook but actually it's just a cleanup method. Maybe one proposal would be to re-name it to something which reflects that better. Maybe Adjust.destroy()?

Again thank you for a fast reply, greatly appreciated!

from react_native_sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.