Following up on the discussion here, I have successfully set up a fork of the official Discourse app that can send push notifications via the OneSignal API.
There are two parts to this: discourse-onesignal - a Discourse plugin that sends Push Notifications to OneSignal’s REST API
and a Discourse Mobile Single Site App built similarly to the official Discourse Mobile app (using React Native), but using OneSignal for notifications and a simplified interface to suit the needs of a single app.
Instructions for setting this up for your own app:
Open an account with OneSignal (free), create a new app, and generate certificates for iOS and Android
Create the provisioning profiles on the Apple portal. You need a distribution profile for pushing to TestFlight and the App Store, and likely an ad-hoc profile for testing quickly on your device. (Note that you may also need a development certificate for testing the app on your device. Step 2 above creates only the production certificate.)
Create an iCloud container and associate it with your App ID.
Checkout discourse-mobile-single-site-app locally, and follow the instructions described in the repo
Independently, make sure your Discourse instance is running on https. The OneSignal plugin does not support http.
Add the discourse-onesignal plugin to your Discourse instance and configure it: enable notifications, add your OneSignal App ID and the OneSignal REST API key.
You should now be ready to build and test the app in Xcode our using react-native run-ios on the command line. (To test push notifications, you need to set up your app on your phone, either via ad-hoc or through TestFlight.)
(This post was revised on October 9, 2017. It uses a standalone app now, instead of a Discourse Mobile fork.)
Thanks, folks. @mitchellk Apple refuses push from OneSignal? Odd…
For general information: I did run into an issue with the ios app review process, my app submission was refused on the grounds that it sufficient different from a mobile website experience (which is a fair point…). I need to modify the app a little more so that it offers a bit more content right away.
So, some success, but not quite there yet, unfortunately.
Im with @WorldIsMine I’d pay to have this implemented on my site. I have a wrap around app for my android now but no notifications. The biggest complaints I get on my group is no one wants the discourse app to access it due to too much setup and clicks. Everyone is asking for notifications as well.
We are working on a all-in-one solution right now, I will update this thread if we complete the project. I am amazed to see so little is being done in this field. It’s all about mobile these days, this needs to get done.
Thanks. I lost hundreds of members when I switched from vbulletin/tapatalk to here. But i do like the format here better and the members that stayed liked the format better too. I was hoping to find someone to integrate the tapatalk api with this but I dont think its an easy task.
Edit: being on tapatalk increased my members by a huge amount for people that could search and join thru there.
@pmusaraj - Thanks for putting this code out there, one question. We currently host our forum on digital ocean, I’m wondering if we setup this app (either ios or android) would it share the same backend? Meaning, if a user post a comment via the standalone app, it would also show up for users on the web? I understand I can’t just cut and paste the code to make it work this way, but wondering if there is something there to setup this configuration?
The app is a wrapper around your Discourse site. Any action (post, like, bookmark, whatever) is done on the Discourse site. So, yes, that action would show up for all users.
I’m super interested in this - we recently moved from a FB group to discourse, and push notifications are a big request of our users. I’m slightly unclear on execution - is this something I can easily enable for users now, or do we need custom work done?
I’m specifically super interested in just having our community accessible on the App Store like SWAPD, and have cash for anyone who can make that happen.
thanks for doing this. I think I’ll have a go at adapting this for our community. One thing I noticed on the SWAPD app is that left swipe to go back doesn’t seem to work. Is that difficult to resolve?
left swipe to go back is on the wishlist, but I haven’t found a way to do that in React Native. I looked into it at some point, but didn’t figure it out. I may look into it at some point in the near future.
Hey, SWAPD owner here. We currently resolved this by adding subtle back/forward buttons on the mobile version via a simple HTML edit (see bottom of screenshot). While it’s not swipe to go back, it goes give the back/forward functionality in a simple way.
@pmusaraj did everything for me, he was super professional. It’s a challenge for sure to get everything set up, especially getting approved by iTunes. It took @pmusaraj 6-8 weeks of constant denials, phone calls, resubmissions to get in the app store. However, I believe since he laid out the ground work now, things should run smoother.