Giter Site home page Giter Site logo

piwikpro / react-native-piwik-pro-sdk Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 10.0 5 MB

Piwik PRO SDK for React Native

License: MIT License

Shell 0.10% Kotlin 14.67% JavaScript 0.98% Java 4.25% TypeScript 54.78% Swift 0.04% C 0.07% Objective-C 24.49% Ruby 0.62%

react-native-piwik-pro-sdk's Introduction

Piwik

This is the last snapshot of open source Piwik PRO, it's no longer maintained, so please don't use it. We've migrated to a new, proprietary platform, its cloud "Core" version is available for free here.

Description

Piwik is the leading Free/Libre open analytics platform.

Piwik is a full featured PHP MySQL software program that you download and install on your own webserver. At the end of the five minute installation process you will be given a JavaScript code. Simply copy and paste this tag on websites you wish to track and access your analytics reports in real time.

Piwik aims to be a Free software alternative to Google Analytics, and is already used on more than 1,000,000 websites. Privacy is built-in!

Mission Statement

« To create, as a community, the leading international Free/Libre web analytics platform, providing access to all functionality through open components and open APIs. »

Or in short:

« Liberate Web Analytics »

License

Piwik is released under the GPL v3 (or later) license, see misc/gpl-3.0.txt

Requirements

  • PHP 5.5.9 or greater
  • MySQL version 5.5 or greater, or MariaDB
  • PHP extension pdo and pdo_mysql, or the MySQLi extension.
  • Piwik is OS / server independent

Install

  • Upload piwik to your webserver
  • Point your browser to the directory
  • Follow the steps
  • Add the given javascript code to your pages
  • (You may also generate fake data to experiment, by enabling the plugin VisitorGenerator)

Quality Assurance

The Piwik project uses an ever-expanding comprehensive set of thousands of unit tests and hundreds of automated integration tests, system tests, JavaScript tests, and screenshot UI tests, running on a continuous integration server as part of its software quality assurance.

We use BrowserStack.com testing tool to help check the Piwik user interface is compatible with many browsers.

Security

Security is a top priority at Piwik. As potential issues are discovered, we validate, patch and release fixes as quickly as we can. We have a security bug bounty program in place that rewards researchers for finding security issues and disclosing them to us.

react-native-piwik-pro-sdk's People

Contributors

4teko7 avatar actions-user avatar cweise avatar danieltwork avatar fbogatko avatar mandrzej avatar mmalczewski avatar romansek avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-piwik-pro-sdk's Issues

Incompatible pointer error

Hello, I am currently getting the following error when building my app:

Bildschirmfoto 2022-12-22 um 11 54 34

Can anyone assist with this? Thank you very much!

TypeScript: typing not working and not available

Implementing the SDK for a client, I run into the following issue, which I believe to be a bug.

Version
1.0.7

Description
Type inference is broken when using PiwikProSdk. Importing types is not possible.

To reproduce
Install 1.0.7 in any TS project and import PiwikProSdk in a .ts file. Then call any method, e.g. await PiwikProSdk.init( //.... This will show a typing error. The reason is that although PiwikProSdk (the default export) has the type PiwikProSdkType, that type is not declared correctly and is essentially any.

Expected behaviour

  1. type inference is working correctly
  2. the available types (src/index.d.tsx) can be imported when consuming this package

Notes
If I open node_modules/@piwikpro/react-native-piwik-pro-sdk/src/index.tsx, the typing is broken there already. File index.d.tsx is not a correct declaration file and index.tsx is not correctly typed to start with. Perhaps with that fix, the build script will genererate the ts files correctly.

Thank you!

Edit: adding example repo. To reproduce, clone https://github.com/SpreadTriad/piwik-typing-repro and open in IDE with typescript validation on.

Android build error Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher on React-Native 0.71.3 targeting Android API 33.

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':piwikpro_react-native-piwik-pro-sdk' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

"react": "18.2.0",
"react-native": "0.71.3"

Gradle:
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33

`trackCustomEvent` throws error on Android if `options.value` not specified

I'm using trackCustomEvent with an options arg that contains only customDimensions. This works fine on iOS, but throws an error on Android.

As a workaround, supplying options.value as 0 prevents the error coming from the getDouble call.

Full error:

{
  "nativeStackAndroid": [
    {
      "methodName": "getValue",
      "lineNumber": 110,
      "file": "ReadableNativeMap.java",
      "class": "com.facebook.react.bridge.ReadableNativeMap"
    },
    {
      "methodName": "getValue",
      "lineNumber": 114,
      "file": "ReadableNativeMap.java",
      "class": "com.facebook.react.bridge.ReadableNativeMap"
    },
    {
      "methodName": "getDouble",
      "lineNumber": 151,
      "file": "ReadableNativeMap.java",
      "class": "com.facebook.react.bridge.ReadableNativeMap"
    },
    {
      "methodName": "trackCustomEvent",
      "lineNumber": 73,
      "file": "PiwikProSdkModule.kt",
      "class": "com.reactnativepiwikprosdk.PiwikProSdkModule"
    },
    {
      "methodName": "invoke",
      "lineNumber": -2,
      "file": "Method.java",
      "class": "java.lang.reflect.Method"
    },
    {
      "methodName": "invoke",
      "lineNumber": 372,
      "file": "JavaMethodWrapper.java",
      "class": "com.facebook.react.bridge.JavaMethodWrapper"
    },
    {
      "methodName": "invoke",
      "lineNumber": 151,
      "file": "JavaModuleWrapper.java",
      "class": "com.facebook.react.bridge.JavaModuleWrapper"
    },
    {
      "methodName": "run",
      "lineNumber": -2,
      "file": "NativeRunnable.java",
      "class": "com.facebook.react.bridge.queue.NativeRunnable"
    },
    {
      "methodName": "handleCallback",
      "lineNumber": 938,
      "file": "Handler.java",
      "class": "android.os.Handler"
    },
    {
      "methodName": "dispatchMessage",
      "lineNumber": 99,
      "file": "Handler.java",
      "class": "android.os.Handler"
    },
    {
      "methodName": "dispatchMessage",
      "lineNumber": 27,
      "file": "MessageQueueThreadHandler.java",
      "class": "com.facebook.react.bridge.queue.MessageQueueThreadHandler"
    },
    {
      "methodName": "loop",
      "lineNumber": 223,
      "file": "Looper.java",
      "class": "android.os.Looper"
    },
    {
      "methodName": "run",
      "lineNumber": 226,
      "file": "MessageQueueThreadImpl.java",
      "class": "com.facebook.react.bridge.queue.MessageQueueThreadImpl$4"
    },
    {
      "methodName": "run",
      "lineNumber": 923,
      "file": "Thread.java",
      "class": "java.lang.Thread"
    }
  ],
  "userInfo": null,
  "message": "value",
  "code": "EUNSPECIFIED",
  "line": 2957,
  "column": 45,
  "sourceURL": "http://10.0.2.2:19000/index.bundle?platform=android&dev=true&minify=false&app=com.test.app&modulesOnly=false&runModule=true"
}

Crash when updating to React Native 0.71.1 and to @piwikpro/react-native-piwik-pro-sdk

I am having two issues upgrading my app to React Native 0.71.1 and to @piwikpro/react-native-piwik-pro-sdk.

The first one is related to iOS. The build process crashes with the following errors I see from Xcode:
error build: No visible @interface for 'PiwikTracker' declares the selector 'sendExceptionWithDescription:isFatal:' error build: No visible @interface for 'PiwikTracker' declares the selector 'sendSocialInteractionWithAction:target:network:' error build: Implicit conversion of 'int' to 'NSString * _Nonnull' is disallowed with ARC

The second one is related to Android. The app builds but as soon as is launched I see “The app keeps stopping” on the emulator and these errors on Android Studio:

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.scaledolore7, PID: 15270
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:415)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
at java.util.concurrent.FutureTask.run(FutureTask.java:269)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;
at pro.piwik.sdk.Tracker$1.doInBackground(Tracker.java:311)
at pro.piwik.sdk.Tracker$1.doInBackground(Tracker.java:306)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.identifier.AdvertisingIdClient" on path: DexPathList[[zip file "/data/app/~~Tse-gpUYzVIT2rvIu7yLXA==/com.scaledolore7-qOI8VH2UxAznHh3o3ODAlQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~Tse-gpUYzVIT2rvIu7yLXA==/com.scaledolore7-qOI8VH2UxAznHh3o3ODAlQ==/lib/x86_64, /data/app/~~Tse-gpUYzVIT2rvIu7yLXA==/com.scaledolore7-qOI8VH2UxAznHh3o3ODAlQ==/base.apk!/lib/x86_64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at pro.piwik.sdk.Tracker$1.doInBackground(Tracker.java:311)
at pro.piwik.sdk.Tracker$1.doInBackground(Tracker.java:306)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)

implicit conversion of 'int' to 'NSString * _Nonnull' is disallowed with ARC

When building my app using the latest version of this sdk (1.0.3), I get the following error:

❌  (node_modules/@piwikpro/react-native-piwik-pro-sdk/ios/PiwikProSdk.m:256:55)

  254 |         [self applyOptionalParameters:options];
  255 |         
> 256 |         [[PiwikTracker sharedInstance] sendGoalWithID:[goal intValue] revenue:options[@"revenue"]];
      |                                                       ^ implicit conversion of 'int' to 'NSString * _Nonnull' is disallowed with ARC
  257 |         resolve(nil);
  258 |     } @catch (NSException *exception) {
  259 |         reject(exception.name, exception.reason, nil);

For context, this is an Expo app (on SDK 44). The app was previously built using an older version (0.3.2), but attempting a rebuild today failed with a similar error to the one above.

process is not defined

I am getting an error using react

Uncaught ReferenceError: process is not defined
    <anonymous> index.ts:34

line 34

export const IS_DEBUG = process.env.DEBUG || process.env.NODE_ENV === 'development';

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.