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 Apr 10, 2025. It is now read-only.
The Virtusize Auth SDK for Android is a closed-source library that handles the SNS authentication process for our [Virtusize Android Integration](https://github.com/virtusize/integration_android).
6
6
7
+
8
+
9
+
## Requirements
10
+
11
+
- minSdkVersion >= 21
12
+
13
+
- compileSdkVersion >= 30
14
+
15
+
- Setup in AppCompatActivity
16
+
17
+
18
+
7
19
## Getting Started
8
20
9
-
1. In your root build.gradle file, edit the `repositories` section to include the following:
21
+
### 1. Installation
22
+
23
+
1. In your *root* build.gradle file, edit the `repositories` section to include the following:
10
24
11
25
```groovy
12
26
allprojects {
@@ -18,10 +32,207 @@ allprojects {
18
32
}
19
33
```
20
34
21
-
2. In your root build.gradle file, edit the `dependencies` section to include the following:
35
+
2. In your *app* build.gradle file, edit the `dependencies` section to include the following:
### 2. Create a Custom URL Scheme for Virtusize SNS Auth
46
+
47
+
The SNS authentication flow requires opening a Chrome Custom Tab, which will load a web page for the user to login with their SNS account. In order to return the login response from a Chrome Custom Tab to your app, a custom URL scheme must be defined inside the manifest.
48
+
49
+
Edit your `AndroidManifest.xml` file to include an intent filter and a `<data>` tag for the custom URL scheme.
2. The URL scheme must begin with your app's package ID (com.your-company.your-app) and **end with .virtusize**
78
+
3. The scheme which you define must use all **lowercase** letters
79
+
80
+
81
+
82
+
## Enable Virtusize SNS Login for your WebView app
83
+
84
+
Use either of the following methods to enable Virtusize SNS login
85
+
86
+
### Method 1: Use the VirtusizeWebView
87
+
88
+
##### **Step 1: Replace your `WebView` with `VirtusizeWebView`**
89
+
90
+
To enable users to sign up or log in with the web version of Virtusize integration in your webview, please replace your `WebView` with **`VirtusizeWebView`** in your Kotlin or Java file and XML file to fix and enable SNS login in Virtusize.
91
+
92
+
- Kotlin/Java
93
+
94
+
```diff
95
+
// Kotlin
96
+
- var webView: WebView
97
+
+ var webView: VirtusizeWebView
98
+
99
+
// Java
100
+
- WebView webView;
101
+
+ VirtusizeWebView webView;
102
+
```
103
+
104
+
and
105
+
106
+
- XML
107
+
108
+
```diff
109
+
- <WebView
110
+
+ <com.virtusize.libsource.VirtusizeWebView
111
+
android:id="@+id/webView"
112
+
android:layout_width="match_parent"
113
+
android:layout_height="match_parent" />
114
+
```
115
+
116
+
##### Step 2: Set the Virtusize SNS auth activity result launcher to `VirtusizeWebView`
117
+
118
+
- Kotlin
119
+
120
+
```kotlin
121
+
// Register the Virtusize SNS auth activity result launcher
122
+
privateval virtusizeSNSAuthLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
123
+
// Handle the SNS auth result of the VirtusizeAuthActivity by passing the webview and the result to the `VirtusizeAuth.handleVirtusizeSNSAuthResult` function
0 commit comments