ios icon indicating copy to clipboard operation
ios copied to clipboard

Add assertion checks for API key usage

Open msmollin opened this issue 8 years ago • 5 comments

We should be more aggressive about checking for API key usage in the SDK and utilize something like Cocoa's assert() to avoid assertions being compiled into production code.

msmollin avatar Apr 11 '17 15:04 msmollin

@sarahlensing i think this is done now?

msmollin avatar May 02 '17 20:05 msmollin

Or did we only add this to the sample app?

msmollin avatar May 02 '17 20:05 msmollin

We only added it to the sample app so we should keep this open and update MapzenSearch, etc.

sarahsnow1 avatar May 02 '17 21:05 sarahsnow1

Looked at this a little bit and we do kinda already check for this, but just in MZMapViewController https://github.com/mapzen/ios/blob/master/MapzenSDK/MZMapViewController.swift#L1082

And it throws, it doesn't assert the api key missing. Since I can't change that API do you think I should just add an assert into that? Or should I have the other places throw as well?

msmollin avatar May 11 '17 16:05 msmollin

After discussion we're going to make this assert and change the call to not throw anymore and deprecate all the loadStyle* functions and create new ones that no longer throw as well. We'll release this as part of 1.1.0.

msmollin avatar May 24 '17 16:05 msmollin