quran / quran-ios

QuranEngine is the engine powering the Quran.com iOS app.
Apache License 2.0
462 stars 160 forks source link

Custom URL Scheme Implementation Supporting Sura and Verse Number #659

Closed iman2153 closed 1 day ago

iman2153 commented 2 months ago

Implemented custom url scheme to support launching the Quran Application from outside the application For example, enter this in browser quran-ios:// and it will redirect you to the Quran Application

iman2153 commented 2 months ago

Asalamuwalaikum @mohamede1945 want some thoughts on implementing the full #348 as seen in #657.

I need to implement error handling:

  1. suras above 114
  2. out of range verses based on each sura

Do you want the parameters from 0 to 113 or 1 to 114? I believe the first makes more sense as its the default in the project atm.

Any PRs I can reference for linking to certain views in the App?

mohamede1945 commented 2 months ago

Jazak Allah Khairan for your contribution! I truly appreciate the effort you put into this. I have a few suggestions to help improve the implementation before it can be merged:

  1. The current implementation is a great start, but it's a bit incomplete. While it handles parameter parsing well, it still needs the actual navigation logic to be fully functional.

  2. When you get a chance, please rebase your work on top of the latest main branch to ensure compatibility and allow me to only review updated code in the PR.

  3. To make the code more robust, consider adding unit tests for the business logic (such as parameter parsing). This isn’t required for UI and navigation code, but it helps ensure the core functionality works as expected.

Regarding your questions:

  1. We should use AyahNumber, and it supports returning nil for invalid ayahs.
  2. AyahNumber works with values from 1 to 114.
  3. Additionally, it would be helpful to include navigation to a surah, not just an ayah.

Again, thank you for your contribution! I look forward to seeing your updates. Please let me know if you have any questions or need further guidance.