{"action":"created","issue":{"url":"https://api.github.com/repos/rnapier/RNTimer/issues/1","labels_url":"https://api.github.com/repos/rnapier/RNTimer/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/rnapier/RNTimer/issues/1/comments","events_url":"https://api.github.com/repos/rnapier/RNTimer/issues/1/events","html_url":"https://github.com/rnapier/RNTimer/issues/1","id":6856098,"number":1,"title":"Suggestion: Add for a one-time only timer","user":{"login":"ArvinB","id":1202744,"avatar_url":"https://avatars.githubusercontent.com/u/1202744?v=3","gravatar_id":"","url":"https://api.github.com/users/ArvinB","html_url":"https://github.com/ArvinB","followers_url":"https://api.github.com/users/ArvinB/followers","following_url":"https://api.github.com/users/ArvinB/following{/other_user}","gists_url":"https://api.github.com/users/ArvinB/gists{/gist_id}","starred_url":"https://api.github.com/users/ArvinB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArvinB/subscriptions","organizations_url":"https://api.github.com/users/ArvinB/orgs","repos_url":"https://api.github.com/users/ArvinB/repos","events_url":"https://api.github.com/users/ArvinB/events{/privacy}","received_events_url":"https://api.github.com/users/ArvinB/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2012-09-13T18:47:59Z","updated_at":"2015-06-28T19:20:22Z","closed_at":"2015-06-28T19:20:22Z","body":"```objective-c\nRNTimer *timer = [[self alloc] init];\n\ttimer.timerBlock = block;\n\ttimer.source = dispatch_source_create( DISPATCH_SOURCE_TYPE_TIMER,\n\t\t\t\t\t\t\t\t\t\t  0, 0,\n\t\t\t\t\t\t\t\t\t\t  dispatch_get_main_queue() );\n\t\n\tuint64_t time = (uint64_t)(interval * NSEC_PER_SEC);\n\tdispatch_source_set_timer( timer.source,\n\t\t\t\t\t\t\t   dispatch_time(DISPATCH_TIME_NOW, time),\n\t\t\t\t\t\t\t   DISPATCH_TIME_FOREVER, 0 );\n\tdispatch_source_set_event_handler( timer.source, ^{\n\t\t\n\t\t[timer fire];\n\t\t[timer invalidate];\n\t});\n\t\n\tdispatch_resume( timer.source );\n\treturn timer;\n```"},"comment":{"url":"https://api.github.com/repos/rnapier/RNTimer/issues/comments/116318545","html_url":"https://github.com/rnapier/RNTimer/issues/1#issuecomment-116318545","issue_url":"https://api.github.com/repos/rnapier/RNTimer/issues/1","id":116318545,"user":{"login":"rnapier","id":429858,"avatar_url":"https://avatars.githubusercontent.com/u/429858?v=3","gravatar_id":"","url":"https://api.github.com/users/rnapier","html_url":"https://github.com/rnapier","followers_url":"https://api.github.com/users/rnapier/followers","following_url":"https://api.github.com/users/rnapier/following{/other_user}","gists_url":"https://api.github.com/users/rnapier/gists{/gist_id}","starred_url":"https://api.github.com/users/rnapier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnapier/subscriptions","organizations_url":"https://api.github.com/users/rnapier/orgs","repos_url":"https://api.github.com/users/rnapier/repos","events_url":"https://api.github.com/users/rnapier/events{/privacy}","received_events_url":"https://api.github.com/users/rnapier/received_events","type":"User","site_admin":false},"created_at":"2015-06-28T19:20:22Z","updated_at":"2015-06-28T19:20:22Z","body":"@sunny131984 This question doesn't seem to be related to this issue, but I'm having some trouble understanding the question.\r\n\r\nThere is no general way to run a method at a specific time if you are not in the foreground. iOS breaks that on purpose; they don't want you to do it because it's bad for battery. The closest thing available is silent push notifications, but the user must be connected to the network, and you can't set them for a specific time.\r\n\r\nYou haven't explained the problem you're solving. If the user wants to interact at 9am, then an alert is the preferred solution. If the user doesn't want to interact at 9am, then there is no way for you to demand system resources at that time. What you can do is use Background App Refresh to coordinate being waken when the system believes the user might want something from you (so if the user accesses you at 9am every day, the system might wake you up a few minutes before that so you can get ready).\r\n\r\nIn any case, RNTimer is no different here than NSTimer. NSTimer does not use significant system resources (almost nothing), so I don't understand what you mean by \"consumes lots of battery.\""}}