Skip to content

Commit

Permalink
Add more Console Output
Browse files Browse the repository at this point in the history
  • Loading branch information
coman3 committed Oct 28, 2016
1 parent 0fbe724 commit 9f4d69b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/android/FirebasePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
}

private void onNotificationOpen(final CallbackContext callbackContext) {
Log.d(TAG, "Hooking onNotificationOpen");
FirebasePlugin.notificationCallbackContext = new WeakReference<CallbackContext>(callbackContext);
if(FirebasePlugin.pendingNotifications != null){
Log.d(TAG, "Sending Cached notifications to application..");
//looks like we have cache, lets notify the application of each notification in the cache
for (Bundle bundle : FirebasePlugin.pendingNotifications) {
FirebasePlugin.sendNotification(bundle);
Expand All @@ -140,6 +142,7 @@ private void onNotificationOpen(final CallbackContext callbackContext) {
}
}
private void onNotificationReceived(final CallbackContext callbackContext) {
Log.d(TAG, "Hooking onNotificationReceived");
//no need to check for cache, all cached notifications should have been called in `onNotificationOpen`.
FirebasePlugin.notificationReceivedCallbackContext = new WeakReference<CallbackContext>(callbackContext);
}
Expand All @@ -163,6 +166,7 @@ public void run() {
}

public static void receiveNotification(Bundle bundle) {
Log.d("FirebasePlugin", "Received Notification");
if(FirebasePlugin.notificationReceivedCallbackContext == null) {
//No need for cache, as the app should already be initialized.
return;
Expand All @@ -188,7 +192,7 @@ public static void receiveNotification(Bundle bundle) {
}

public static void sendNotification(Bundle bundle) {

Log.d("FirebasePlugin", "Send / Sent Notification");
if(FirebasePlugin.notificationCallbackContext == null) {
//No callback for notification, add to cache...
Log.d("FirebasePlugin", "Send `CallbackContext` is null, adding notification to cache");
Expand Down Expand Up @@ -554,6 +558,7 @@ public void onResume(boolean multitasking) {
@Override
public void onStart() {
super.onStart();
Log.d(TAG, "FirebasePlugin Start");
this.IsAppInForegound = true;
}

Expand Down

0 comments on commit 9f4d69b

Please sign in to comment.