Skip to content

Showcase using reference id in native side. Kotlin + Swift

License

Notifications You must be signed in to change notification settings

hackdie/react-native-show-case

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-show-case

Screenshot

Getting started

$ npm install react-native-show-case --save

Mostly automatic installation

$ react-native link react-native-show-case

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-show-case and add RNShowCase.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNShowCase.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNShowCasePackage; to the imports at the top of the file
  • Add new RNShowCasePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-show-case'
    project(':react-native-show-case').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-show-case/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-show-case')
    

Usage

import {
  View,
  Text,
  findNodeHandle,
} from 'react-native';
import RNShowCase from 'react-native-show-case';

...

componentDidMount = () => {
   setTimeout(() => {
      const handleId = findNodeHandle(this.superRef);
      RNShowCase.show(handleId, 'Title', 'Description yea!!!');
    }, 100);
}

...

render = () => {
return (
	<View style={...}>
	<Text ref={r => {this.superRef = r}}> Show showcase here </Text>
	</View>)
} 

TODO

  1. Listeners onCasePresented, onCaseDismissed

Credits

This project is just a wraper for https://github.com/rahuliyer95/iShowcase and https://github.com/mreram/ShowCaseView

License RNShowCase is available under the MIT license. See the LICENSE file for more info.

About

Showcase using reference id in native side. Kotlin + Swift

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published