stackbuilders / react-native-spotlight-tour

A highly customizable tour feature with an awesome spotlight effect
https://stackbuilders.github.io/react-native-spotlight-tour/
MIT License
225 stars 27 forks source link

Bring up tour only on the first run of the app #52

Open Adarsh1993 opened 2 years ago

Adarsh1993 commented 2 years ago

Thanks for great package .

How to hints show in first time when app is start .

second time disable . This is possible with spotlight tour.

Thank you

JoseLion commented 2 years ago

Hi @Adarsh1993, I'm glad you're finding this package useful 🙂

It's possible to start the tour as soon as the app begins using a ref and a useEffect(..). We had a suggestion about making this easier in #50, and we'll be implementing a prop for that soon. You can also find a complete example of it in that issue.

There's no built-in feature to start the tour only the first time, but you can add that logic yourself in the useEffect mentioned above. You can use a package like async-storage to store a per-device flag. Then you can start the tour base on this flag and update the flag once the tour has finished.

This could be a great feature for us to implement since most people might be using the tour this way, and we could reduce the burden of managing the stored flags. However, we'd have to evaluate the details because that'd mean adding a dependency on async-storage or a similar package.

I'll leave this ticket open to keep you posted on the topic. Thanks again! Your feedback helps us make this package better and better 🙂

mohamedabkal commented 2 years ago

@JoseLion Yes please this feature is very important. If you can add it it would amazing! 💪

jakequade-hsm commented 3 months ago

This is on the developer to implement, not on the library. Use something like a useEffect in conjunction with AsyncStorage to set a hasSeenTour value.