KeenClient-iOS icon indicating copy to clipboard operation
KeenClient-iOS copied to clipboard

Crash with a blank read key

Open hallee opened this issue 7 years ago • 1 comments

KeenClient v3.6.1 crashes with a blank read key, with the error 'KeenNoWriteKeyProvided', reason: 'You tried to add an event without setting a write key, please set one!

This is after setting up the shared client with KeenClient.sharedClient(withProjectID: "xxxxxx", andWriteKey: "xxxxxx", andReadKey: "") in Swift.

Using any String (even a single letter) for andReadKey prevents the crash. andReadKey should really be optional and default to nil since it's not required to send events.

hallee avatar May 30 '17 20:05 hallee

Thanks for reporting the issue, @hallee!

I'm trying to repro the issue and I'm not having much luck, maybe you can help me.

If I try to initialize the shared client with KeenClient.sharedClient(withProjectID: "xxxxxx", andWriteKey: "xxxxxx", andReadKey: ""), I get an error message E:Your readKey cannot be an empty string. with a nil value returned from sharedClient....

Could you provide a short snippet I could run to reproduce the exception?

baumatron avatar May 30 '17 21:05 baumatron