Skip to content

Commit

Permalink
1.5.0 build
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio De Stefano committed Sep 9, 2016
1 parent 37199c9 commit 2411339
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ TiGoosh.registerForPushNotifications({

## Unregister

*Not currently implemented*

```js
TiGoosh.unregisterForPushNotifications();
```
Expand Down Expand Up @@ -107,17 +105,21 @@ gcm.setAppBadge(2);
```

## Cancel received notification

Cancel all notifications

```
TiGoosh.cancelAll();
```

Cancel notification By id

```
TiGoosh.cancel(int id);
```

Cancel notification with tag and id

```
TiGoosh.cancelWithTag(String tag, int id);
```
Expand Down
10 changes: 5 additions & 5 deletions android/build.properties.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
titanium.sdk=/Library/Application\ Support/Titanium/
titanium.sdk=/Users/flavio.destefano/Library/Application\ Support/Titanium/
titanium.os=osx
titanium.version=3.1.0.GA
android.sdk=/usr/android-sdk
titanium.version=5.2.2.GA
android.sdk=/opt/android/

titanium.platform=${titanium.sdk}/mobilesdk/${titanium.os}/${titanium.version}/android
android.platform=${android.sdk}/platforms/android-8
google.apis=${android.sdk}/add-ons/addon_google_apis_google_inc_8
android.platform=${android.sdk}/platforms/android-23
google.apis=${android.sdk}/add-ons/addon_google_apis_google_23
Binary file modified android/dist/ti.goosh-android-1.5.0.zip
Binary file not shown.
Binary file modified android/dist/ti.goosh.jar
Binary file not shown.
Binary file modified android/lib/google-play-services-tigoosh.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions android/proguard/proguard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
public protected *;
}

-keep public class com.google.android.gms.iid.** {
public protected *;
}

-keep public class com.google.android.gms.common.** {
public protected *;
}
31 changes: 14 additions & 17 deletions android/src/ti/goosh/TiGooshModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,20 @@ public void unregisterForPushNotifications() {
this.deleteTokenInBackground(sender, GoogleCloudMessaging.INSTANCE_ID_SCOPE, c);
}

/**
* Unregister in background by deleting the token
*/
public void deleteTokenInBackground(final String authorizedEntity, final String scope, final Context context) {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
InstanceID.getInstance(context).deleteToken(authorizedEntity, scope);
Log.d(LCAT, "delete instanceid succeeded.");
} catch (final IOException e) {
Log.e(LCAT, "remove token failed." + "\nsenderId: " + authorizedEntity + "\nerror: " + e.getMessage());
}
return null;
}
}.execute();
}
private void deleteTokenInBackground(final String authorizedEntity, final String scope, final Context context) {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
InstanceID.getInstance(context).deleteToken(authorizedEntity, scope);
Log.d(LCAT, "delete instanceid succeeded");
} catch (final IOException e) {
Log.e(LCAT, "remove token failed" + "senderId: " + authorizedEntity + "\nerror: " + e.getMessage());
}
return null;
}
}.execute();
}

@Kroll.method
public void cancelAll() {
Expand Down

0 comments on commit 2411339

Please sign in to comment.