Indigenous for Android is able to receive push notifications.
How does it work?
- Login with IndieAuth on this site to create an account and get an API token. Use the same account you register with in the app.
- Go into settings in Indigenous and click on 'Setup push notifications' to register your device.
- Use the API token to send a push notification manually, or enter the token in a service. When at least one device is registered, you can send a test notification on your account page on this site.
Services integrating with this feature:
- Drupal IndieWeb module: if you use the internal Microsub server, you can enter your API token and when a webmention is received and added to the notification channel, a push notification will be send.
How do I send a push notification?
Send a POST request containing your apiToken and content to the following endpoint: https://indigenous.realize.be/send-notification. Content is (currently) limited to 255 characters.
<?php $post = [ 'content' => 'You have a new notification!', 'apiToken' => 'YOUR_API_TOKEN', ]; $ch = curl_init('https://indigenous.realize.be/send-notification'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); // Send request. $response = curl_exec($ch); // Close the connection, release resources used. curl_close($ch); // Do anything you want with your response. // The response is JSON. If an error occurred, a property 'error' will be available. var_dump($response);
What do I put in content?
That is all up to you, so you can send any message you like. Images will not work, so do not add them in the content.
How do you send push notifications?
We use Pushy.me to register devices and send push notifications. Pushy.me relies on MQTT instead of GCM.
Is there a limit?
You can send up to 20 push notifications per hour. Also, let's be honest, receiving more is simply overkill for your mental health.
Pushy.me allows to send more notifications, but let's keep it reasonable for now.
Is it free?
I've tried sending a notification, but I did not receive anything
We do not store push notifications you send us, but directly send it to Pushy.me. There's no fallback. Usually this works great, but technology can fail right? Also, make sure you allow notifications in the app as well.
Notifications don't arrive after the app is closed
This is due to new default settings in the latest Android versions. Try turning of battery optimization for the Indigenous app and it should work fine.
Does it work for the desktop version?
Currently not, but might be in the future.