From d57d8fa81bf245f979c0cc4df9e0bb725dc920d2 Mon Sep 17 00:00:00 2001 From: Sadaqat Ali Date: Tue, 9 Aug 2022 17:06:28 +0500 Subject: [PATCH 1/2] removed matomo usage --- .../posts/container/postsContainer.js | 18 ------------------ .../profile/children/commentsTabContent.tsx | 8 -------- .../tabbedPosts/services/tabbedPostsFetch.ts | 18 ------------------ src/containers/profileContainer.js | 18 ------------------ .../container/applicationContainer.tsx | 18 ------------------ src/screens/post/container/postContainer.js | 15 --------------- 6 files changed, 95 deletions(-) diff --git a/src/components/posts/container/postsContainer.js b/src/components/posts/container/postsContainer.js index 2c87a9082..31f69fbc7 100644 --- a/src/components/posts/container/postsContainer.js +++ b/src/components/posts/container/postsContainer.js @@ -2,7 +2,6 @@ import React, { useState, useEffect, useRef, useReducer } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { get, isEmpty } from 'lodash'; import unionBy from 'lodash/unionBy'; -import Matomo from 'react-native-matomo-sdk'; import { useIntl } from 'react-intl'; import { Alert, AppState } from 'react-native'; @@ -656,23 +655,6 @@ const PostsContainer = ({ }, }); } - - // track filter and tag views - if (isAnalytics) { - if (tag) { - Matomo.trackView([`/${selectedFilterValue}/${tag}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } else if (selectedFilterValue === 'feed') { - Matomo.trackView([`/@${feedUsername}/${selectedFilterValue}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } else { - Matomo.trackView([`/${selectedFilterValue}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } - } }; const _handleOnRefreshPosts = () => { diff --git a/src/components/profile/children/commentsTabContent.tsx b/src/components/profile/children/commentsTabContent.tsx index a47622e49..897694387 100644 --- a/src/components/profile/children/commentsTabContent.tsx +++ b/src/components/profile/children/commentsTabContent.tsx @@ -5,7 +5,6 @@ import { Comments, NoPost } from '../..'; import { useAppSelector } from '../../../hooks'; import { getAccountPosts } from '../../../providers/hive/dhive'; import styles from '../profileStyles'; -import Matomo from 'react-native-matomo-sdk'; import {unionBy } from 'lodash'; interface CommentsTabContentProps { @@ -57,13 +56,6 @@ const CommentsTabContent = ({isOwnProfile, username, type, onScroll, selectedUse sort:type }; - - if (isAnalytics && selectedUser.user) { - Matomo.trackView([`/@${selectedUser.name}/${type}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } - const result = await getAccountPosts(query) let _comments:any[] = refresh ? result : unionBy(data, result, 'permlink'); diff --git a/src/components/tabbedPosts/services/tabbedPostsFetch.ts b/src/components/tabbedPosts/services/tabbedPostsFetch.ts index 27950e5d9..2a80f1306 100644 --- a/src/components/tabbedPosts/services/tabbedPostsFetch.ts +++ b/src/components/tabbedPosts/services/tabbedPostsFetch.ts @@ -1,6 +1,5 @@ import { getAccountPosts, getPost, getRankedPosts } from "../../../providers/hive/dhive"; import { filterLatestPosts, getUpdatedPosts } from "./tabbedPostsHelpers"; -import Matomo from 'react-native-matomo-sdk'; import { LoadPostsOptions } from "./tabbedPostsModels"; import { getPromotedEntries } from "../../../providers/ecency/ecency"; @@ -179,23 +178,6 @@ export const loadPosts = async ({ isRefreshing:false, }) } - - // track filter and tag views - if (isAnalytics) { - if (tag) { - Matomo.trackView([`/${filter}/${tag}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } else if (filter === 'friends' || filter === 'communities') { - Matomo.trackView([`/@${feedUsername}/${filter}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } else { - Matomo.trackView([`/${filter}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } - } }; diff --git a/src/containers/profileContainer.js b/src/containers/profileContainer.js index 78d444830..fac6afb38 100644 --- a/src/containers/profileContainer.js +++ b/src/containers/profileContainer.js @@ -5,7 +5,6 @@ import { withNavigation } from 'react-navigation'; import { get, has, unionBy, update } from 'lodash'; import { Alert } from 'react-native'; import { injectIntl } from 'react-intl'; -import Matomo from 'react-native-matomo-sdk'; // Providers import { @@ -88,11 +87,6 @@ class ProfileContainer extends Component { } this._loadProfile(targetUsername); - if (isAnalytics) { - Matomo.trackView([`/@${targetUsername}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } } _getReplies = async (query) => { @@ -116,12 +110,6 @@ class ProfileContainer extends Component { query.observer = ''; query.sort = 'comments'; } - - if (isAnalytics && user) { - Matomo.trackView([`/@${user.name}/comments`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } } else { repliesAction = getAccountPosts; if (query) { @@ -134,12 +122,6 @@ class ProfileContainer extends Component { query.observer = ''; query.sort = 'replies'; } - - if (isAnalytics) { - Matomo.trackView([`/@${currentAccountUsername}/replies`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } } if (query) { diff --git a/src/screens/application/container/applicationContainer.tsx b/src/screens/application/container/applicationContainer.tsx index 4622ce651..acba6198d 100644 --- a/src/screens/application/container/applicationContainer.tsx +++ b/src/screens/application/container/applicationContainer.tsx @@ -14,7 +14,6 @@ import messaging from '@react-native-firebase/messaging'; import PushNotification from 'react-native-push-notification'; import VersionNumber from 'react-native-version-number'; import ReceiveSharingIntent from 'react-native-receive-sharing-intent'; -import Matomo from 'react-native-matomo-sdk'; import SplashScreen from 'react-native-splash-screen' // Constants @@ -159,23 +158,6 @@ class ApplicationContainer extends Component { console.log('error :>> ', error); }, ); - - // tracking init - if (!__DEV__) { - Matomo.initialize(Config.ANALYTICS_URL, 1, 'https://ecency.com') - .catch((error) => console.warn('Failed to initialize matomo', error)) - .then(() => { - if (isAnalytics !== true) { - dispatch(setAnalyticsStatus(true)); - } - }) - .then(() => { - // start up event - Matomo.trackEvent('Application', 'Startup').catch((error) => - console.warn('Failed to track event', error), - ); - }); - } }; componentDidUpdate(prevProps, prevState) { diff --git a/src/screens/post/container/postContainer.js b/src/screens/post/container/postContainer.js index 579f331a1..2cdda6f40 100644 --- a/src/screens/post/container/postContainer.js +++ b/src/screens/post/container/postContainer.js @@ -4,10 +4,8 @@ import { withNavigation } from 'react-navigation'; import get from 'lodash/get'; // Services and Actions -import Matomo from 'react-native-matomo-sdk'; import Orientation, { useDeviceOrientationChange } from 'react-native-orientation-locker'; import { getPost } from '../../../providers/hive/dhive'; -// import { matomo } from '../../../providers/ecency/analytics'; // Component import PostScreen from '../screen/postScreen'; @@ -58,22 +56,9 @@ const PostContainer = ({ navigation, currentAccount, isLoggedIn, isAnalytics }) } else { setPost(content); } - // tracking info - if (isAnalytics) { - Matomo.trackView([`${content.url}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } } else if (_author && permlink) { _loadPost(_author, permlink); author = _author; - - // tracking info - if (isAnalytics) { - Matomo.trackView([`/post/@${_author}/${permlink}`]).catch((error) => - console.warn('Failed to track screen', error), - ); - } } }, []); From ce749b9bf5b22367d38587b8373a6cf06eaa58c5 Mon Sep 17 00:00:00 2001 From: Sadaqat Ali Date: Tue, 9 Aug 2022 17:23:05 +0500 Subject: [PATCH 2/2] removed matomo from package.json and build.gradle --- android/build.gradle | 1 - ios/Podfile.lock | 12 ------------ package.json | 1 - yarn.lock | 4 ---- 4 files changed, 18 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 18115dae5..a139a8bdb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -62,7 +62,6 @@ allprojects { includeGroup("com.facebook.yoga") includeGroup("com.facebook.fbjni") includeGroup("com.henninghall.android") - includeGroup("org.matomo.sdk") includeModule("com.yqritc", "android-scalablevideoview") includeModule("com.wei.android.lib", "fingerprintidentify") } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 203d3ade7..9161cfe47 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -153,9 +153,6 @@ PODS: - lottie-react-native (5.1.3): - lottie-ios (~> 3.2.3) - React-Core - - MatomoTracker (7.4.1): - - MatomoTracker/Core (= 7.4.1) - - MatomoTracker/Core (7.4.1) - nanopb (2.30908.0): - nanopb/decode (= 2.30908.0) - nanopb/encode (= 2.30908.0) @@ -348,9 +345,6 @@ PODS: - React-Core - react-native-fingerprint-scanner (6.0.0): - React - - react-native-matomo-sdk (0.4.1): - - MatomoTracker (~> 7) - - React (~> 0.60) - react-native-netinfo (5.9.10): - React-Core - react-native-orientation-locker (1.4.0): @@ -533,7 +527,6 @@ DEPENDENCIES: - react-native-config (from `../node_modules/react-native-config`) - react-native-date-picker (from `../node_modules/react-native-date-picker`) - react-native-fingerprint-scanner (from `../node_modules/react-native-fingerprint-scanner`) - - react-native-matomo-sdk (from `../node_modules/react-native-matomo-sdk`) - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-orientation-locker (from `../node_modules/react-native-orientation-locker`) - react-native-randombytes (from `../node_modules/react-native-randombytes`) @@ -593,7 +586,6 @@ SPEC REPOS: - GoogleDataTransport - GoogleUtilities - libwebp - - MatomoTracker - nanopb - PromisesObjC - SDWebImage @@ -657,8 +649,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-date-picker" react-native-fingerprint-scanner: :path: "../node_modules/react-native-fingerprint-scanner" - react-native-matomo-sdk: - :path: "../node_modules/react-native-matomo-sdk" react-native-netinfo: :path: "../node_modules/@react-native-community/netinfo" react-native-orientation-locker: @@ -771,7 +761,6 @@ SPEC CHECKSUMS: libwebp: e90b9c01d99205d03b6bb8f2c8c415e5a4ef66f0 lottie-ios: c058aeafa76daa4cf64d773554bccc8385d0150e lottie-react-native: a501112fa980529ccb80b9f3ee117a7f98c6af3a - MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 Permission-Camera: 597646618d1edcc055a3f660844c2ee6de8e0596 PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72 @@ -790,7 +779,6 @@ SPEC CHECKSUMS: react-native-config: c98128a72bc2c3a1ca72caec0b021f0fa944aa29 react-native-date-picker: d83ab9cccbc497642a93fdca783ae76ecd6b17b6 react-native-fingerprint-scanner: ac6656f18c8e45a7459302b84da41a44ad96dbbe - react-native-matomo-sdk: 025c54f92e1e26a4d0acee7c3f28cb0fc7e4729c react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-orientation-locker: 2da91e5391971dace445495821c899c111dcad7a react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846 diff --git a/package.json b/package.json index bf166d13c..4c8eee304 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,6 @@ "react-native-keyboard-aware-scroll-view": "^0.9.1", "react-native-level-fs": "^3.0.0", "react-native-linear-gradient": "^2.4.2", - "react-native-matomo-sdk": "feruzm/react-native-matomo-sdk", "react-native-media-controls": "^2.3.0", "react-native-modal": "11.5.6", "react-native-modal-dropdown": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index 1b30c18a4..a66a6299c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8865,10 +8865,6 @@ react-native-linear-gradient@^2.4.2: resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.5.6.tgz#96215cbc5ec7a01247a20890888aa75b834d44a0" integrity sha512-HDwEaXcQIuXXCV70O+bK1rizFong3wj+5Q/jSyifKFLg0VWF95xh8XQgfzXwtq0NggL9vNjPKXa016KuFu+VFg== -react-native-matomo-sdk@feruzm/react-native-matomo-sdk: - version "0.4.1" - resolved "https://codeload.github.com/feruzm/react-native-matomo-sdk/tar.gz/392b1cfca771b28005821ef909ffb9a2082156d9" - react-native-media-controls@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/react-native-media-controls/-/react-native-media-controls-2.3.0.tgz#c36e876a14d12982b7c6fb759201ff439117cbd0"