Plot Projects - 在目标c(iOS)中未触发plotFilterNotifications

时间:2017-10-06 12:35:50

标签: ios objective-c plot

绘图的初始化成功完成,纬度和经度也会在调试日志中打印出来。

- 绘制项目下面的方法无法正常工作,特定位置明智的触发器无效。请向我推荐。

-(void)plotFilterNotifications:(PlotFilterNotifications*)filterNotifications {
NSArray* notifications = filterNotifications.uiNotifications;
for (UNNotificationRequest* notification in notifications) {

    //alter notification
    //ensure the keys in the userInfo also present in the new object.
    NSString* customMessage = @"Custom message";
    UNMutableNotificationContent* customContent =  [[UNMutableNotificationContent alloc] init];
    customContent.body = customMessage;
    NSMutableDictionary* userInfo = [notification.content.userInfo mutableCopy];
    customContent.userInfo = userInfo;
    UNNotificationRequest* updatedNotification =  [UNNotificationRequest requestWithIdentifier:notification.identifier content:customContent trigger:notification.trigger];
    [updatedNotifications addObject: updatedNotification];
}
// Always call showNotifications at the end of the method
[filterNotifications showNotifications:updatedNotifications];

}

-(void)plotHandleGeotriggers:(PlotHandleGeotriggers*)geotriggerHandler {
    NSMutableArray* toPass = [[NSMutableArray alloc] init];
    for (PlotGeotrigger* geotrigger in geotriggerHandler.geotriggers) {
        if ([@"pass" isEqualToString:[geotrigger.userInfo objectForKey:PlotGeotriggerDataKey]]) {
            [toPass addObject:geotrigger];
        }
    }
    // Always call markGeotriggersHandled at the end of the method
    [geotriggerHandler markGeotriggersHandled:toPass];
}    

0 个答案:

没有答案