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
Once you have the credentials, you can configure the DevRev SDK in your app.
55
63
56
64
To configure the SDK, you need to call the following method inside your `Application` class:
57
65
58
66
```kotlin
59
67
fun DevRev.configure(
60
-
context:Context,
61
-
appID:String,
62
-
secret:String,
63
-
organizationSlug:String
68
+
context:Context,
69
+
appID:String,
70
+
secret:String,
71
+
supportId:String
64
72
)
65
73
```
66
74
67
-
In case you do not have a custom `Application` class, you have to extend one like this:
75
+
In case you do not have a custom `Application` class, you have to extend one like in the following example:
68
76
69
77
```kotlin
70
78
importai.devrev.sdk.DevRev
@@ -77,37 +85,38 @@ class FooApplication : Application() {
77
85
context =this,
78
86
appId ="<APP_ID>",
79
87
secret ="<SECRET>",
80
-
organizationSlug="<ORG_SLUG>"
88
+
supportId="<SUPPORT_ID>",
81
89
)
82
90
}
83
91
}
84
92
```
85
93
In the `onCreate` method in your `Application`, you need to configure the DevRev SDK with the required parameters. Here you need to use the credentials that we have created before.
86
94
87
-
Moreover, the custom application should be defined in `AndroidManifest.xml` like this:
95
+
Moreover, the custom application should be defined in `AndroidManifest.xml` like in the following example:
88
96
```xml
89
97
<application
90
98
android:name=".FooApplication">
91
99
</application>
92
100
```
93
101
94
102
# Features
95
-
Before you can use the PLuG support feature, you need to `identify` the user like this:
103
+
Before start using the PLuG chat feature, user identification is required. There are many arguments mobile applications can submit in order to identify the user. The following example takes the most simplistic approach and provides a bare minimum of arguments required for successful user identification:
Please read PluG API documentation to learn more about user identification options.
101
110
102
-
Now you can use the support chat feature.
111
+
After completing user identification, it is possible to start using the chat (conversations) dialog supported by our DevRev SDK.
103
112
104
-
To open the support chat, you can call the function
113
+
In order to open the chat dialog, application should use `showSupport` API, as demonstrated in the following example:
105
114
106
115
```kotlin
107
116
DevRev.showSupport(context:Context)
108
117
```
109
118
110
-
Or you can include it in the view with the following code in your XML layout:
119
+
Mobile PluG SDK also exposes the support button, which can be added to your application. Including it in the current screen requires adding the following code in your XML layout:
111
120
```xml
112
121
<ai.devrev.sdk.plug.view.PlugFloatingActionButton
113
122
android:id="@+id/plug_fab"
@@ -117,23 +126,29 @@ Or you can include it in the view with the following code in your XML layout:
117
126
app:layout_constraintBottom_toBottomOf="parent"
118
127
app:layout_constraintEnd_toEndOf="parent" />
119
128
```
120
-
The button can also accept default parameters like
121
-
`android:src="@your_drawable_here"`
122
-
and
123
-
`android:backgroundTint="@your_background_color"`
129
+
The support button can also accept default parameters like
130
+
```kotlin
131
+
android:src="@your_drawable_here"
132
+
```
133
+
and/or
134
+
```kotlin
135
+
android:backgroundTint="@your_background_color"
136
+
```
124
137
so that you can customize it to your own needs.
125
-
The button will show up on your screen and by default, it should look like this:
138
+
The button will show up on your screen. The button will show up on your screen. Please check the following screenshot to visualize how the support button is expected to look in our application:
You should now be able to run the app and use all the functionalities of the PLuG Support chat. The button click will navigate to the support chat.
142
+
At this point, it should be possible to run the app and use all the functionalities of the DevRev PLuG SDK. Pressing the support button would navigate user to the chat.
A sample app with use cases for both function and XML implementation has been provided as part of this repository.
147
+
Please note that all examples presented in this document are generated using DevRev SDK sample app. The sample app with examples for both function and XML implementation has been provided as part of this repository. Users are kindly encouraged to run the sample app before integrating PluG SDK in the destination application.
135
148
136
149
# Troubleshooting
137
-
In case you are having trouble with importing the DevRev SDK, check if you have the correct dependency, as well as Github maven URL in your root's project.
150
+
In case of any issues with the integration of the DevRev SDK, please verify that the dependency is correctly set in the project. In addition, please make sure that mavenCentral is reachable from the IDE and that the DevRev PluG SDK version of choice was correctly detected.
151
+
152
+
In case the `showSupport()` function or XML button are not responding, make sure the user has been identified beforehand.
138
153
139
-
If the `showSupport()` function or XML button are not responding, make sure the user has been identified beforehand or if configuration accepted the right parameters for `appID` and `secret`.
154
+
To ensure correct operation, correctly setting App ID and secrete is of paramount importance. Please double-check that both values are correctly configured in your application or sample app.
0 commit comments