ElkArte Community

Elk Development => Feature Discussion => Topic started by: cjazz on November 23, 2019, 01:42:28 pm

Title: Tapatalk alternative for Elkarte boards?
Post by: cjazz on November 23, 2019, 01:42:28 pm
I am planning to transfer to the Elkarte board in the near future. I am currently using a SMF board with the "Tapatalk" plugin. The Tapatalk option will be missed by many of the current forum users.
Any suggestions for an alternative mod/plugin for users to access Elkarte boards through mobile phones etc?
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on November 23, 2019, 03:29:52 pm
I am planning to transfer to the Elkarte board in the near future. I am currently using a SMF board with the "Tapatalk" plugin. The Tapatalk option will be missed by many of the current forum users.
Any suggestions for an alternative mod/plugin for users to access Elkarte boards through mobile phones etc?
 
 
Elkarte is mobile friendly out of the box. You may choose to step away from tapatalk accordingly. One thing you may miss are the notifications. 
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: emanuele on December 08, 2019, 08:34:37 am
Adding the home page to your home (or whatever is called in the English version of android/chrome you should see the badge counter for the notifications. Not sure how frequently it updates, though.
There are also "desktop notifications", but to be honest I don't know how are triggered in mobile. I guess you have to keep the forum open in a browser tab.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on December 08, 2019, 09:00:46 am
Adding the home page to your home (or whatever is called in the English version of android/chrome you should see the badge counter for the notifications. Not sure how frequently it updates, though.
There are also "desktop notifications", but to be honest I don't know how are triggered in mobile. I guess you have to keep the forum open in a browser tab.
 
 

The notification tab shows notifications, but push notifications don't work on Android out of the box even if the tab is open.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: radu81 on December 08, 2019, 09:01:32 pm
I guess you have to keep the forum open in a browser tab.
 I was going to open a new topic about this, I am wondering if this behavior is normal, Xf and other forums are sending notifications even if you don't have the forum open.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: emanuele on December 08, 2019, 10:30:31 pm
I guess they are using the more recent version of the notifications thingy, the one I have never fully understood how to make it work...
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 09, 2019, 03:45:45 pm
Not sure about the android issue .... could simply be an issue with the notification library that we are using.

I checked and what we have is the latest version of that library, but  it has not been updated in some time, no new releases or commits so yeah .... might have to look for something else.

I think the issue with not getting updates with the tab closed is that the library we use still had a "todo" to add service workers.  It is the service workers that run independent of a given browser tab/window and allows it to notify with a push notification (as long as some window is open), at least that is my basic understanding.


Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on December 09, 2019, 04:04:52 pm
Not sure about the android issue .... could simply be an issue with the notification library that we are using.

I checked and what we have is the latest version of that library, but  it has not been updated in some time, no new releases or commits so yeah .... might have to look for something else.

I think the issue with not getting updates with the tab closed is that the library we use still had a "todo" to add service workers.  It is the service workers that run independent of a given browser tab/window and allows it to notify with a push notification (as long as some window is open), at least that is my basic understanding.
 
 It would be a great feature to have. In fact I might say it's critical. Push notifications are but one reason FB killed forums. 
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 12, 2019, 11:09:19 pm
I've been looking into this, well mostly reading about it really since I'm not familiar with this stuff.

I did update the library we use to a newer version (actually another project which picked up development) on my test site and it seems to be working as expected on my desktop and on my android phone.  As expected (?) is that you will get a notification only when:

1) your browser is open
2) you are logged in to the site
3) you can be on any tab in the browser or running another app on android / desktop as long as the browser is active somewhere
4) you have allowed the site to provide notifications
5) you have allowed the "app" aka browser in this case, to display notifications.

Notifications do not currently appear if the browser is closed or you are not logged in.  I've tried a few web examples of allowing notifications when the browser is closed, and so far none of the demos actually work LOL, but I think that's just because the demos are older and the Notification api was not quite done.

It seems to get "browser closed" notifications takes a bit more work, you need the browsers endpoint url and use some private / public keys and some other stuff and the like.  I've read two ways this could be done, one is using a web-push library that sends the notifications to the registered endpoint(s) which I *think* can run on the current server.  Another is possibly make use of Googles Firebase Cloud Messaging service.  There may be other ways as well.   I'm not aware of how XF does this or other fora packages.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 13, 2019, 12:58:47 am
As I sit here, beer in hand, I'm thinking is it even a good idea to get notifications on a closed browser?   I'm thinking of the shared computer, if you are not logged in, should messages be pushed?  Seems like a security problem, at least for desktop as multiple users could potentially use the same computer.  So that would have to be limited to mobile I would think .. to ponder.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on December 13, 2019, 01:28:13 am
As I sit here, beer in hand
 
 

That's a fine start! ;D

Perhaps it's personal taste but I'd prefer mobile notifications, for a couple of reasons. One is I like the convenience myself. 

More importantly about 76% of my sites traffic is mobile platform based. Push notifications would assuredly boost participation. The devil's advocate would say "what about email notifications"? They're old school and annoying. Worse is for us forum admins, operating on a subprofessional level as well as a shoestring budget, email systems are at best unreliable. Forum based email gets rejected by.....nearly every large provider after a certain level. Some don't accept the first if every duck isn't in a perfect row regarding configuration. Oh, speaking of professional, push notifications would make every site seem polished!

Not meaning to sound like a vent. It's simply a pretty please plea. ;D You guys truly do a great job!
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 13, 2019, 03:12:14 am
Thanks, that is really good data on your sites mobile %

I'm thinking the mobile stuff is safe since its not like you are giving out your phone for other to use.   I'll continue to read up on how all of this works and try and figure out how to proceed.   I'll also note that the iOS/Safari stuff is its own little hell hole so I'm not even looking at that at this point.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on December 13, 2019, 03:32:34 am
 I'll also note that the iOS/Safari stuff is its own little hell hole so I'm not even looking at that at this point.
 
 That isn't surprising somehow. All the same, you still da man spuds!
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: radu81 on December 13, 2019, 03:54:43 pm
I need to do more tests, I prefer using the browser instead of dedicated apps, so I use a lot the browser on my phone. It's always opened, but I need to double check if notification are coming because the XF forum is opened in another tab.

Need to test better also the desktop notifications, I guess they are arriving only if the browser is opened.

As for Safari/ and iOS devices I'm sure XF does not offer any kind of support, because it's not possible. XF team suggests to write to Tim Cock to unblock this feature :)
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 14, 2019, 12:17:08 am
The current implementation is not as much of a Push, as it is a Pull.

It sends an ajax request to the site and then takes the response and uses the browsers Notification API to display the information.  A true Push would have the site send the notification to the browsers endpoint to have it displayed by the same Notification API.

To send a true Push of information requires a bit more work, well quite a bit more, since it needs a set of private/public keys as well as the various endpoints.  A user needs to enable the notification for each specific browser they use, its not a user profile option per sey since each endpoint is unique to that browser.  Apple does not provide those endpoints (other then if you run Chrome/FX on a Mac).  Those push notifications are also encrypted so thats some extra work as well.  The benefit of the Push is that even if the site is not open, and in some cases the browser is not even required to be open, you get the message.   There are bunch of exceptions to all that but thats how its supposed to sorta work.

For our current ajax version to work requires the site be open in a tab and that you are logged in .. such that the browser is making the ajax requests.  @emanuele did the implementation so he can comment about that if I'm way off in the weeds.

I'm looking into a true Push but its a bit of a needy process, both for php libraries and server requirements.

Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 15, 2019, 03:10:15 am
I'm continuing to play a bit with this and I actually now have basic web push working ... I know that is not very exciting but to get it to work seemed like a lot of effort, or at least a lot of library dependencies.  Lets see, phpasn1, guzzle, webpush, sodium, http-message, getallheaders, base64url, and web-token with a variety of signature algos.   I've culled this to 340 files in 67 directories LOL.   All made a bit more difficult on 1.1 as our autoloader is not really PSR compliant like it is on 2.0, meaning I've probably missed a few namespaces etc.

You need php7.1+ with the following extensions mbsrting, curl, openssl, and gmp.  I had not heard of gmp before but you need it to have this all work.   Probably not an issue if you are have your own VPN but probably an issue for a shared hosting setup.  Like i said, to get it to work requires a few libs/dependencies to be installed (all tucked away under ElkArte's sources/ext directory)

The test is just a simple webpage with a button, press the button and you get a notification, not yet tied in with Elk other than it is running under ElkArte as a webpage.  To actually make it useful is a bunch more work and actual integration.

Next I think I may look at Firebase Cloud Messaging, a google API solution which should be easier to setup, well maybe, I guess I'll see. 
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: radu81 on December 15, 2019, 11:41:10 am
I checked how xf does handle push notifications, you need php 7.1 or superior and GMP extension. The forum does not need to be opened in browser, nor the browser needs to be opened. If could be useful here (https://xenforo.com/community/threads/push-notifications.154592/) is explained how it works.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 15, 2019, 03:00:14 pm
Thanks, I'll give that a read.  I'm sure that since they have the same GMP requirement, and issues with Apple, its the setup I now have working.  
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Allan on December 15, 2019, 03:45:44 pm
All this on a simple question about Tapatalk  ;)
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 15, 2019, 04:09:20 pm
Questions are always simple, its the answers that are hard :D
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: radu81 on December 15, 2019, 05:35:06 pm

All this on a simple question about Tapatalk  ;)
 I think I'll ask something about a gallery... lol
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Allan on December 15, 2019, 05:58:01 pm

All this on a simple question about Tapatalk  ;)
  I think I'll ask something about a gallery... lol

 there you go, that works. 
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on December 15, 2019, 07:23:54 pm
Questions are always simple, its the answers that are hard :D
 
 Fact!!!
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: radu81 on December 17, 2019, 12:53:25 am
@Spuds‍ how do you plan to release this? As add-on for 1.1 and core for 2.0? Or both core?
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 17, 2019, 01:57:55 am
That's a really great question.

Looking at whats involved (which is still a large work in progress) and where things need to be changed, I'm not really seeing this as a 1.1 addon as it would require lots of source edits to make the changes.  For 2.0 I would think it would be part of the core, simply updating the polling notifications to true push notifications.   It could be done in 1.1.7 but I don't think that level of feature change is appropriate for a  dot x release.

I've was able to play a bit with the google firebased api today, and I *think* that could be done as a 1.1 addon, but first I actually have to get it working :P  This could possibly be done in 1.1.7 as its should be less problematic/invasive, but since it requires 3rd party signup I'm not sure that is really core appropriate.

So thats why its a great question.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on December 23, 2019, 12:18:04 am
I should probably break the push notifications thing out to its own thread.

Anyway just a quick update, I played around with the google firebase service and decided it was a generally a PITA.

 I did get it working on chrome but Fx seemed to have some issues.  The documentation just stinks, half of it is for the old version, 1/2 for the new so figuring out what to do was needlessly difficult.  Plus its google so either the service would become successful and they would start charging for it or it would not take off and they would drop it.

For 1.1.7 I made a PR that should address some issues, it updates to a newer version of the notification script, adds a service worker which in my testing worked well with android / chrome, tried to make the ajax polling more persistent, plus a couple of other minor things.

For 2.0 we can consider doing the change over to full "push" like xenforo has and I do have that working but have not spent any time integrating that into the core, hoping that the 1.1.7 updates get us close enough to what is needed.

So thats kind of it for now or at least until 1.1.7 gets finalized.
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: badmonkey on January 27, 2020, 12:54:52 am
@Spuds‍ would it be at all easier if elk were operating as a progressive web app, i.e. a service worker already existing? 
Title: Re: Tapatalk alternative for Elkarte boards?
Post by: Spuds on January 28, 2020, 03:53:06 am
I had to read up on just what google was defining as a progressive web app :D

From what I could work through I do think that is an approach that can work for the notifications, it seems like that instead of using the browser as the "app" you define your own container/app to receive the notifications.  It seems like the push action is still the same, you need all of the same resources to do the push but the service worker is in this "app" and not the browser.  Seems like the app would just be a feature limited browser view unless I'm missing something.  Anyway interesting reading for sue.