Skip to content

Commit

Permalink
cr: modify README
Browse files Browse the repository at this point in the history
  • Loading branch information
rnike committed Mar 12, 2021
1 parent b543370 commit 375e7e7
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,31 @@ The `AppDelegate.m` file can only have one method for `openUrl`. If you're also

### SDK Initialization

The `autoInitEnabled` option is removed from [facebook-ios-sdk#v9.0.0](https://github.com/facebook/facebook-ios-sdk/blob/master/CHANGELOG.md#900). On iOS, developers are required to initialize the sdk after app launched.
The `autoInitEnabled` option is removed from [facebook-ios-sdk#v9.0.0](https://github.com/facebook/facebook-ios-sdk/blob/master/CHANGELOG.md#900).

On iOS, developers are required to initialize the sdk after app launched, implement the code below in your `AppDelegate.m`:

```objective-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FBSDKApplicationDelegate initializeSDK:launchOptions]; // <- add this

// your other stuff
}
```

Or call `Settings.initializeSDK` in anywhere else if you want the sdk to be initialized in react-native

```js
import { Settings } from 'react-native-fbsdk';
import { Platform } from 'react-native';
import { Settings } from 'react-native-fbsdk-next';

Settings.initializeSDK();
if(Platform.OS === 'ios'){
Settings.initializeSDK();
}
```
#### NOTE: This method is also functional on Android

> NOTE: `Settings.initializeSDK` is also functional for Android, if you want to comply with [GDPR](https://developers.facebook.com/docs/app-events/gdpr-compliance), `Settings.initializeSDK` can be called after an end user provides consent.
### [Login](https://developers.facebook.com/docs/facebook-login)

Expand Down

0 comments on commit 375e7e7

Please sign in to comment.