2

For a final year project I'm creating an app which has to function as a plugin to a learning management system such as moodle. Basically, once an assignment or new notes are being uploaded on the website, it should send push notification to a mobile app.

I have created an equivalent of a moodle website and you may upload files there. It's created in php and is running on XAMPP server while the app is created in jquery mobile with some javascript in it. I'm completely clueless when it comes to coding as I'm enterprise computing student and we were thought only the basics of programming and it's been two years since we had any sort of programming module. It doesn't even make sense why we have to do a prototype..

Anyway, could someone please recommend me the best approach to take to make this work? I've been trying to implement it by using this tutorial https://pusher.com/tutorials/realtime-notifications#/lang=php but it doesn't work. Is there anyone with expertise in this field and could let me know if this tutorial is the correct one or are there any better approaches. Your feedback will be gratefully appreciated. Thank you!

1 Answers1

0

Sending push notifications in PHP isn't difficult at all, but you do need some vital information before you can send a push notification.

1) For iOS, you need to create a application on Apples system, and generate a PEM file from your application certificates, Generate .pem file Used to setup Apple PUSH Notification 2) You'll need an iOS application running on the phone you want to send push notifications to (I believe this is true) 3) When the user logs into the iOS app, you'll need to send the users deviceId to your web server and store it while also associating it with any courses the user is registered against in Moodle. 4) Finally, you use the users deviceId and the PEM file to send a request to Apples push notification server to send a push notification. see http://codular.com/sending-ios-push-notifications-with-php i.e. when a file is uploaded, grab a list of users that are registered on the course, then loop through their device_id's and send a push to each user.

Android is a little easier as you use an API_KEY rather than a certificate. But again you still need the users unique deviceId.

I've build a fair few API's for Mobile Applications, and this is how we do it. The key things are you need a mobile app, certification/api_key and each users deviceId.

Community
  • 1
  • 1
SheppardDigital
  • 3,165
  • 8
  • 44
  • 74