Commit a720399c by Sebastián Katzer

Log calculated trigger date in debug mode

parent 9de44b4a
......@@ -33,6 +33,7 @@ import android.service.notification.StatusBarNotification;
import android.support.v4.app.NotificationCompat;
import android.support.v4.util.ArraySet;
import android.support.v4.util.Pair;
import android.util.Log;
import android.util.SparseArray;
import org.json.JSONException;
......@@ -181,6 +182,8 @@ public final class Notification {
do {
Date date = request.getTriggerDate();
Log.d("local-notification", "Next trigger at: " + date);
if (date == null)
continue;
......
......@@ -413,8 +413,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 };
seconds = 60;
}
return [UNTimeIntervalNotificationTrigger
triggerWithTimeInterval:seconds repeats:YES];
UNTimeIntervalNotificationTrigger* trigger =
[UNTimeIntervalNotificationTrigger triggerWithTimeInterval:seconds
repeats:YES];
NSLog(@"[local-notification] Next trigger at: %@", trigger.nextTriggerDate);
return trigger;
}
/**
......@@ -430,8 +435,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 };
date.timeZone = [NSTimeZone defaultTimeZone];
return [UNCalendarNotificationTrigger
triggerWithDateMatchingComponents:date repeats:repeats];
UNCalendarNotificationTrigger* trigger =
[UNCalendarNotificationTrigger triggerWithDateMatchingComponents:date
repeats:repeats];
NSLog(@"[local-notification] Next trigger at: %@", trigger.nextTriggerDate);
return trigger;
}
/**
......@@ -447,8 +457,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 };
date.calendar = cal;
date.timeZone = [NSTimeZone defaultTimeZone];
return [UNCalendarNotificationTrigger
triggerWithDateMatchingComponents:date repeats:YES];
UNCalendarNotificationTrigger* trigger =
[UNCalendarNotificationTrigger triggerWithDateMatchingComponents:date
repeats:YES];
NSLog(@"[local-notification] Next trigger at: %@", trigger.nextTriggerDate);
return trigger;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment