{"action":"created","issue":{"url":"https://api.github.com/repos/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171","labels_url":"https://api.github.com/repos/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171/comments","events_url":"https://api.github.com/repos/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171/events","html_url":"https://github.com/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171","id":106305955,"number":171,"title":"Branch SDK should be able to tell whether it's running on Debug or Release build","user":{"login":"arielelkin","id":1756909,"avatar_url":"https://avatars.githubusercontent.com/u/1756909?v=3","gravatar_id":"","url":"https://api.github.com/users/arielelkin","html_url":"https://github.com/arielelkin","followers_url":"https://api.github.com/users/arielelkin/followers","following_url":"https://api.github.com/users/arielelkin/following{/other_user}","gists_url":"https://api.github.com/users/arielelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/arielelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arielelkin/subscriptions","organizations_url":"https://api.github.com/users/arielelkin/orgs","repos_url":"https://api.github.com/users/arielelkin/repos","events_url":"https://api.github.com/users/arielelkin/events{/privacy}","received_events_url":"https://api.github.com/users/arielelkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-14T09:39:36Z","updated_at":"2015-09-15T09:34:52Z","closed_at":null,"body":"It's currently possible to release an app with just Branch test keys.\r\n\r\nThis SDK should prevent developers from committing that mistake.\r\n\r\nIt really should be the responsibility of the Branch SDK to know whether it’s running on a debug or release version of the app. It can use things such as preprocessor macros or environmental variables to be able to determine that. \r\n\r\nThen developers would only need a single Branch key!"},"comment":{"url":"https://api.github.com/repos/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/comments/140337145","html_url":"https://github.com/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171#issuecomment-140337145","issue_url":"https://api.github.com/repos/BranchMetrics/iOS-Deferred-Deep-Linking-SDK/issues/171","id":140337145,"user":{"login":"arielelkin","id":1756909,"avatar_url":"https://avatars.githubusercontent.com/u/1756909?v=3","gravatar_id":"","url":"https://api.github.com/users/arielelkin","html_url":"https://github.com/arielelkin","followers_url":"https://api.github.com/users/arielelkin/followers","following_url":"https://api.github.com/users/arielelkin/following{/other_user}","gists_url":"https://api.github.com/users/arielelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/arielelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arielelkin/subscriptions","organizations_url":"https://api.github.com/users/arielelkin/orgs","repos_url":"https://api.github.com/users/arielelkin/repos","events_url":"https://api.github.com/users/arielelkin/events{/privacy}","received_events_url":"https://api.github.com/users/arielelkin/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T09:34:52Z","updated_at":"2015-09-15T09:34:52Z","body":"Apple does include a `DEBUG` compiler preprocessor flag in debug builds. You can then do something like:\r\n\r\n```\r\n#ifdef DEBUG\r\n//use Branch test key\r\n#else\r\n//use Branch live key\r\n#endif\r\n```\r\n\r\nMore info here: http://stackoverflow.com/q/9063100/1072846\r\n\r\nThis flag is present by default in Xcode, but it wouldn't matter for the Branch SDK if I were to turn it off, as the Branch SDK is compiled and built according to its own scheme. \r\n\r\nEnvironmental variables are a good alternative:\r\nhttp://stackoverflow.com/a/24344459/1072846\r\n\r\n"}}