Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace AlamoFire #783

Open
digitaldan opened this issue Jul 6, 2024 · 6 comments
Open

Replace AlamoFire #783

digitaldan opened this issue Jul 6, 2024 · 6 comments

Comments

@digitaldan
Copy link
Contributor

Hey @weakfl and @timbms , this is probably not a small task, but i am finding that AlamoFire is causing issues in the app, specifically they do not support making http calls while the app is in the background (its a long requested feature). This is causing issues for our new push notifications when we try and send commands to items. I may resort to creating an alternative just for background tasks and use the built in networking with support for credentials, certs, etc.... If that works, maybe we move forward with overhauling the rest of the app to use it. Also i have noticed that AlamoFire does not seem very active as a project, seems like a relic of the past perhaps.

digitaldan added a commit to digitaldan/openhab.ios that referenced this issue Jul 6, 2024
digitaldan added a commit to digitaldan/openhab.ios that referenced this issue Jul 7, 2024
digitaldan added a commit that referenced this issue Jul 7, 2024
* Uses new HTTPClient for background fetch jobs
See #783
Signed-off-by: Dan Cunningham <[email protected]>

* Use new HTTPClient class for downloading all data in notifications

Signed-off-by: Dan Cunningham <[email protected]>

* move download media to new client

Signed-off-by: Dan Cunningham <[email protected]>

---------

Signed-off-by: Dan Cunningham <[email protected]>
@weakfl
Copy link
Contributor

weakfl commented Jul 8, 2024

I think URLSession has matured enough over the years. Makes sense to get rid of Alamofire imho.

@timbms
Copy link
Contributor

timbms commented Jul 24, 2024

Are you still pushing to get rid of Alamofire ?

@digitaldan
Copy link
Contributor Author

Yeah, i think so. My little basic http client that i'm using for the notification calls i think is a good prototype that proves you don't really need a 3rd party library.

@weakfl
Copy link
Contributor

weakfl commented Jul 25, 2024

@digitaldan just make sure to use the async functions instead of closures (imho).

@digitaldan
Copy link
Contributor Author

My plan right now is to swap out the alamo bits with URLSession and friends in the NetworkManager class, and keep the calling code mostly unmodified. I think that will be actually pretty easy, i can then remove my little httpclient prototype. Once thats all working, i think a bigger refactor of the networking will be a nice to have.

@timbms
Copy link
Contributor

timbms commented Aug 1, 2024

@digitaldan just make sure to use the async functions instead of closures (imho).

I made a first step in the direction of using async version. Not yet for the main networking call but for the delegates URLSessionDelegate and URLSessionTaskDelegate. See #798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants