https://github.com/3sidedcube/android-lightningmessage
The lib is deprecated and not any more supported!
https://github.com/3sidedcube/android-lightningmessage
Last synced: 8 months ago
JSON representation
The lib is deprecated and not any more supported!
- Host: GitHub
- URL: https://github.com/3sidedcube/android-lightningmessage
- Owner: 3sidedcube
- License: apache-2.0
- Created: 2014-11-03T15:23:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-10-15T12:11:01.000Z (over 7 years ago)
- Last Synced: 2025-01-30T01:22:42.412Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 1.2 MB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
#Storm Library - Module Message
Storm is a collection of libraries that helps make mobile and desktop applications easy to create using a high quality WYSIACATWYG editor.
This module's purpose is to handle Google Cloud Messages sent via the Storm CMS.
#Usage
##Gradle
Simply include the following for your gradle dependencies `com.3sidedcube.storm:message:0.1a`.
**Note** The versioning of the library will always be as follows:
`Major version.Minor version.Bug fix`
It is safe to use `+` in part of of the `Bug fix` version, but do not trust it 100%. Always use a *specific* version to prevent regression errors.
##Code
In your application singleton, add the following code
```java
MessageSettings messageSettings = new MessageSettings.Builder(this)
.projectNumber("xxxxxxxxxxx")
.registerListener(new RegisterListener()
{
@Override public void onDeviceRegistered(@NonNull Context context, @Nullable String token)
{
if (!TextUtils.isEmpty(token))
{
AsyncHttpClient client = new AsyncHttpClient(contentSettings.getContentBaseUrl());
try
{
String appId = contentSettings.getAppId();
String[] appIdParts = appId.split("-");
JsonObject jsonData = new JsonObject();
jsonData.addProperty("appId", appIdParts[2]);
jsonData.addProperty("token", token);
jsonData.addProperty("idiom", "android");
JsonEntity postData = new JsonEntity(jsonData);
client.post(contentSettings.getContentVersion() + "/push/token", postData, null);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
})
.build();
```
Then in your manifest add the receiver filter
```java
```
#Documentation
See the [Javadoc](http://3sidedcube.github.io/Android-LightningMessage/) for full in-depth code-level documentation
#Contributors
[Callum Taylor (9A8BAD)](http://keybase.io/scruffyfox), [Tim Mathews (5C4869)](https://keybase.io/timxyz), [Matt Allen (DB74F5)](https://keybase.io/mallen), [Alan Le Fournis (067EA0)](https://keybase.io/alan3sc)
#License
See LICENSE.md