Skip to content

Commit

Permalink
Merge branch 'feature/issue7' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ani Sinanaj committed Aug 11, 2016
2 parents 75342b7 + ee63d10 commit 3420a19
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 4 deletions.
Binary file modified android/dist/ti.goosh-android-1.2.0.zip
Binary file not shown.
Binary file modified android/dist/ti.goosh.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.2.0
version: 1.3.0
apiversion: 2
architectures: armeabi armeabi-v7a x86
description: ti.goosh
author: Flavio De Stefano
license: Specify your license
author: Flavio De Stefano, Ani Sinanaj
license: MIT
copyright: Copyright (c) 2016 by Caffeina

# these should not be edited
Expand Down
112 changes: 111 additions & 1 deletion android/src/ti/goosh/IntentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,118 @@ else if(vibrateJson.isJsonArray()) {
Log.e(LCAT, "Lights exception: " + ex.getMessage());
}

// Ongoing

try {
if(data.has("ongoing"))
{
JsonElement ongoingJson = data.get("ongoing");

if(ongoingJson.isJsonPrimitive())
{
Boolean ongoing = ongoingJson.getAsBoolean();

builder.setOngoing(ongoing);
}
}
else
{
builder_defaults |= Notification.DEFAULT_LIGHTS;
}
} catch(Exception ex) {
Log.e(LCAT, "Ongoing exception: " + ex.getMessage());
}

// Group

try {
if(data.has("group"))
{
JsonElement groupJson = data.get("group");

if(groupJson.isJsonPrimitive())
{
String group = groupJson.getAsString();

builder.setGroup(group);
}
}
else
{
builder_defaults |= Notification.DEFAULT_LIGHTS;
}
} catch(Exception ex) {
Log.e(LCAT, "Group exception: " + ex.getMessage());
}

// GroupSummary

try {
if(data.has("group_summary"))
{
JsonElement groupsumJson = data.get("group_summary");

if(groupsumJson.isJsonPrimitive())
{
Boolean groupsum = groupsumJson.getAsBoolean();

builder.setGroupSummary(groupsum);
}
}
else
{
builder_defaults |= Notification.DEFAULT_LIGHTS;
}
} catch(Exception ex) {
Log.e(LCAT, "Group summary exception: " + ex.getMessage());
}

// When

try {
if(data.has("when"))
{
JsonElement whenJson = data.get("when");

if(whenJson.isJsonPrimitive())
{
int when = whenJson.getAsInt();

builder.setWhen(when);
}
}
else
{
builder_defaults |= Notification.DEFAULT_LIGHTS;
}
} catch(Exception ex) {
Log.e(LCAT, "When exception: " + ex.getMessage());
}

// Only alert once

try {
if(data.has("only_alert_once"))
{
JsonElement oaoJson = data.get("only_alert_once");

if(oaoJson.isJsonPrimitive())
{
Boolean oao = oaoJson.getAsBoolean();

builder.setOnlyAlertOnce(oao);
}
}
else
{
builder_defaults |= Notification.DEFAULT_LIGHTS;
}
} catch(Exception ex) {
Log.e(LCAT, "Only alert once exception: " + ex.getMessage());
}

builder.setDefaults(builder_defaults);

// Build

// Tag
Expand Down
4 changes: 4 additions & 0 deletions android/src/ti/goosh/TiGooshModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;

import com.google.android.gms.gcm.GcmPubSub;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import com.google.android.gms.iid.InstanceID;

@Kroll.module(name="TiGoosh", id="ti.goosh")
public class TiGooshModule extends KrollModule {

Expand Down

0 comments on commit 3420a19

Please sign in to comment.