{"action":"created","issue":{"url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/494","repository_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk","labels_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/494/comments","events_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/494/events","html_url":"https://github.com/QuickBlox/quickblox-ios-sdk/issues/494","id":157483010,"number":494,"title":"QBMEvent doesn't return correct date","user":{"login":"neshyurik","id":19648095,"avatar_url":"https://avatars.githubusercontent.com/u/19648095?v=3","gravatar_id":"","url":"https://api.github.com/users/neshyurik","html_url":"https://github.com/neshyurik","followers_url":"https://api.github.com/users/neshyurik/followers","following_url":"https://api.github.com/users/neshyurik/following{/other_user}","gists_url":"https://api.github.com/users/neshyurik/gists{/gist_id}","starred_url":"https://api.github.com/users/neshyurik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neshyurik/subscriptions","organizations_url":"https://api.github.com/users/neshyurik/orgs","repos_url":"https://api.github.com/users/neshyurik/repos","events_url":"https://api.github.com/users/neshyurik/events{/privacy}","received_events_url":"https://api.github.com/users/neshyurik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-30T11:16:44Z","updated_at":"2016-06-03T14:31:57Z","closed_at":null,"body":"I'm using Quickblox to send remote notifications via APNs from iPhones using the Quickblox iOS SDK.\r\nWhen I create event with type with fixed date it  responses the event but for some time in the future (Example: 2084-06-17 2:28:50 PM +0000)\r\n\r\n```objectivec\r\n  [QBRequest userWithLogin:self.currentClipon.receiverName successBlock:^(QBResponse *response, QBUUser *user) {\r\n       \r\n        NSTimeInterval oneMinute = 60.0;\r\n        NSDate *dateToSend = [NSDate dateWithTimeIntervalSinceNow:oneMinute];\r\n        \r\n        QBMEvent *event = [QBMEvent event];\r\n        event.notificationType = QBMNotificationTypePush;\r\n        event.type = QBMEventTypeFixedDate;\r\n        event.date = dateToSend;\r\n        event.pushType = QBMPushTypeAPNS;\r\n        \r\n        event.usersIDs = [NSString stringWithFormat:@\"%lu\", (unsigned long)user.ID];\r\n        event.isDevelopmentEnvironment = ![QBApplication sharedApplication].productionEnvironmentForPushesEnabled;\r\n\r\n        // custom params\r\n        NSMutableDictionary  *dictPush=[NSMutableDictionary  dictionaryWithObjectsAndKeys:@\"Qwerty\", @\"message\", nil];\r\n        [dictPush setObject:@\"beep-warmguitar.aif\" forKey:@\"ios_sound\"];\r\n        \r\n        NSError *error = nil;\r\n        NSData *sendData = [NSJSONSerialization dataWithJSONObject:dictPush options:NSJSONWritingPrettyPrinted error:&error];\r\n        NSString *jsonString = [[NSString alloc] initWithData:sendData encoding:NSUTF8StringEncoding];\r\n        \r\n        event.message = jsonString;\r\n        \r\n        [QBRequest createEvent:event successBlock:^(QBResponse *response, NSArray *events) {\r\n            \r\n        }\r\n                    errorBlock:^(QBResponse *response) {\r\n                        \r\n                    }];\r\n        \r\n    } errorBlock:^(QBResponse *response) {\r\n        \r\n    }];\r\n```\r\n\r\n**Environment details**\r\nIOS 9.3.1 (Deployment target -8.0)\r\nXcode Version 7.3.1\r\n\r\n**Did this work before?**\r\nNo\r\n\r\n**Logs**\r\n```\r\n<__NSArrayI 0x150a5cce0>(\r\n\r\n  [QBMEvent]:\r\n  ID:7178125\r\n  created at:2016-05-30 11:14:42 AM +0000\r\n  updated at:2016-05-30 11:14:42 AM +0000\r\n  active:YES\r\n  notificationType:push\r\n  pushType:apns\r\n  usersIDs:13126192\r\n  usersExternalIDs:(null)\r\n  usersTagsAny:(null)\r\n  usersTagsAll:(null)\r\n  usersTagsExclude:(null)\r\n  name:(null)\r\n  isEnvironmentDevelopment:YES\r\n  message:payload=eyJhcHMiOnsiYWxlcnQiOiJ7XG4gIFwibWVzc2FnZVwiIDogXCJRd2VydHlcIixcbiAgXCJpb3Nfc291bmRcIiA6IFwiYmVlcC13YXJtZ3VpdGFyLmFpZlwiXG59Iiwic291bmQiOiJkZWZhdWx0In19\r\n  type:fixed_date\r\n  date:2084-06-17 2:28:50 PM +0000\r\n  endDate:(null)\r\n  period:0\r\n  occuredCount:0\r\n  senderID:13125511\r\n)\r\n```"},"comment":{"url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/comments/223594989","html_url":"https://github.com/QuickBlox/quickblox-ios-sdk/issues/494#issuecomment-223594989","issue_url":"https://api.github.com/repos/QuickBlox/quickblox-ios-sdk/issues/494","id":223594989,"user":{"login":"Raikerian","id":8850270,"avatar_url":"https://avatars.githubusercontent.com/u/8850270?v=3","gravatar_id":"","url":"https://api.github.com/users/Raikerian","html_url":"https://github.com/Raikerian","followers_url":"https://api.github.com/users/Raikerian/followers","following_url":"https://api.github.com/users/Raikerian/following{/other_user}","gists_url":"https://api.github.com/users/Raikerian/gists{/gist_id}","starred_url":"https://api.github.com/users/Raikerian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raikerian/subscriptions","organizations_url":"https://api.github.com/users/Raikerian/orgs","repos_url":"https://api.github.com/users/Raikerian/repos","events_url":"https://api.github.com/users/Raikerian/events{/privacy}","received_events_url":"https://api.github.com/users/Raikerian/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T14:31:57Z","updated_at":"2016-06-03T14:31:57Z","body":"Hi @neshyurik \r\n\r\nCan you try to set the date without seconds?\r\n\r\nUse something like this:\r\n```objectivec\r\nNSTimeInterval oneMinute = 60.0;\r\nNSDate *dateToSend = [NSDate dateWithTimeIntervalSinceNow:oneMinute];\r\nNSTimeInterval timeSince1970 = [dateToSend timeIntervalSince1970];\r\ntimeSince1970 -= fmod(timeSince1970, 60); // subtract away any extra seconds\r\nNSDate *nowMinus = [NSDate dateWithTimeIntervalSince1970:timeSince1970];\r\n```\r\n\r\nRight now I'm investigating the issue and will post update on whats wrong as soon as possible."}}
{"actor":{"display_login":"Raikerian"}}