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
You do not need to filter or check the body of the `remoteMessage` data, FlyBuy will inspect it and only process the notification if it is relevant to the SDK.
15
16
16
17
Since a device's push token can change, the FlyBuy SDK needs to be informed when that occurs. To do so, override the `FirebaseMessagingingService.onNewToken()` method as follows.
17
18
18
-
```
19
-
override fun onNewToken(token: String?) {
20
-
FlyBuy.onNewPushToken(token)
21
-
}
19
+
```kotlin
20
+
overridefunonNewToken(token:String?) {
21
+
FlyBuy.onNewPushToken(token)
22
+
}
22
23
```
23
24
24
25
The SDK should also be updated with the push token when the app starts. The following code snippet provides an example function that can be called from `onCreate()` in your activity.
// update order claim view with order details here
51
26
}
27
+
}
52
28
```
53
29
54
-
## Create Order
55
-
56
-
Create an order by passing order identifiers to the `create` method. There are numerous attributes available, but the only mandatory ones are the `siteID` and `partnerIdentifier`. Returns a `LiveData<WorkStatus>` stream for observing status
57
-
58
-
```
59
-
val info = CreateOrderInfo(
60
-
siteID = 101,
61
-
partnerIdentifier = "1234123",
62
-
customerCarColor = "#FF9900",
63
-
customerCarType = "Silver Sedan",
64
-
customerLicensePlate = "XYZ-456",
65
-
customerName = customerName
66
-
)
67
-
68
-
fun create(): LiveData<WorkStatus> {
69
-
return ordersOperation.findOrder(info)
30
+
To claim the order for the current customer, the app should call the `claim` method:
|`partnerIdentifier`| Internal customer or order identifier. |
79
-
|`customerCarColor`| Color of the customer's vehicle |
80
-
|`customerCarType`| Make and model of the customer's vehicle |
81
-
|`customerLicensePlate`| License plate of the customer's vehicle |
82
-
|`customerName`| Customer's name |
83
-
|`pushToken`| The token used for push messages (or sent to the webhook) |
46
+
After an order is claimed, the app may want to call `FlyBuy.orders.fetch()` to update the list of orders. The newly claimed order should now appear in the list of open orders which is available via `FlyBuy.orders.open`.
84
47
85
48
## Updating Orders
86
49
87
-
Orders are always updated with an Order Event. Returns a `LiveData<WorkStatus>` stream for observing status
0 commit comments