Push Notifications at custom moodle mobile

Push Notifications at custom moodle mobile

by Sergio Comerón -
Number of replies: 10
Picture of Core developers Picture of Plugin developers

Hi!

I make a custom moodle mobile app and I want implement the push notifications. 

I followed these steps:

- Install Airnotifier
- I create GCM and I have the number project and API key (server key)
- I create airnotifier application and at settings I put the GCM project number and API key.
- At config.json I insert  "gcmpn": "numberProjectGCM"

but it does not work sad
never see registry devices at messaging preferences at moodle, never registry token at airnotifier and of course not send push notifications.

What is the problem?
Can anybody help me?


Thanks!
(Sorry, my english is very bad)

Average of ratings: -
In reply to Sergio Comerón

Re: Push Notifications at custom moodle mobile

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

the numberProjectGCM is also required in the config.xml file

If you are building using PhonegapBuild you must place the number for the Phonegap config.xml file.

You must also be sure that Mobile notifications are enabled in Moodle, Go to Plugins -> Message outputs and check that is enabled and configured.

Regards, Juan

Average of ratings: Useful (1)
In reply to Juan Leyva

Re: Push Notifications at custom moodle mobile

by Sergio Comerón -
Picture of Core developers Picture of Plugin developers

Thanks Juan,

now I've got the device register to the mdl_user_devices but no more. 
The airnotifier installation it's ok because I can register tokens manually. When I open the custom app would have to automatically register the token at airnotifier?
Why don't register?

In reply to Sergio Comerón

Re: Push Notifications at custom moodle mobile

by Sergio Comerón -
Picture of Core developers Picture of Plugin developers

ok, 

I send push notifications to device with an script with airnotifier server (with file notification.sh airnotifier test files), then airnotifier run ok
GCM send push notifications send push with an php file, then GCM run ok 

but moodle not send push notifications sad

In reply to Sergio Comerón

Re: Push Notifications at custom moodle mobile

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

are the devices registered in airnotifier? Check the tokens tab

Juan

In reply to Juan Leyva

Re: Push Notifications at custom moodle mobile

by Sergio Comerón -
Picture of Core developers Picture of Plugin developers

Hi Juan, thanks.

no, devices not registered in airnotifier. I registered manually the devices in airnotifier for test airnotifier.

In reply to Sergio Comerón

Re: Push Notifications at custom moodle mobile

by mohammed yousef -

now have the same problem about register device using my custom app and do all steps above but still cant see devices registered when i am using the custom app but if i used the moodle app the device registered

In reply to mohammed yousef

Re: Push Notifications at custom moodle mobile

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

I'm sorry but we can't offer support for the Airnotifier server. We provide a service where we can customise the app for anyone who needs it.  This service helps fund the improvement of the app in general.  Our core team do not have the resources here to help people use the open source code version. https://moodle.com/mobileapp/

Regards, Juan

In reply to Juan Leyva

Re: Push Notifications at custom moodle mobile

by Lucio Monter -

Hello Juan,

First of all thanks for all the great jobs you guys are doing and keeping it as Open Source. It's just amazing and give small company like us the possibility to survive in the business jungle.

Then we need a little hint if it's possible.

We manage to customize the mobile app and set up an Air Notifier server for Push Notification,

We are experimenting some broadcasting directly from air notifier and notifications go fine both as plain text and json payload. 

But we don't figured out how the push notification, handled by the app, would recognize where to go inside the app itself.

For example, if we send an instant message, the tap on the notification will lead the user directly to the message part of the app, showing the received message.

We see in the payload content of the notifications there are parameters such as "type" or "urlparams" but we are not able to find where in the app those variables are handled...

Thanks in advance for your support

Regards

Lucio Monterubbiano


In reply to Lucio Monter

Re: Push Notifications at custom moodle mobile

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

look for this line of code:

$mmPushNotificationsDelegate.registerHandler(

There is a special handler for treating push notifications and redirecting the user interface

Juan

Average of ratings: Useful (1)