Skip to content

Commit

Permalink
Merge pull request #32 from auth0/deprecate-webview
Browse files Browse the repository at this point in the history
Remove Deprecated WebView/Fullscreen options
  • Loading branch information
hzalaz authored Oct 14, 2016
2 parents 078f3e1 + 797c4ed commit 506fbc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
44 changes: 0 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,39 +244,6 @@ First go to [Auth0 Dashboard](https://manage.auth0.com/#/applications) and go to
https://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback
```

#### Configuration: Using the WebView

Open your app's `AndroidManifest.xml` file and add the following permissions.

```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

> The `ACCESS_NETWORK_STATE` permission it's not mandatory, but used by the WebAuthActivity to check for internet availability before executing a request.
Also register the WebAuthActivity inside the `application` tag like


```xml
<application android:theme="@style/AppTheme">

<!-- ... -->

<activity
android:name="com.auth0.android.provider.WebAuthActivity"
android:theme="@style/MyAppTheme"/>

<!-- ... -->

</application>
```

Finally, define a constant like `WEB_REQ_CODE` that holds the request code (an `int`), that will be sent back with the intent once the authentication is finished in the webview.


#### Configuration: Using the Browser

Open your app's `AndroidManifest.xml` file and add the following permission.

```xml
Expand Down Expand Up @@ -361,16 +328,6 @@ WebAuthProvider.init(account)
.start(MainActivity.this, authCallback, WEB_REQ_CODE);
```

#### Use browser instead of WebView

```java
WebAuthProvider.init(account)
.useBrowser(true)
.start(MainActivity.this, authCallback, WEB_REQ_CODE);
```
> Make sure to check the callback url and manifest configuration explained above.

#### Specify scope

```java
Expand All @@ -393,7 +350,6 @@ WebAuthProvider.init(account)

```java
WebAuthProvider.init(account)
.useBrowser(true)
.start(MainActivity.this, authCallback, WEB_REQ_CODE);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ public static class Builder {
*
* @param useBrowser if the authentication is handled in a Browser.
* @return the current builder instance
* @deprecated This method has been deprecated since Google is no longer supporting WebViews to perform login.
*/
@Deprecated
public Builder useBrowser(boolean useBrowser) {
this.useBrowser = useBrowser;
return this;
Expand All @@ -138,7 +140,9 @@ public Builder useBrowser(boolean useBrowser) {
*
* @param useFullscreen if the activity should be fullscreen or not.
* @return the current builder instance
* @deprecated This method has been deprecated since it's only applied to WebView authentication and Google is no longer supporting them to perform login.
*/
@Deprecated
public Builder useFullscreen(boolean useFullscreen) {
this.useFullscreen = useFullscreen;
return this;
Expand Down

0 comments on commit 506fbc5

Please sign in to comment.