gyim / breviar-ios

Liturgy of the Hours for iOS
5 stars 1 forks source link

Enable Bible references to external Bible app #47

Open breviar-sk opened 7 years ago

breviar-sk commented 7 years ago

Web+Android solution for SK Breviary has option to switch on biblical references to be "live" (open directly Biblical translation):

For HU verzion, on web solution points to http://szentiras.hu/SZIT.

Live URLs are based on HTML sources (simple usage: {r}reference{/r} with few sophisticated features; details are not important for this issue). They open another web (Web solution) or external app (Android solution, currently for SK version only).

(CZ version has already support for live URLs but not yet decided what to use because there is nothing as 'full catholic transation'.)

Web examples: SK: https://lh.kbs.sk/cgi-bin/l.cgi?qt=pdt&d=22&m=9&r=2017&o0=647&o1=5376&o2=21240&o3=0&o4=0&o5=0&o6=0&p=mrch#SLAVAOTCU (see URL from "Žalm 51" -> https://dkc.kbs.sk/?in=%C5%BD51)

HU: https://lh.kbs.sk/cgi-bin/l.cgi?qt=pdt&d=22&m=9&r=2017&j=hu&o0=647&o1=5376&o2=29432&o3=0&o4=0&o5=0&o6=0&p=mrch#SLAVAOTCU (see URL from kantikum Tób 13 -> http://szentiras.hu/SZIT/T%C3%B3b%2013,%2010-15.%2017-19)

In CGI module, we can add also live URLs for iOS version.

Questions for analysis:

kominak commented 7 years ago

I really like this feature suggestion and I'd love to implement it. It resonates more with me than adding dark color theme to the app :-D

YouVersion supports a special URL scheme youversion://. If our app tries to open such a URL and there is YouVersion installed on the device, it will open the app with the proper book/verse opened.

The question is how to handle the case when YouVersion is not installed. There are several options.

  1. our app will provide one more CGI parameter, e.g. ...&youVersionInstalled=1, and the CGI module will generate proper links; without this parameter, the module will generate links to national Bible websites (dkc.kbs.sk, ...).
  2. the app will keep generating links to national Bible websites; our app will intercept these URLs, and if YouVersion is installed, it will transform these URLs to youversion:// links.

You can guess which one do I prefer ;)

breviar-sk commented 7 years ago

So for now CGI module has to correctly generate OSIS book names & handle new parameter (youVersionInstalled). Most probably this parameter will be another bit-component of current options parameters.

Note: 'youVersionInstalled' bit component is useful both for iOS and Android.

kominak commented 7 years ago

Yep, exactly. That seems like the simplest options. But first, let me try if this actually works - I'll try opening YouVersion from some temporary test link... but I think it will work without any issues.

On 22 Sep 2017, at 10:33, Juraj Vidéky notifications@github.com wrote:

So for now CGI module has to correctly generate OSIS book names & handle new parameter (youVersionInstalled). Most probably this parameter will be another bit-component of current options parameters.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gyim/breviar-ios/issues/47#issuecomment-331386086, or mute the thread https://github.com/notifications/unsubscribe-auth/AFXcTWDYEywQucYrLjLBn-UCRhO3zm1nks5sk3C-gaJpZM4PgTJT.

kominak commented 7 years ago

I've just tried opening youversion://bible?reference=JHN.3.16 and indeed it opened the correct verse in the last used translation (in my case it's slovak catholic SSV translation).

So in iOS we have to:

I have to check how this stuff was supposed to work: event://linkTouchStart

gyim commented 7 years ago

I also think that this would be a great addition, thanks for all the work on this!

I would like to see a YouVersion support as well, but unfortunately there are no Catholic translations in it for Hungarian. However, a few weeks ago I talked with the director of Szent István Társulat (the "official publisher" of the Catholic Church in Hungary), and he seemed to be open to sharing their translation with third-party apps. I will look further into this, because it would be a really great addition to both apps :)

Until then, linking to szentiras.hu is a good solution. They also have an API, so we can even have a customized UI (example: http://szentiras.hu/api/idezet/1Kor13,10-13)

gyim commented 7 years ago

I contacted YouVersion, and unfortunately they are overwhelmed with requests like this. They will contact me when they will have time for adding Catholic versions for Hungarian. Until then we should really go with szentiras.hu.