patrickjane / ut-scooter

App for accessing electric scooters on Ubuntu Touch
MIT License
2 stars 1 forks source link

Support additional providers #3

Open darkdragon-001 opened 3 years ago

darkdragon-001 commented 3 years ago

It would be nice to add support for additional providers. You are stating that the app is designed as multi-provider app. Could you please add a section to the README outlining the process of adding additional providers?

Tracking support for providers:

patrickjane commented 3 years ago

Hi, thanks for the feedback. The multi-provider approach was meant like "once API description is available, I can add more providers easily", and not like "I just added one provider, but if anyone wants to add others, go ahead". As a matter of fact I was unable to find complete API description for any other provider; Bird was the only provider where someone already found out how to unlock scooters. Other providers also do have (unofficially) documented APIs, however, they always lack the endpoint of unlocking/riding scooters.

I have contacted the following providers already: Lime, Bolt, Voi, Tier, Bolt, Bird, some of them up to three times, asking for support for implementing their services. I have not received any feedback yet. At least two providers (Voi, Tier) have APIs meant for third party usage, since they're part of e.g. the FreeNow app, however they most likely require some kind of official partnership. I have asked for this, but as mentioned before, I did not get any feedback. I have never heard of Jawls, and probably would not be able to implement this easily since this provider is not available in my city.

This means, the real challenge right now is to obtain a more or less complete description of the REST APIs used by the other providers. This can be done by reverse engineering, and while I failed with doing that with the Bird app, other people seem to be more talented in reverse engineering and in fact capable of finding out how the APIs work

Once there is a complete API description, I would be able to quickly add it to the app. The main points would be:

1) Subclass Provider and instanciate here: https://github.com/patrickjane/ut-scooter/blob/main/src/scooters.cpp#L74 2) Check where the QML part needs adjustment 3) profit

Since currently there is only one provider, I didn't put any special logic for the no parking areas, but probably at least this will be something which needs more work: It will probably be stupid to display all no-parking areas of all providers at once. Rather I thought about displaying the areas only for the provider of the currently active ride, and otherwise display no areas (or something similar).

What I want to say is, that even though the app code is pretty much ready for additional providers, there will be small adjustments necessary, depending on how the API of the newly added provider works. E.g. if it would pretty much work like the Bird API, then no big adjustments will be necessary. If, however, they follow a completely different pattern in terms of API endpoints, scooter logic and all that, maybe more adjustments will be necessary. This cannot be known beforehand, and must be taken care of when adding new providers.

In the meantime, if you happen to find up to date and complete API descriptions of other providers, let me know, and I will start the work on it.

xdub commented 3 years ago

Hi, While searching for APIs from other providers, I found this: https://github.com/ubahnverleih/WoBike I assume you found it too. But maybe not and it will help. :-)

patrickjane commented 3 years ago

Yeah I know this site already. It does not include scanning/unlocking/riding APIs though.

darkdragon-001 commented 3 years ago

Are you open to add bicycle sharing to the app as well? I found API documentation for Nextbike including rental/return.

patrickjane commented 2 years ago

Looks good, might try it out.

BTW: I have since sent 3 mails (with like 4 weeks in between them) to Bird, Lime, Voi and Tier, with no response beyond auto-responders, which is pretty sad.

If anyone feels like they want to help, maybe you can also send mails to them asking for support for implementing their service, maybe at some point one of the providers will eventually respond and help out.

patrickjane commented 2 years ago

Are you open to add bicycle sharing to the app as well? I found API documentation for Nextbike including rental/return.

Just found: https://open-store.io/app/nutbikes.s60w79

darkdragon-001 commented 2 years ago

Are you open to add bicycle sharing to the app as well? I found API documentation for Nextbike including rental/return.

Just found: https://open-store.io/app/nutbikes.s60w79

Thanks for the hint! Maybe you could merge your efforts? Might avoid duplicate work in the future 😉

S60W79 commented 1 year ago

If you'd prefer, NextUT bikes may be a slim app and I could build in all the advanced features (like map support for nextb.) into the scooter app. The concept 'everything in one app' might then be an advantage compared with android. If anyone is interested, I found a detailed internal documentary for the nextbike api - just PN me via telegramm or twitter. As far as I understand the nextbike's using conditions even allows 3rd party apps without further cooperation. Btw.: The Voi Api seems to be open by now. Tier meanwhile plans to merge the nextbike and tier api, also good news.

patrickjane commented 1 year ago

If you'd prefer, NextUT bikes may be a slim app and I could build in all the advanced features (like map support for nextb.) into the scooter app. The concept 'everything in one app' might then be an advantage compared with android. If anyone is interested, I found a detailed internal documentary for the nextbike api - just PN me via telegramm or twitter. As far as I understand the nextbike's using conditions even allows 3rd party apps without further cooperation. Btw.: The Voi Api seems to be open by now. Tier meanwhile plans to merge the nextbike and tier api, also good news.

Thats indeed great news.

I made the scooter app in a way which should allow to add further providers. However, since there had been only 1, of course this was never tested. Especially displaying all that stuff for several providers on the map might not work that great straight away, or elements might obstruct other elements, e.g. parking zones. So this might need some additional polishing.

However its great news that Voi can be integrated now, and I guess I'm gonna see how this is supposed to work, and go ahead implementing it.

And having Nextbike and Tier in the app as well would be great I guess. But also I think the app would need a renaming then, since it would no longer be a scooter app :)

One thing though @S60W79: It seems like you implemented everything in QML. I did a split between C++ and QML, so the provider specific part would be in C++. I can do this though, if I get hold of an API description.