{"action":"created","issue":{"url":"https://api.github.com/repos/Countly/countly-sdk-ios/issues/78","repository_url":"https://api.github.com/repos/Countly/countly-sdk-ios","labels_url":"https://api.github.com/repos/Countly/countly-sdk-ios/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/Countly/countly-sdk-ios/issues/78/comments","events_url":"https://api.github.com/repos/Countly/countly-sdk-ios/issues/78/events","html_url":"https://github.com/Countly/countly-sdk-ios/issues/78","id":149723766,"number":78,"title":"sharedApplication is unavailable in iOS extension","user":{"login":"ddaddy","id":1425808,"avatar_url":"https://avatars.githubusercontent.com/u/1425808?v=3","gravatar_id":"","url":"https://api.github.com/users/ddaddy","html_url":"https://github.com/ddaddy","followers_url":"https://api.github.com/users/ddaddy/followers","following_url":"https://api.github.com/users/ddaddy/following{/other_user}","gists_url":"https://api.github.com/users/ddaddy/gists{/gist_id}","starred_url":"https://api.github.com/users/ddaddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddaddy/subscriptions","organizations_url":"https://api.github.com/users/ddaddy/orgs","repos_url":"https://api.github.com/users/ddaddy/repos","events_url":"https://api.github.com/users/ddaddy/events{/privacy}","received_events_url":"https://api.github.com/users/ddaddy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Countly/countly-sdk-ios/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"erkanyildiz","id":1222652,"avatar_url":"https://avatars.githubusercontent.com/u/1222652?v=3","gravatar_id":"","url":"https://api.github.com/users/erkanyildiz","html_url":"https://github.com/erkanyildiz","followers_url":"https://api.github.com/users/erkanyildiz/followers","following_url":"https://api.github.com/users/erkanyildiz/following{/other_user}","gists_url":"https://api.github.com/users/erkanyildiz/gists{/gist_id}","starred_url":"https://api.github.com/users/erkanyildiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erkanyildiz/subscriptions","organizations_url":"https://api.github.com/users/erkanyildiz/orgs","repos_url":"https://api.github.com/users/erkanyildiz/repos","events_url":"https://api.github.com/users/erkanyildiz/events{/privacy}","received_events_url":"https://api.github.com/users/erkanyildiz/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-04-20T10:08:11Z","updated_at":"2016-05-02T17:26:45Z","closed_at":null,"body":"I am updating an old project that has both an Today Widget extension and also a WatchKit v1 extension.\r\n\r\nI get a compiler error in CountlyDeviceInfo.m on line 385 in this method\r\n```\r\n+ (BOOL)isInBackground\r\n{\r\n#if TARGET_OS_IOS\r\n    return UIApplication.sharedApplication.applicationState == UIApplicationStateBackground;\r\n#else\r\n    return NO;\r\n#endif\r\n}\r\n```\r\n\r\nsaying `sharedApplication` is unavailable."},"comment":{"url":"https://api.github.com/repos/Countly/countly-sdk-ios/issues/comments/216302317","html_url":"https://github.com/Countly/countly-sdk-ios/issues/78#issuecomment-216302317","issue_url":"https://api.github.com/repos/Countly/countly-sdk-ios/issues/78","id":216302317,"user":{"login":"jboehle","id":431087,"avatar_url":"https://avatars.githubusercontent.com/u/431087?v=3","gravatar_id":"","url":"https://api.github.com/users/jboehle","html_url":"https://github.com/jboehle","followers_url":"https://api.github.com/users/jboehle/followers","following_url":"https://api.github.com/users/jboehle/following{/other_user}","gists_url":"https://api.github.com/users/jboehle/gists{/gist_id}","starred_url":"https://api.github.com/users/jboehle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jboehle/subscriptions","organizations_url":"https://api.github.com/users/jboehle/orgs","repos_url":"https://api.github.com/users/jboehle/repos","events_url":"https://api.github.com/users/jboehle/events{/privacy}","received_events_url":"https://api.github.com/users/jboehle/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T17:26:45Z","updated_at":"2016-05-02T17:26:45Z","body":"Using TARGET_IS_EXTENSION will not work if Countly is being compiled into a shared library/framework with APPLICATION_EXTENSION_API_ONLY turned on. For that it looks like the best solution is for Countly to use a preprocessor define, say COUNTLY_EXTENSION_API_ONLY, or something along those lines, that can be added to the preprocessor defines for the project that has both Countly and APPLICATION_EXTENSION_API_ONLY=YES."}}