LightningMessage

Messaging module of the Storm Framework

Лицензия

Лицензия

Категории

Категории

IDE Инструменты разработки ORM Данные
Группа

Группа

com.3sidedcube.storm
Идентификатор

Идентификатор

message
Последняя версия

Последняя версия

0.1a
Дата

Дата

Тип

Тип

aar
Описание

Описание

LightningMessage
Messaging module of the Storm Framework
Ссылка на сайт

Ссылка на сайт

https://github.com/3sidedcube/Android-LightningMessage.git
Система контроля версий

Система контроля версий

https://github.com/3sidedcube/Android-LightningMessage.git

Скачать message

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.3sidedcube.storm/message/ -->
<dependency>
    <groupId>com.3sidedcube.storm</groupId>
    <artifactId>message</artifactId>
    <version>0.1a</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.3sidedcube.storm/message/
implementation 'com.3sidedcube.storm:message:0.1a'
// https://jarcasting.com/artifacts/com.3sidedcube.storm/message/
implementation ("com.3sidedcube.storm:message:0.1a")
'com.3sidedcube.storm:message:aar:0.1a'
<dependency org="com.3sidedcube.storm" name="message" rev="0.1a">
  <artifact name="message" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.3sidedcube.storm', module='message', version='0.1a')
)
libraryDependencies += "com.3sidedcube.storm" % "message" % "0.1a"
[com.3sidedcube.storm/message "0.1a"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
com.google.android.gms » play-services jar 6.1.71
com.3sidedcube.storm : util jar 0.2
org.projectlombok : lombok jar 1.14.8
com.android.support » support-v13 jar 20.0.0
com.android.support » support-annotations jar 20.0.0

Модули Проекта

Данный проект не имеет модулей.

#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

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

<!-- Push Notifications -->
<receiver
	android:name="com.cube.storm.message.lib.receiver.MessageReceiver"
	android:permission="com.google.android.c2dm.permission.SEND"
>
	<intent-filter>
		<action android:name="com.google.android.c2dm.intent.RECEIVE" />
		<category android:name="your.package.name" />
	</intent-filter>
</receiver>

#Documentation

See the Javadoc for full in-depth code-level documentation

#Contributors

Callum Taylor (9A8BAD), Tim Mathews (5C4869), Matt Allen (DB74F5), Alan Le Fournis (067EA0)

#License

See LICENSE.md

com.3sidedcube.storm

3 SIDED CUBE

We're an app development and digital product company that specialises in tech for good.

Версии библиотеки

Версия
0.1a