ios send local notification can accept 0 as params

This commit is contained in:
huangminlinux
2018-10-23 18:15:29 +08:00
parent 265d88e766
commit e60d7c2b8c
+3 -2
View File
@@ -395,13 +395,14 @@
}
JPushNotificationTrigger *trigger = [[JPushNotificationTrigger alloc] init];
// 由于 不支持 0 作为传入参数,在传入参数基础上添加一个极小的时间于 android 端保持一致。
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0) {
if (delay) {
trigger.timeInterval = [delay doubleValue];
trigger.timeInterval = [delay doubleValue] + 0.000001;
}
} else {
if (delay) {
trigger.fireDate = [NSDate dateWithTimeIntervalSinceNow:[[command argumentAtIndex:0] intValue]];
trigger.fireDate = [NSDate dateWithTimeIntervalSinceNow:[[command argumentAtIndex:0] doubleValue] + 0.001];
}
}