Presenting Views for Users
Note For Customers Launching VenueNext Flows in Activities
- If you are launching a VenueNext flow in an
Activity
and you are overriding theonActivityResult
function, please ensure to callsuper.onActivityResult
as well. VenueNext does require some data to be passed viaActivity
result and without this call, some parts of the SDK may fail to function properly. See the example below:override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) // Your handling here }
- If you are launching a VenueNext flow in an
Activity
and need to perform actions inonBackPressed
, instead of overridingonBackPressed
in your hostingActivity
, do the following:- Create a function that contains your actions. In this function, please also add the following code to handle proper back navigation for the VenueNext SDK:
// Your Handling Here val navHostFragment = supportFragmentManager.findFragmentById(R.id.fragment_main)!! val count = navHostFragment.childFragmentManager.backStackEntryCount if (count == 0) { finish() } else { navController.popBackStack() }
- In your
onCreate
function, addonBackPressedDispatcher.addCallback(this) { <yourBackPressedFunctionHere> }
. - This will allow the VenueNext SDK to properly navigate backwards in the view stack when a hardware back press occurs instead of closing the hosting
Activity
on every back press.
- Create a function that contains your actions. In this function, please also add the following code to handle proper back navigation for the VenueNext SDK:
Launching into VenueNext Flows
Revenue Center Flow
This is a starting point for ordering food/beverages and experiences and is the suggested flow to launch into when showing VenueNext content. You can simply use a top level action to navigate to the desired product type’s flow.
// Food & Beverage Flow
Navigation.findNavController(view).navigate(R.id.action_to_food_bev_flow)
// Experiences Flow
Navigation.findNavController(view).navigate(R.id.action_to_experience_flow)
// Merchandise Flow
Navigation.findNavController(view).navigate(R.id.action_to_merchandise_flow)
Wallet Flow
This is a starting point for showing wallet virtual currency balance, QR code, and virtual currency transfer
Navigation.findNavController(view).navigate(R.id.action_to_wallet_flow)
My Orders Flow
This is a starting point for showing a user’s previously placed orders
Navigation.findNavController(view).navigate(R.id.action_to_my_orders_flow)
Displaying More Granular Content
Show Specific Food and Beverage/Merchandise Menu: Show an individual menu
val bundle = bundleOf("toMenuId" to "yourMenuUUIDHere")
Navigation.findNavController(view).navigate(R.id.action_start_to_stand_menu, bundle)
Show Specific Experience Menu: Show an individual menu
val bundle = bundleOf("toMenuId" to "yourMenuUUIDHere")
Navigation.findNavController(view).navigate(R.id.action_start_to_experience_menu, bundle)
Show Specific Experience Item’s Detail View: Show an individual experience
val bundle = bundleOf(
"menu_id" to "yourExperienceMenuUUIDHere",
"event_id" to "yourEventUUIDHere",
"item_id" to "yourItemUUIDHere"
)
Navigation.findNavController(view).navigate(R.id.action_start_to_experience_detail, bundle)
Direct Launch to an Experience Receipt
VNOrderUI.showPurchasedExperienceReceipt(<yourNavControllerHere>, <yourOrderUUIDHere>)
Direct Launch to an Awarded or Transferred Experience’s Redemption UI
VNOrderUI.showAwardedOrTransferredExperience(<yourNavControllerHere>, <yourUserItemUUIDHere>)
Setting the Action Bar Title Text
You can set the Action Bar Title in the Revenue Centers view and in the Wallet view. Your title will always be capitalized regardless of how it’s set below.
Revenue Centers
See section SDK setup step 3b for configuring titles in XML
Note: If you choose not to set the Action Bar Title, the title will default to the following:
- Revenue Centers (title changes based on the
ProductType
being filtered):- All Menus (no filtering on
ProductType
) - “MENUS” - Food - “FOOD & BEVERAGE”
- Experience - “MARKETPLACE”
- Merchandise - “MERCHANDISE”
- All Menus (no filtering on
Wallet
Update the VNWalletUI::configure
function by adding a new parameter at the end:
VNWalletUI.configure(isVirtualCurrencyToggleVisible = true, qrConfig = QrConfig.VC_AND_SCANNER, actionBarTitle = "YOUR TITLE HERE")
Note: If you choose not to set the Action Bar Title, the title will default to the virtualCurrencyName
set in your implementation of WalletInterface