Development
Android
To help developers integrate their Android applications with Notify My Android, we added the feature on NMA to broadcast an Intent every time a new notification arrives.
That enables both users and developers to do even more with push notifications, like execute actions when notifications arrive, based on its contents, by having 3rd party applications listening for those Intents.
Intents Broadcasted
| Intent Name | com.usk.app.notifymyandroid.NEW_NOTIFICATION |
| Extras | "app" (String): The name of the application that originated the notification "event" (String): The event that is been notified "desc" (String): The notification text/body "prio" (int): The notification priority "url" (String): The attached URL/URI, if any |
Example Code on how to listen/receive these Intent Broadcasts on your app
Listening for Broadcasts with Broadcast Receivers
To create a new Broadcast Receiver, extend the BroadcastReceiver class and override the onReceive event handler as shown in the code below:
public class NewNotificationBroadcastReceiver extends BroadcastReceiver {
public static final String MY_OWN_COOL_ACTIVITY = "com.my.awesome.app.COOLACTIVITY";
@Override
public void onReceive(Context context, Intent intent) {
Uri data = intent.getData();
String title = intent.getStringExtra("title");
String event = intent.getStringExtra("event");
String desc = intent.getStringExtra("desc");
int priority = intent.getIntegerExtra("prio", 0);
String url = intent.getStringExtra("url");
// Run some custom code, if you wish
// Start your own activity to execute some actions and show something for the user
Intent = new Intent(MY_OWN_COOL_ACTIVITY, data);
context.startActivity(startIntent);
}
}
Then you need to add the receiver tag below within the application node specifying the class name of the Broadcast Receiver to register. The receiver node needs to include an intent-filter tag that specifies the action string being listened for, as shown in the XML snippet below:
<receiver android:name=".NewNotificationBroadcastReceiver"> <intent-filter> <action android:name="com.usk.app.notifymyandroid.NEW_NOTIFICATION"/> </intent-filter> </receiver>
Scripts and Libraries
Below is a list of known scripts and libraries that use NMA public API.
Send us an email if you have any script/lib/app that you want us to post a link here.
If you need help developing, post your questions on our forum and we will help you get it done.
Scripts
| Name | Description |
| nma.pl | Perl script to send Notify My Android notifications. |
| nma.sh | Bash script to send Notify My Android notifications. Requires curl. |
Libraries
| Name | Language | Note |
| nma.go | Go | This is a Go client for Notify my Android. |
| NMAClientLib | Java | You can download the last version of the library or the source code from our GitHub repository. |
| NMALib.Net | .Net | This is a port from the original library by Casey Watson. You can download the last version of the library or the source code from our GitHub repository. |
| php-notifyMyAndroid | PHP5-only | PHP5 implementation that does NOT require libcurl. Thanks to snider (Paul Lashbrook). |
| NMAPHP | PHP(4 compatible) | This is a PHP4-compatible version, and it depends on libcurl. |
| NMA-for-C | C (Win/Lin/Mac-compatible) |
This is a port from the original library by J. Dijkstra. Requires OpenSSL. You can download the last version of the library or the source code from our GitHub repository. |
| PyNMA | Python | This is a port from the original library by Damien Degois. It includes a command line tool as an example on how to use the python library. You can download the last version of the library or the source code from our GitHub repository. |
| GrNMA | Groovy | This is a port from the original library by Niels Peter Strandberg. You can download the last version of the library or the source code from our GitHub repository. |
| Ruby-NMA | Ruby | Author: Ken Pepple. You can also install the gem: gem install ruby-notify-my-android . |
| WebService-NMA | Perl | Author: Steve Huff. This is an initial release. Please report any bug or problem through CPAN bug tracker. |
| DelphiNMA | Delphi | Author: Soitjes Soit. Delphi library used by Digital Home Server to access NMA. |

