Commit a720399c by Sebastián Katzer

Log calculated trigger date in debug mode

parent 9de44b4a
...@@ -33,6 +33,7 @@ import android.service.notification.StatusBarNotification; ...@@ -33,6 +33,7 @@ import android.service.notification.StatusBarNotification;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.support.v4.util.ArraySet; import android.support.v4.util.ArraySet;
import android.support.v4.util.Pair; import android.support.v4.util.Pair;
import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -181,6 +182,8 @@ public final class Notification { ...@@ -181,6 +182,8 @@ public final class Notification {
do { do {
Date date = request.getTriggerDate(); Date date = request.getTriggerDate();
Log.d("local-notification", "Next trigger at: " + date);
if (date == null) if (date == null)
continue; continue;
......
...@@ -413,8 +413,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 }; ...@@ -413,8 +413,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 };
seconds = 60; seconds = 60;
} }
return [UNTimeIntervalNotificationTrigger UNTimeIntervalNotificationTrigger* trigger =
triggerWithTimeInterval:seconds repeats:YES]; [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 }; ...@@ -430,8 +435,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 };
date.timeZone = [NSTimeZone defaultTimeZone]; date.timeZone = [NSTimeZone defaultTimeZone];
return [UNCalendarNotificationTrigger UNCalendarNotificationTrigger* trigger =
triggerWithDateMatchingComponents:date repeats:repeats]; [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 }; ...@@ -447,8 +457,13 @@ static NSInteger WEEKDAYS[8] = { 0, 2, 3, 4, 5, 6, 7, 1 };
date.calendar = cal; date.calendar = cal;
date.timeZone = [NSTimeZone defaultTimeZone]; date.timeZone = [NSTimeZone defaultTimeZone];
return [UNCalendarNotificationTrigger UNCalendarNotificationTrigger* trigger =
triggerWithDateMatchingComponents:date repeats:YES]; [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