Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syarul/react-native-fbintent
A React Native intent for Android Facebook App
https://github.com/syarul/react-native-fbintent
Last synced: about 1 month ago
JSON representation
A React Native intent for Android Facebook App
- Host: GitHub
- URL: https://github.com/syarul/react-native-fbintent
- Owner: syarul
- License: mit
- Created: 2015-11-03T00:45:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T01:00:51.000Z (about 9 years ago)
- Last Synced: 2024-10-13T15:14:01.767Z (2 months ago)
- Language: Java
- Size: 141 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-fbintent ★4 - A React Native intent for Android Facebook App (Components / Integrations)
- awesome-react-native - react-native-fbintent ★4 - A React Native intent for Android Facebook App (Components / Integrations)
- awesome-react-native - react-native-fbintent ★4 - A React Native intent for Android Facebook App (Components / Integrations)
- awesome-react-native-ui - react-native-fbintent ★3 - A React Native intent for Android Facebook App (Components / Integrations)
- awesome-react-native - react-native-fbintent ★4 - A React Native intent for Android Facebook App (Components / Integrations)
README
# react-native-mapintent
A React Native intent for Android Facebook App.
### Installation
```bash
npm install --save react-native-fbintent
```### Add it to your android project
* In `android/setting.gradle`
```gradle
...
include ':RNFbIntent', ':app'
project(':RNFbIntent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbintent')
```* In `android/app/build.gradle`
```gradle
...
dependencies {
...
compile project(':RNFbIntent')
}
```* register module (in MainActivity.java)
```java
import com.syarul.fbintent.RNFbIntentPackage; // <--- importpublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new RNFbIntentPackage()) // <------ add here
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
setContentView(mReactRootView);
}......
}
```## Example
FbIntent.open(facebook_page_id)
* **facebook_page_id:** *(string)* facebook page id, use [http://findmyfbid.com/](http://findmyfbid.com/) to find the id of a page. If user does not install facebook app it will open facebook page in the browser.
Example:
```javascript
var FbIntent = require('react-native-fbintent');FbIntent.open('461828740557560');
```
## LicenseMIT