You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: docs/getting_started.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ $fb = new Facebook\Facebook([
93
93
94
94
You'll need to replace the `{app-id}` and `{app-secret}` with your Facebook app's ID and secret which can be obtained from the [app settings tab](https://developers.facebook.com/apps).
95
95
96
-
> **Warning:** It's important that you specify a `default_graph_version` value as this will give you more control over which version of Graph you want to use. If you don't specify a `default_graph_version`, the SDK for PHP will choose one for you and it might not be one that is compatible with your app.
96
+
> **Warning:** It's important that you specify a `default_graph_version` value as this will give you more control over which version of Graph you want to use. If you don't specify a `default_graph_version`, the SDK will throw an [`InvalidArgumentException`](http://php.net/invalidargumentexception). See more about [Graph API versions](https://developers.facebook.com/docs/apps/versions).
97
97
98
98
The `Facebook\Facebook` service ties all the components of the SDK for PHP together. [See the full reference for the `Facebook\Facebook` service](reference/Facebook.md).
Copy file name to clipboardExpand all lines: docs/reference/Facebook.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,20 +57,20 @@ $fb = new Facebook\Facebook([
57
57
```
58
58
59
59
### `app_id`
60
-
The ID of your Facebook app (required).
60
+
**(Required)**The ID of your Facebook app. If not set, defaults to [the environment variables fallback](#environment-variables-fallback) if available.
61
61
62
62
### `app_secret`
63
-
The secret of your Facebook app (required).
63
+
**(Required)** The secret of your Facebook app. If not set, defaults to [the environment variables fallback](#environment-variables-fallback) if available.
64
+
65
+
### `default_graph_version`
66
+
**(Required)** Allows you to set the default Graph version number. Set this as a string as it would appear in the Graph url, e.g. `v2.8`. See the [latest version of Graph](https://developers.facebook.com/docs/apps/changelog) for more info on Graph versions.
64
67
65
68
### `default_access_token`
66
69
The default fallback access token to use if one is not explicitly provided. The value can be of type `string` or `Facebook\AccessToken`. If any other value is provided an `InvalidArgumentException` will be thrown. Defaults to `null`.
67
70
68
71
### `enable_beta_mode`
69
72
Enable [beta mode](https://developers.facebook.com/docs/apps/beta-tier) so that request are made to the [https://graph.beta.facebook.com](https://graph.beta.facebook.com/) endpoint. Set to boolean `true` to enable or `false` to disable. Defaults to `false`.
70
73
71
-
### `default_graph_version`
72
-
Allows you to overwrite the default Graph version number set in `Facebook\Facebook::DEFAULT_GRAPH_VERSION`. Set this as a string as it would appear in the Graph url, e.g. `v2.8`. Defaults to the [latest version of Graph](https://developers.facebook.com/docs/apps/changelog).
73
-
74
74
### `http_client_handler`
75
75
Allows you to overwrite the default HTTP client.
76
76
@@ -143,10 +143,12 @@ If any other value is provided an `InvalidArgumentException` will be thrown.
143
143
144
144
The only required configuration options are `app_id` and `app_secret`. However, the SDK will look to environment variables for the app ID and app secret.
145
145
146
-
To take advantage of this feature, simply set an environment variable named `FACEBOOK_APP_ID` with your Facebook app ID and set an environment variable named `FACEBOOK_APP_SECRET` with your Facebook app secret and you will be able to instantiate the `Facebook\Facebook` service without setting any configuration in the constructor.
146
+
To take advantage of this feature, simply set an environment variable named `FACEBOOK_APP_ID` with your Facebook app ID and set an environment variable named `FACEBOOK_APP_SECRET` with your Facebook app secret and you will be able to instantiate the `Facebook\Facebook` service with only needing to specify the `default_graph_version` option.
147
147
148
148
```php
149
-
$fb = new Facebook\Facebook();
149
+
$fb = new Facebook\Facebook([
150
+
'default_graph_version' => 'v2.8',
151
+
]);
150
152
```
151
153
152
154
# Instance Methods
@@ -208,7 +210,7 @@ This setting will overwrite the value from `default_access_token` option if it w
208
210
```php
209
211
public string getDefaultGraphVersion()
210
212
```
211
-
Returns the default version of Graph. If the `default_graph_version` configuration option was not set, this will default to `Facebook\Facebook::DEFAULT_GRAPH_VERSION`.
213
+
Returns the default version of Graph set with the `default_graph_version` configuration option.
0 commit comments