Last active
February 21, 2017 13:24
-
-
Save MacKentoch/783e2f17d701c03396e07228d60cd295 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Beacons from 'react-native-beacons-manager'; | |
class RNbeaconArticle extends Component { | |
// ... | |
componentWillMount(){ | |
// | |
// ONLY non component state aware here in componentWillMount | |
// | |
// Request for authorization while the app is open | |
Beacons.requestWhenInUseAuthorization(); | |
// Define a region which can be identifier + uuid, | |
// identifier + uuid + major or identifier + uuid + major + minor | |
// (minor and major properties are numbers) | |
const region = { | |
identifier: 'GemTot for iOS', | |
uuid: '6665542b-41a1-5e00-931c-6a82db9b78c1' // => IMPORTANT: replace here with your beacon "uuid" | |
}; | |
// Range for beacons inside the region | |
Beacons.startRangingBeaconsInRegion(region); | |
} | |
// ... | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment