{"action":"closed","issue":{"url":"https://api.github.com/repos/mixpanel/mixpanel-iphone/issues/241","labels_url":"https://api.github.com/repos/mixpanel/mixpanel-iphone/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/mixpanel/mixpanel-iphone/issues/241/comments","events_url":"https://api.github.com/repos/mixpanel/mixpanel-iphone/issues/241/events","html_url":"https://github.com/mixpanel/mixpanel-iphone/issues/241","id":64597880,"number":241,"title":"Flush Timer not started on initWithToken:launchOptions:andFlushInterval:","user":{"login":"originell","id":23529,"avatar_url":"https://avatars.githubusercontent.com/u/23529?v=3","gravatar_id":"","url":"https://api.github.com/users/originell","html_url":"https://github.com/originell","followers_url":"https://api.github.com/users/originell/followers","following_url":"https://api.github.com/users/originell/following{/other_user}","gists_url":"https://api.github.com/users/originell/gists{/gist_id}","starred_url":"https://api.github.com/users/originell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/originell/subscriptions","organizations_url":"https://api.github.com/users/originell/orgs","repos_url":"https://api.github.com/users/originell/repos","events_url":"https://api.github.com/users/originell/events{/privacy}","received_events_url":"https://api.github.com/users/originell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mixpanel/mixpanel-iphone/labels/bug","name":"bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"samgreen","id":276118,"avatar_url":"https://avatars.githubusercontent.com/u/276118?v=3","gravatar_id":"","url":"https://api.github.com/users/samgreen","html_url":"https://github.com/samgreen","followers_url":"https://api.github.com/users/samgreen/followers","following_url":"https://api.github.com/users/samgreen/following{/other_user}","gists_url":"https://api.github.com/users/samgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/samgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samgreen/subscriptions","organizations_url":"https://api.github.com/users/samgreen/orgs","repos_url":"https://api.github.com/users/samgreen/repos","events_url":"https://api.github.com/users/samgreen/events{/privacy}","received_events_url":"https://api.github.com/users/samgreen/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-03-26T18:11:12Z","updated_at":"2015-07-17T23:52:45Z","closed_at":"2015-07-17T23:52:45Z","body":"The interval is set via `_flushInterval` , which skips the respective setter of course (which would in turn call `startFlushTimer`).\r\n\r\nI noticed that because I'm working on a project where I don't have to start Mixpanel right in the AppDelegate, but much later on. So there's also no `applicationDidBecomeActive` to be called.\r\nI wondered why nothing seemed to work, except when I flush myself. Then I discovered that simple fact :) \r\n\r\nCurrent workaround is to set the `flushInterval` again after the init, manually.\r\n\r\n```\r\nmixpanel = Mixpanel(token: MixpanelToken, launchOptions: nil, andFlushInterval: 60)\r\nmixpanel.checkForNotificationsOnActive = true\r\nmixpanel.showNotificationOnActive = false  // Show Notifications manually.\r\nmixpanel.checkForSurveysOnActive = true\r\nmixpanel.showSurveyOnActive = false  // Show Surveys manually.\r\nmixpanel.flushInterval = 60  // Workaround: startFlushTimer not called on Mixpanel init\r\nmixpanel.flushOnBackground = true\r\n```\r\n\r\nInitially wanted to do a PR that fixes that, but wasn't sure what would be your preferred way of solving this :) \r\n\r\nCheers"}}