Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/watzak/react-native-instagram-oauth
react-native interface to login to instagram (iOS)
https://github.com/watzak/react-native-instagram-oauth
Last synced: 5 days ago
JSON representation
react-native interface to login to instagram (iOS)
- Host: GitHub
- URL: https://github.com/watzak/react-native-instagram-oauth
- Owner: watzak
- Created: 2015-11-14T16:38:54.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-25T05:49:55.000Z (over 8 years ago)
- Last Synced: 2024-04-26T05:32:18.080Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 423 KB
- Stars: 70
- Watchers: 5
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-react-native - react-native-instagram-oauth ★63 - react-native instagram login (Components / Integrations)
- awesome-react-native - react-native-instagram-oauth ★63 - react-native instagram login (Components / Integrations)
- awesome-react-native - react-native-instagram-oauth ★63 - react-native instagram login (Components / Integrations)
- awesome-react-native - react-native-instagram-oauth ★63 - react-native instagram login (Components / Integrations)
- awesome-react-native-ui - react-native-instagram-oauth ★37 - react-native instagram login (Components / Integrations)
README
# react-native-instagram-oauth
react-native interface to login to instagram (iOS)## Getting started
1. `npm install react-native-instagram-oauth@latest --save`
2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
3. Go to `node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj` ➜ and add `RCTLinking.xcodeproj`
4. In XCode, in the project navigator, select your project. Add `libRCTLinking.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
5. Click `RCTLinking.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../../react-native/React` and `$(SRCROOT)/../../../React` - mark both as `recursive`.
6. Run your project (`Cmd+R`)
7. Register a new client on instagram itself => https://instagram.com/developer/clients/manage/
![Alt Text](https://github.com/watzak/react-native-instagram-oauth/raw/master/demo.png)## Usage
```javascript
var RNInstagramOAuth = require('react-native-instagram-oauth');var instagram: {
client_id: '',
redirect_url: '' // e.g.: 'test://init'
};function getInstagramByMyself (access_token) {
fetch('https://api.instagram.com/v1/users/self/?access_token='+access_token)
.then((response) => response.json()).then((responseData) => {
console.log(responseData);
});
}RNInstagramOAuth(instagram.client_id, instagram.redirect_url, (err, access_token) => {
if (err) { console.log(err) }
if (access_token !== undefined) {
console.log(access_token);getInstagramByMyself(access_token);
}
});
```Can be easily used together with react-native-instagram-share (https://github.com/watzak/react-native-instagram-share)