#Aziz777
1 messages ยท Page 1 of 1 (latest)
Hi
when i try to connect to the terminal
some of them gives me a null location id
i m not sure how i add a terminal or a location id to it
as per the sample code, the location id should come from the scanned list from discovery
as per the sample code
Can you share the doc you are following?
Is your device turned on and connected to your application? Also can you share the exact code that you wrote and is returning null?
So this line is returning null? val locationId = reader.location?.id
Can you share how retrieve the reader object?
reader.location is null if the reader hasn't been registered to a location yet, that's normal enough.
yes thats my problem
if you want to register it to one you can pass it to connectionConfig https://stripe.com/docs/terminal/fleet/locations#register-bluetooth-readers . Which your code tries to do but you assume the reader was already assocaited with a location.
If it hasn't been, you need to have some idea of a default location to use instead(like the commented out tml_xxx you have)
where and how do i register a certain reader
https://stripe.com/docs/terminal/fleet/locations#register-bluetooth-readers
your code already does this basically. If locationId is null then you need to pick a location ID somehow(like hard-code one, have your backend give you a list of location IDs , whatever makes sense for your use case), and pass that to the connectionConfig instead
yep, or in the API
ok thannks
is there any api available and gets me all the locations i have added?
so that user can simply pick a location from the list of locations that is shown
thanks
i will try this one out
and get back if runs into any issue
also, any example for listlocation function?
not that I know of, but it seems straightforward to use
yeah just the params i need
actually there are examples here https://github.com/stripe/stripe-terminal-android/blob/57afedbf/Example/kotlinapp/src/main/java/com/stripe/example/viewmodel/LocationSelectionViewModel.kt#L56 right in the example app for the SDK.
i wil check
i will also need to create a location
can you provide me an example of that as well?
it's all documented at https://stripe.com/docs/terminal/fleet/locations
okk
can we create location in android instead of backend?
it's backend only.
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!