Skip to content

Commit

Permalink
Merge pull request #46 from Robbe92/master
Browse files Browse the repository at this point in the history
recive push notification in background (Firebase)
  • Loading branch information
progress44 authored Mar 23, 2017
2 parents 4929b64 + 6de6369 commit ca9a2b6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
android/build

android/libs
Binary file added android/dist/ti.goosh-android-2.0.3.zip
Binary file not shown.
Binary file modified android/dist/ti.goosh.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.0.2
version: 2.0.3
apiversion: 3
architectures: armeabi-v7a x86
description: ti.goosh
Expand Down
6 changes: 2 additions & 4 deletions android/src/ti/goosh/TiGooshModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ public void parseBootIntent() {
try {
Intent intent = TiApplication.getAppRootOrCurrentActivity().getIntent();

if (intent.hasExtra(INTENT_EXTRA)) {
String notification = intent.getExtras().getString("data");

String notification = intent.getStringExtra(INTENT_EXTRA);

intent.removeExtra(INTENT_EXTRA);
if (!notification.isEmpty()) {
sendMessage(notification, true);

} else {
Expand Down
3 changes: 2 additions & 1 deletion example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ TiGoosh.registerForPushNotifications({
// The callback to invoke when a notification arrives.
callback: function(e) {
var data = JSON.parse(e.data || '');
alert(data.alert);
Ti.API.info("PUSH received: " + e.data);
alert(data.alert);
},

// The callback invoked when you have the device token.
Expand Down

0 comments on commit ca9a2b6

Please sign in to comment.