react-native-matomo icon indicating copy to clipboard operation
react-native-matomo copied to clipboard

piwik is dead

Open thegdznet opened this issue 3 years ago • 3 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

As piwik is now matomo, it is better to remove this assert.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-matomo/ios/MatomoTracker/MatomoTracker.swift b/node_modules/react-native-matomo/ios/MatomoTracker/MatomoTracker.swift
index 1b4fca8..baaa2c0 100755
--- a/node_modules/react-native-matomo/ios/MatomoTracker/MatomoTracker.swift
+++ b/node_modules/react-native-matomo/ios/MatomoTracker/MatomoTracker.swift
@@ -115,7 +115,7 @@ final public class MatomoTracker: NSObject {
     ///   - baseURL: The url of the Matomo server. This url has to end in `piwik.php`.
     ///   - userAgent: An optional parameter for custom user agent.
     @objc convenience public init(siteId: String, baseURL: URL, userAgent: String? = nil) {
-        assert(baseURL.absoluteString.hasSuffix("piwik.php"), "The baseURL is expected to end in piwik.php")
+        //assert(baseURL.absoluteString.hasSuffix("piwik.php"), "The baseURL is expected to end in piwik.php")
         
         let queue = MemoryQueue()
         let dispatcher = URLSessionDispatcher(baseURL: baseURL, userAgent: userAgent)

This issue body was partially generated by patch-package.

thegdznet avatar Jun 10 '21 17:06 thegdznet

as a temporary workaround you can add a fake parameter to the URL https://xxxxxxxxxxxxxx/matomo.php?fakeParam=piwik.php

KristiyanHristov avatar Oct 04 '21 07:10 KristiyanHristov

Hi!

Many thanx for the answer. Will think about Your workaround.

thegdznet avatar Oct 04 '21 12:10 thegdznet

bump is there a chance we'll get https://github.com/BonifyByForteil/react-native-matomo/pull/67/files merged soon, and an update out?

rachoac avatar Dec 14 '21 04:12 rachoac