1.0.5 • Published 3 years ago

react-native-app-tour v1.0.5

Weekly downloads
93
License
Apache License
Repository
github
Last release
3 years ago
ReactNative: Native App Tour Library (Android/iOS)

If this project has helped you out, please support us with a star 🌟

This library is a React Native bridge around native app tour libraries. It allows show/guide beautiful tours:

Android: KeepSafe/TapTargetView
iOS: aromajoin/material-showcase-ios

📖 Getting started

$ npm install react-native-app-tour --save

Supported react-native 61 and above

  • iOS

iOS Prerequisite: Please make sure CocoaPods is installed on your system

- Add the following to your `Podfile` -> `ios/Podfile` and run pod update:
  use_native_modules!

  pod 'RNAppTour', :path => '../node_modules/react-native-app-tour/ios'

  use_frameworks! :linkage => :static

  pod 'MaterialShowcase'

  # Follow [Flipper iOS Setup Guidelines](https://fbflipper.com/docs/getting-started/ios-native)
  # This is required because iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile
  $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
    'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
    'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
    'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
        if $static_framework.include?(pod.name)
          def pod.build_type;
            Pod::BuildType.static_library
          end
        end
      end
  end
  • Please make sure Flipper iOS Setup Guidelines steps are added to Podfile, since MaterialShowcase is implemented using Swift and we have to use use_frameworks! in Podfile

  • Android

Please add below snippet into your app build.gradle

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

💬 ISSUES

  • If you install this package and get an error saying postinstall failed this most likely means
    • You are trying to run install modules from outside of project root (react-native-git-upgrade)
      • FIX: remove react-native-app-tour from package.json and rerun
    • Pods version is out of date.
      • pod repo update
  • If you encounter File not found in iOS issue while setup, please refer ISSUE - 3 issue which might help you in order to resolve.
  • If you have problems with Android Trying to resolve view with tag which doesn't exist or can't resolve tag. Please add props collapasable: false to your View

🎨 API's

  • AppTourView.for: AppTourTarget
let appTourTarget = AppTourView.for(Button, {...native-library-props})

AppTour.ShowFor(appTourTarget)
  • AppTourSequence
    • add(AppTourTarget)
    • remove(AppTourTarget)
    • removeAll
    • get(AppTourTarget)
    • getAll
let appTourSequence = new AppTourSequence()
this.appTourTargets.forEach(appTourTarget => {
appTourSequence.add(appTourTarget)
})

AppTour.ShowSequence(appTourSequence)
  • AppTour
    • ShowFor(AppTourTarget)
    • ShowSequence(AppTourTargets)

💡 Props

Note:

  • General(iOS & Android)
PropTypeDefaultNote
order: mandatorynumberSpecify the order of tour target
titlestringSpecify the title of tour
descriptionstringSpecify the description of tour
outerCircleColorstring: HEX-COLORSpecify a color for the outer circle
targetCircleColorstring: HEX-COLORSpecify a color for the target circle
titleTextSizenumber20Specify the size (in sp) of the title text
titleTextColorstring: HEX-COLORSpecify the color of the title text
descriptionTextSizenumber10Specify the size (in sp) of the description text
descriptionTextColorstring: HEX-COLORSpecify the color of the description text
targetRadiusnumber60Specify the target radius (in dp)
cancelablebooltrueWhether tapping anywhere dismisses the view
  • Android
PropTypeDefaultNote
collapsable: mandatoryboolSpecify collapsable false if your view just contains children. Please read view#collapsable for the details
outerCircleAlphanumber0.96fSpecify the alpha amount for the outer circle
textColorstring: HEX-COLORSpecify a color for both the title and description text
dimColorstring: HEX-COLORIf set, will dim behind the view with 30% opacity of the given color
drawShadowbooltrueWhether to draw a drop shadow or not
tintTargetbooltrueWhether to tint the target view's color
transparentTargetbooltrueSpecify whether the target is transparent (displays the content underneath)
  • iOS
PropTypeDefaultNote
backgroundPromptColorstring: HEX-COLORUIColor.blueSpecify background prompt color
backgroundPromptColorAlphanumber0.96Specify background prompt color alpha
titleTextAlignmentstringleftSpecify primary text alignment: Left, Right, Top, Bottom
descriptionTextAlignmentstringleftSpecify secondary text alignment: Left, Right, Top, Bottom
aniComeInDurationnumber0.5Specify animation come In Duration
aniGoOutDurationnumber1.5Specify animation Go Out Duration
aniRippleColorstring: HEX-COLOR#FFFFFFSpecify ripple color
aniRippleAlphanumber0.2Specify ripple alpha

🔧 Breaking Changes

  • V0.0.4

    • Generalized props across platforms @congnguyen91
    • Migrated License to Apache 2.0
  • V0.0.10

    • Added order as a mandatory property to each target
    • Each component which is to be rendered in the tour should have a key prop. It is mandatory.

✨ Credits

🤔 How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

💫 Where is this library used?

If you are using this library in one of your projects, add it in this list below. ✨

📜 License

This library is provided under the Apache 2 License.

RNAppTour @ prscX

💖 Support my projects

I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like 🚀
  • If you're feeling especially charitable, please follow prscX on GitHub.

    Thanks! ❤️ prscX.github.io </ Pranav >

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago