Skip to content

Commit 97db0bd

Browse files
committed
Update readme
1 parent eb68968 commit 97db0bd

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repositories {
3232
3333
dependencies {
3434
...
35-
compile 'ch.freshbits.pathshare.sdk:pathshare-sdk:1.0.1'
35+
compile 'ch.freshbits.pathshare.sdk:pathshare-sdk:2.0.0'
3636
}
3737
```
3838

@@ -62,12 +62,12 @@ public class ExampleApplication extends Application {
6262
}
6363
```
6464

65-
### Save Username
65+
### Save User
6666

6767
Before creating a session, you need to set a username:
6868

6969
```java
70-
Pathshare.client().saveUserName("Candice", new ResponseListener() {
70+
Pathshare.client().saveUser("Candice", "+14159495533", UserType.DRIVER, new ResponseListener() {
7171
@Override
7272
public void onSuccess() {
7373
// ...
@@ -80,6 +80,14 @@ Pathshare.client().saveUserName("Candice", new ResponseListener() {
8080
});
8181
```
8282

83+
There are different types of users for specific industries:
84+
85+
User Types | Description
86+
----------------------------|------------------------------------------------------------
87+
`TECHNICIAN`, `MOTORIST` | For roadside assitance industry or similar
88+
`DRIVER`, `RECIPIENT` | For delivery services or similar
89+
`INVESTIGATOR`, `CLIENT` | For legal services industry or similar
90+
8391
### Create Session
8492

8593
To create a session, use the session builder:
@@ -150,19 +158,39 @@ session = new Session.Builder()
150158
To join the session you created, call the `joinUser()` method on the session object:
151159

152160
```java
153-
session.joinUser(new ResponseListener() { ... });
161+
session.join(new ResponseListener() { ... });
154162

155163
session.isUserJoined() // => true
156164
```
157165

158166
This call will add your Pathshare user to the session and you will be able to see his location on a map in realtime in the Pathshare Professional web interface.
159167

168+
### Invite a customer
169+
170+
To invite a customer to the session, call the `inviteUser()` method on the session object:
171+
172+
```java
173+
session.inviteUser("Customer name", UserType.CLIENT, "[email protected]", "+14159495533", new InvitationResponseListener() {
174+
@Override
175+
public void onSuccess(URL url) {
176+
// ...
177+
Log.d("URL", url.toString()); // => https://m.pathsha.re/12s83a
178+
}
179+
180+
public void onError() {
181+
// ...
182+
}
183+
});
184+
```
185+
186+
This call will create a customer user and return an invitation URL that can be sent to the customer using your preffered channel. The customer will then see the driver's location in realtime as well as the ETA in a white-labeled view with your corporate identity.
187+
160188
### Leave Session
161189

162190
In order to stop sending user location and remove the user from the session, call the `leaveUser()` method:
163191

164192
```java
165-
session.leaveUser(new ResponseListener() { ... });
193+
session.leave(new ResponseListener() { ... });
166194
```
167195

168196
### Find Session

0 commit comments

Comments
 (0)