Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
react-native-fbsdk-0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhuowen committed Jan 19, 2017
1 parent 1777674 commit 023d2e1
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Sample app
Sample/
# sample app
sample/
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ react-native init YourApp
Install and link the react-native-fbsdk package:
```ruby
react-native install react-native-fbsdk
react-native link react-native-fbsdk
```
### 3. Configure native projects

Expand Down Expand Up @@ -65,7 +66,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
mCallbackManager.onActivityResult(requestCode, resultCode, data);
}
```
Before you can run the project, follow the [Getting Started Guide](https://developers.facebook.com/docs/android/getting-started/) for Facebook Android SDK to set up a Facebook app. You can skip the build.gradle changes since that's taken care of by the rnpm link step above, but ***make sure*** you follow the rest of the steps such as calling `FacebookSdk.sdkInitialize` and updating `strings.xml` and `AndroidManifest.xml`. Note that react-native project doesn't have the Application class, so you'll need to create an implementation of the Application class yourself.
Before you can run the project, follow the [Getting Started Guide](https://developers.facebook.com/docs/android/getting-started/) for Facebook Android SDK to set up a Facebook app. You can skip the build.gradle changes since that's taken care of by the rnpm link step above, but ***make sure*** you follow the rest of the steps such as calling `FacebookSdk.sdkInitialize` and updating `strings.xml` and `AndroidManifest.xml`. Note that react-native project ***doesn't have*** the Application class, so you'll need to create an implementation of the Application class yourself.

**If your react-native version is 0.29 or above**

Expand All @@ -79,7 +80,6 @@ import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.appevents.AppEventsLogger;

...

public class MainApplication extends Application implements ReactApplication {
Expand Down Expand Up @@ -159,6 +159,10 @@ Make sure you have the latest [Xcode](https://developer.apple.com/xcode/) instal

- Make sure that `libRCTFBSDK.a` shows up in the **Link Binary with Libraries** section of your build target's **Build Phases**.

4. I get this build error: `no type or protocol named UIApplicationOpenURLOptionsKey`:

- Your XCode version is too old, upgrade to XCode 8.0+.

## Usage
### [Login](https://developers.facebook.com/docs/facebook-login)
#### Login Button + Access Token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class FBSDKPackage implements ReactPackage {

public static final String VERSION_TO_RELEASE = "ReactNative-v0.4.0";
public static final String VERSION_TO_RELEASE = "ReactNative-v0.5.0";

private CallbackManager mCallbackManager;
public FBSDKPackage(CallbackManager callbackManager) {
Expand Down
2 changes: 1 addition & 1 deletion ios/RCTFBSDK/core/RCTFBSDKInitializer.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ @implementation RCTFBSDKInitializer
- (instancetype)init
{
if ((self = [super init])) {
[FBSDKSettings setUserAgentSuffix:@"ReactNative-v0.4.0"];
[FBSDKSettings setUserAgentSuffix:@"ReactNative-v0.5.0"];
}
return self;
}
Expand Down
1 change: 1 addition & 0 deletions ios_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
2. npm install the packages: plist, xcode, adm-zip.
3. do 'node ios_setup.js <AppID> <AppName>'.
*/
'use strict';

const fs = require('fs');
const path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-fbsdk",
"version": "0.4.0",
"version": "0.5.0",
"description": "Facebook SDK support for React Native apps.",
"main": "./js/index.js",
"author": {
Expand Down
1 change: 0 additions & 1 deletion sample/HelloFacebook/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ esproposal.class_instance_fields=enable

munge_underscores=true

module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
Expand Down
6 changes: 4 additions & 2 deletions sample/HelloFacebook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Now you can run the iOS app.

To run the Android project,
```java
npm install #install react-native
rnpm install react-native-fbsdk
npm install react
npm install react-native #install react-native
react-native install react-native-fbsdk
react-native link react-native-fbsdk
```
Now you can run the Android app.
1 change: 1 addition & 0 deletions sample/HelloFacebook/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
'use strict';

const FBSDK = require('react-native-fbsdk');

Expand Down
1 change: 1 addition & 0 deletions sample/HelloFacebook/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
'use strict';

const FBSDK = require('react-native-fbsdk');

Expand Down
4 changes: 2 additions & 2 deletions sample/HelloFacebook/ios/HelloFacebook/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#import "AppDelegate.h"

#import "RCTBundleURLProvider.h"
#import "RCTRootView.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#import <FBSDKCoreKit/FBSDKCoreKit.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>

#import "RCTLog.h"
#import "RCTRootView.h"
#import <React/RCTLog.h>
#import <React/RCTRootView.h>

#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
Expand Down
6 changes: 3 additions & 3 deletions sample/HelloFacebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"test": "jest"
},
"dependencies": {
"react": "15.3.2",
"react-native": "0.36.1",
"react-native-fbsdk": ">=0.3.0"
"react": ">=15.4.2",
"react-native": ">=0.40.0",
"react-native-fbsdk": ">=0.5.0"
},
"jest": {
"preset": "jest-react-native"
Expand Down

0 comments on commit 023d2e1

Please sign in to comment.