<commit_before>mod_gcm
======
mod_gcm is an ejabberd module to send offline messages as PUSH notifications for Android using Google Cloud Messaging API.

**Compiling**:

Because of the dependencies such as xml.hrl, logger.hrl, etc it's recommended to compile the module with ejabberd itself: put it in the ejabberd/src directory and run the default compiler.

**Configuration**:

To let the module work fine with Google APIs, put the line below in your ejabberd config file. In case of ejabberd 14, the line is:
```yaml
gcm_api_key = "Your Google APIs key"
```
[Here](https://developer.android.com/google/gcm/gs.html) you can create your own API key for Google Cloud Messaging (you need the server key).
Bear in mind that the feature is highly limited for free users.

**Usage (Client to server)**:

As you may know, Google Cloud Messaging **won't work** as you expect without the client part.

You won't find the instructions how to create your own Google Cloud Messaging client here. Although, [this](https://developer.android.com/google/gcm/client.html) example should work fine.

You also need to send this stanza to the server over the XMPP connection, to let the server know your client key:
```xml
<iq to="YourServer" type="set">
  <register xmlns="https://android.googleapis.com/gcm" >
    <key>API_KEY</key>
  </register>
</iq>
```

The key is kept in mnesia database and completely belongs to the JabberID from which it was sent.

**Compatibility**:

The module should work fine in erlang 14+. It *does not require* any special features from the server, although it was tested only on ejabberd 14.12.<commit_msg>Fixed README.md grammar and the YAML config example<commit_after>mod_gcm
======
mod_gcm is an ejabberd module to send offline messages as PUSH notifications for Android using Google Cloud Messaging API.

**Compiling**:

Because of the dependencies such as xml.hrl, logger.hrl, etc it's recommended to compile the module with ejabberd itself: put it in the ejabberd/src directory and run the default compiler.

**Configuration**:

To let the module work fine with Google APIs, put the line below in your ejabberd config file. In case of ejabberd 14, the line is:
```yaml
gcm_api_key: "Your Google APIs key"
```
[Here](https://developer.android.com/google/gcm/gs.html) you can create your own API key for Google Cloud Messaging (you need the server key).
Bear in mind that the feature is highly limited for free users.

**Usage (Client to server)**:

As you may know, Google Cloud Messaging **won't work** as you expect without the client part.

You won't find the instructions how to create your own Google Cloud Messaging client here. Although, [this](https://developer.android.com/google/gcm/client.html) example should work fine.

You also need to send this stanza to the server over the XMPP connection, to let the server know your client key:
```xml
<iq to="YourServer" type="set">
  <register xmlns="https://android.googleapis.com/gcm" >
    <key>API_KEY</key>
  </register>
</iq>
```

The key is kept in mnesia database and completely belongs to the JabberID which it was sent from.

**Compatibility**:

The module should work fine in erlang 14+. It *does not require* any special features from the server, although it was tested only on ejabberd 14.12.
{'fraction_non_alphanumeric': 0.08564462054251752, 'fraction_numerical': 0.0048765620237732395, 'mean_word_length': 4.562711864406779, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6899375', 'n_tokens_mistral': 965, 'n_tokens_neox': 914, 'n_words': 464}