matomo-org / matomo-sdk-ios

Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
MIT License
390 stars 164 forks source link

Is this validation necessary? #406

Closed tomopy03 closed 2 years ago

tomopy03 commented 2 years ago

This validation is inconvenient if you want to specify URLs other than matomo.php and piwik.php. This validation does not exist in the SDK for Android, and is probably unnecessary.

https://github.com/matomo-org/matomo-sdk-ios/blob/cea4a1cfcb05d49c5745801e05fff1cfed7a14e3/MatomoTracker/MatomoTracker.swift#L118-L120

brototyp commented 2 years ago

Hi @tomopy03,

thanks a lot for your questions. You are totally correct. The assertion is not necessary. It is merely meant as a safeguard. Most users probably don't want to specify URL's that don't end in either of those and if the do it means no events are tracked.

If you want to define a URL that doesn't end in either of those, you could initialize the MatomoTracker using init(siteId:queue:dispatcher:). Would that solve your problem?

tomopy03 commented 2 years ago

@brototyp

Thank you so much! My problem is solved.