I have been hacking away at a simple notifier app for iOS.
What about Android?Once I get this out I would like to also port the native parts to Android, it should not take too long there are only a few minor tweaks needed. (in particular a native RSA pub/private key library and some internal reorg). The app is built in react native which has been quite fun. It is mostly cross platform with the exception of some minor native components. The Android beta is now live over here!
I created it mainly to help resolve a few personal pains I have had.
I track lots of Discourse sites, I forget to visit quite a few
My email box is out of control, push notification are far less obtrusive to me cause I don’t need to delete them, they simply go away when the app badge hits 0 (which is by design for all iOS apps).
I am mobile … all the time … especially this year.
I like having all my sites together in one app, I like the iOS badges that show how many notifications I have unread across sites.
The app keeps track of flags, unread counts and alerts across multiple sites. It also allows you to quickly browse any site using Safari View Controller (which is the exact same Safari you use anyway)
It takes advantage of the user API, this ensures that the app behaves, if it misbehaves it will be throttled by Discourse.
I have reached far enough into my dev process to warrant some beta testing. So here are some notes:
I did the majority of my dev on iPhone, on iPad there is tons of white space, but it does work.
Apple Background Fetch is an odd beast, in theory it should regularly fetch from our sites, in practice it is very finicky. I have a workaround I will get going next week, but in the meantime if you wake up in the morning and the badge is not updated, it is cause background fetch is … weird… I left a “dev panel” at the bottom of the app so you can quickly tell what has been going on. see also: this 500 point bounty I have going.
You can not reorder sites yet, that is on the list and should be implemented soon
Sites we do not host do not get “push notifications” we have to whitelist every site for push notifications and give them a magic URL to push to. They get “fake” push notifications on background fetch, but no real ones.
App was designed for minimum networking. When looking at the site list every 15 seconds the app hits message_bus, when looking at a site it hits every minute. This route is super duper cheap and designed for huge amounts of hits. All updates for the app after it loads are handled via the bus.
App is at the moment undergoing approval for beta and should be ready soon.
If you would like to help beta test reply here and I will invite you.
Really great job developing this, the notifications work great from my first impressions, there’s just one thing I found so far to be problematic:
I had some trouble adding a second forum (this one) but got it to work after a few tries. You would add it like you normally would:
Type in the URL
Press connect
Enter your log in credentials and press authorize
After that you would have to hit authorize a second time and it would go back to the home screen, and it would still say connect on the side next to the website. Click connect again and it would crash.
I’m not sure how I got it to work in the end but will continue to play around with it.
iPhone 6s Plus
iOS 10 beta
Build 1.0 (2)
Edit: This will happen 100% if you hit authorize a second time before it goes through and connects you to the site.
Note, I think it is worth noting the reason for this, cause I think it is rather interesting.
Our “connect” protocol is secure. The client provides the server with both a NONCE (hash that expires after single use) and a public key to encrypt all content. When the server hands back the the readonly token back to the client it encrypts it, the client checks the NONCE to prevent replay attacks.
All this fancy shmancy means that you if you install a second app on your phone that “steals” the discourse:// schema from the discourse app (which is easily doable) it will not get any useful information back from the servers.
Loving the app so far, the functionality is superb. As we’re mostly mobile users, having push notifications is a great asset for us.
A very minor thing came up while I testing this out yesterday, when you enter an invalid Discourse site (like hello), it wouldn’t alert you with an error message and stop the loading process. In fact, it would just keep on loading and never stop. Not sure if this affects performance or usage at all, but worth pointing out.
Has notifications for flags been considered? I am aware that in the app you can see the flag count, but this doesn’t really help practically. Perhaps have a setting in the app that allows you to enable and disable flag notifications?
That leads me into my next point, the push notifications aren’t up to its full potential unless it states the site name and what type of notification (I’m thinking PM, reply, tag, etc). I don’t think this would be too difficult to build, as the email notifications already have this.
@sam before we set too many expectations around “everything is free”, did you want to elaborate on whether the hosted customers will need to be enterprise, or purchase an add-on plan to get push notifications?
I think you should open a separate topic on this cause it is not specific to the app.
I think you are asking for a user setting for “alert me when posts are flagged” which applies for staff. That way it is covered with both desktop and mobile notifications. I think it is a reasonable setting, default on for moderators, default off for admins.
Push notifications are pushed to mobile when a “notification alert” happens. This is an internal concept to Discourse that is used for mobile and desktop (chrome + firefox) notifications.
So, in effect, desktop alerts === mobile alerts === notification alerts.
I have been quite spartan with the amount of information I am allowing into the notifications. There are some changes in the pipeline I would be happy to add:
If the post is post #1 then lead with the title and category.
If it is a PM prepend [PM] to the push notification
Regarding site name it is actually the title of the notification, iOS is a bit odd with the rendering. If you drag the notifications down you will see the title there.
I also will revisit some of this when iOS 10 is out cause there are some very interesting things we can support once it is released.
Regarding cost, I am just going to clarify here that “push notifications” is at the moment an “exclusive” feature for all our customers in all hosting tiers.
Per our discussion, once we get the Android version of the notifier done we can add it as a bullet point to our “buy” page which combined with ingoing and outgoing mail support and spam handling and excellent performance are making our hosting plans extremely compelling.
I replied here about what externally hosted Discourse communities can do.
The authorization flow is currently broken with SSO: After clicking Connect, you get the SSO login prompt (assuming you weren’t logged in already), but after the external application redirects you back, you just end up on the main Discourse page.