Sample Application demonstrating the following features using the FlyBuy SDK
- Order redemption via url or code
- FlyBuy customer management
- Location permissions request
- Customer journey updates via LiveData streams
- Push notifications via Firebase
- Customer rating on pickup experience
This example uses the Example Apps
project in the FlyBuy Merchant portal, which uses the white label domain demo-flybuy.radiusnetworks.com
to send redemption links.
To use this repo, you must enter your FlyBuy token on line 17 of ExampleApplication.kt
. Contact your project manager if you do not have a token.
Firebase push notifications
This example uses Google's Firebase push notifications. You need to provide a google-services.json
file containing the API key, etc. in the app/
folder.
- Initialize the FlyBuy SDK
- Check for existing open orders
- When open orders exist, pick the first one and jump to the GuestJourney activity
- Check for an intent indicating the app was opened via a URL.
- Get the redemption code and go to the OnMyWay activity
- Wait for user to enter a redemption code
On Redemption Code lookup
- Check for current FlyBuy customer, create one if does not exist
- Show terms and conditions before creating customer
- Fetch order details
- Display current customer info (phone / vehicle) to allow updating
- Wait for user to press
On My Way
On My Way
- Update customer information if changed
- Check for Location permissions and request if necessary.
- Go to GuestJourney activity
Guest Journey
- Set up LiveData observers to receive updates for active order
- OrderState changes to
cancelled
orgone
go to MainActivity - order.open() returns
false
go to OrderComplete activity - CustomerState changes to
arrived
, update the progress bar and display pickup instructions - CustomerState changes to
waiting
update the progress bar and showI'm done
button - CustomerState changes to
en_route
,nearby
, update progress bar and ETA
- OrderState changes to
- Claim active order if not already claimed
- On click
I'm here
, set the CustomerState towaiting
- On click
I'm done
, set the CustomerState tocompleted
Order Complete
- Allow user to rate pickup experience
- Return to MainActivity