Giter Site home page Giter Site logo

mapp-digital / mapp-intelligence-android-sdk-v5 Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 2.0 9.28 MB

Webtrekk Android SDK V5

Home Page: https://www.webtrekk.com/

License: MIT License

Kotlin 96.56% Java 3.44%
analytics android android-architecture android-library android-sdk coroutines kotlin okhttp3 room workmanager

mapp-intelligence-android-sdk-v5's People

Contributors

acamarinkovic avatar neno0o avatar semsudin-tafilovic avatar stellatores avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mapp-intelligence-android-sdk-v5's Issues

About SDK Upgrade and Impresion Counts

Hi, is there any releated case for impression counts between sdk upgrade. we upgraded our sdk to 5.1.5 from 5.1.1 and we did not changed anything else. but our impressions are going down about %60 in android.

Analytics on platform is shown as package.label

Hi there ,i am facing an issue where my traces are displayed on console as application package + analytics label. I Would like only label to be displayed.
I am quite sure i am not appending the package anywhere.
Trace appears in the following example format :

com.example.mApplication.Trace01.

Is there any way to omit the package to be displayed on the console? Thanks

Could not find org.koin:koin-android:2.1.5.

Describe the bug
After including the newest version (5.0.8) in our dependencies block (dependencies { implementation 'com.mapp.sdk:intelligence-android:5.0.8' }) we get the following error during a Gradle build:

> Could not resolve all files for configuration ':****'.
   > Could not find org.koin:koin-android:2.1.5.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/koin/koin-android/2.1.5/koin-android-2.1.5.pom
       - https://repo.maven.apache.org/maven2/org/koin/koin-android/2.1.5/koin-android-2.1.5.pom
       - https://jitpack.io/org/koin/koin-android/2.1.5/koin-android-2.1.5.pom
     Required by:
         project :APAWLApp > com.mapp.sdk:intelligence-android:5.0.8

According to the error, the above mentioned koin version cannot be found on maven central.

The developers of koin recently changed the maven central group id from org.koin to io.insert-koin [1] so this build error probably results from the renaming.

[1]: https://github.com/InsertKoinIO/koin#maven-central, 21.05.2021, HEAD d9fdc2266d03ac64c6e7c3946046a052993d8dae

[Documentation Deprecated] Android Deep Linking

Hello,

the Documentation on
https://documentation.mapp.com/1.0/en/deep-linking-19104150.html

is deprecated.

It shows to use:

val intent = intent
        val data = intent.data
   
        val mc = data?.getQueryParameter("wt_mc")
           
        val trackingParams = TrackingParams()
        trackingParams.putAll(
            mapOf(
                Param.MEDIA_CODE to mc!!
            )
        )
Webtrekk.getInstance().trackCustomEvent("Event Name", trackingParams)

For DeepLink Tracking but Param.MEDIA_CODE is deprecated.

Usually we track Custom Params the following:

 val customParam = customParam(ParamType.CAMPAIGN_PARAM, ??)
trackingParams[customParam] = detail.value

But here i am missing the Int value where i wrote ?? because i don't know what to use for wt_mc.

And when using the trackUrl method i cannot add other parameters.

NoClassDefFoundError with Koin 3.1.2 & Webtrekk 5.1.0

Our app crashes with following example configuration. The same behavior occurs in our live app.

build.gradle

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example"
        minSdkVersion 23
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
	implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
	implementation 'androidx.core:core-ktx:1.6.0'
	implementation 'androidx.appcompat:appcompat:1.3.0'
	implementation 'com.google.android.material:material:1.4.0'
	implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
	testImplementation 'junit:junit:4.+'
	androidTestImplementation 'androidx.test.ext:junit:1.1.3'
	androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
	
	
	implementation 'com.mapp.sdk:intelligence-android:5.1.0'
	implementation "io.insert-koin:koin-android:3.1.2"
}

MainActivity

package com.example.webtrekk

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import webtrekk.android.sdk.Logger
import webtrekk.android.sdk.Webtrekk
import webtrekk.android.sdk.WebtrekkConfiguration

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val webtrekkConfiguration = WebtrekkConfiguration
            .Builder(
                trackDomain = MY_TRACK_DOMAIN,
                trackIds = MY_TRACK_IDS
            )
            .disableActivityAutoTracking()
            .disableAutoTracking()
            .disableFragmentsAutoTracking()
            .logLevel(Logger.Level.BASIC)
            .build()

        Webtrekk.getInstance().init(this, webtrekkConfiguration)
    }

    companion object {
        val MY_TRACK_DOMAIN = ""
        val MY_TRACK_IDS = listOf<String>()
    }
}

Logcat output:

    java.lang.NoClassDefFoundError: Failed resolution of: Lwebtrekk/android/sdk/core/CustomKoinComponent;
        at webtrekk.android.sdk.Webtrekk.<clinit>(Unknown Source:0)
        at com.example.webtrekk.MainActivity.onCreate(MainActivity.kt:25)
        at android.app.Activity.performCreate(Activity.java:8086)
        at android.app.Activity.performCreate(Activity.java:8074)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:213)
        at android.app.ActivityThread.main(ActivityThread.java:8178)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
     Caused by: java.lang.ClassNotFoundException: webtrekk.android.sdk.core.CustomKoinComponent
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at webtrekk.android.sdk.Webtrekk.<clinit>(Unknown Source:0) 
        at com.example.webtrekk.MainActivity.onCreate(MainActivity.kt:25) 
        at android.app.Activity.performCreate(Activity.java:8086) 
        at android.app.Activity.performCreate(Activity.java:8074) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:213) 
        at android.app.ActivityThread.main(ActivityThread.java:8178) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/koin/core/KoinComponent;
        at webtrekk.android.sdk.Webtrekk.<clinit>(Unknown Source:0) 
        at com.example.webtrekk.MainActivity.onCreate(MainActivity.kt:25) 
        at android.app.Activity.performCreate(Activity.java:8086) 
        at android.app.Activity.performCreate(Activity.java:8074) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:213) 
        at android.app.ActivityThread.main(ActivityThread.java:8178) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.koin.core.KoinComponent" on path: DexPathList[[zip file "/data/app/com.example.webtrekk-FD0n8K6ogBrjNCzTm54dRg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.webtrekk-FD0n8K6ogBrjNCzTm54dRg==/lib/arm64, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at webtrekk.android.sdk.Webtrekk.<clinit>(Unknown Source:0) 
        at com.example.webtrekk.MainActivity.onCreate(MainActivity.kt:25) 
        at android.app.Activity.performCreate(Activity.java:8086) 
        at android.app.Activity.performCreate(Activity.java:8074) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:213) 
        at android.app.ActivityThread.main(ActivityThread.java:8178) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 

Certificate Error When Updating to 5.1.5.2

Hello,
We trying to update our project to 5.1.5.2 from 5.1.1. But we getting SSL certificate errors. Like;

Could not resolve com.mapp.sdk:intelligence-android:5.1.5.2. > Could not get resource 'https://oss.sonatype.org/content/repositories/snapshots/com/mapp/sdk/intelligence-android/5.1.5.2/intelligence-android-5.1.5.2.pom'. > Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/com/mapp/sdk/intelligence-android/5.1.5.2/intelligence-android-5.1.5.2.pom'. > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Is this causing by our project side, or is it from webtrekk side? Because we can update successfully to 5.1.5.1

No release notes for 5.1.4.1

Our dependency update tool reported about the 5.1.4.1 version of Webtrekk but there is no changelog nor release notes yet.

Is this a stable release or a SNAPSHOT?

[BUG] Webtrekk Sdk not working with target API Level 31 (Android 12)

Describe the bug
If the compileSdk and targetSdk is set to api level 31 (Android 12) the app that uses this SDK won't build anymore.
The build fails with the following error:

java.lang.IllegalArgumentException: <package_name>: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
   Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
       at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
       at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
       at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
       at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174)
       at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108)
       at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86)
       at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)

To Reproduce
Steps to reproduce the behavior:

  1. Set compileSdk and targetSdk to api level 31
  2. And add the latest webtrekk sdk
  3. Build your app

The Build is failing with the above error message.
It's because androidx.work:work-runtime dependency needs to be updated to 2.7.0, I think.

Smartphone (please complete the following information):

  • Device: Pixel 5
  • OS: Android 12 (API Level 31)
  • WebtrekkVersion 5.1.0.2

Additional context
I've did a test to force the usage of androidx.work:work-runtime:2.7.0 by adding the following snippet to the root build.gradle file:

allprojects {
    .
    .
    
    project.configurations.all {
        resolutionStrategy {
            force 'androidx.work:work-runtime:2.7.1'
        }
    }
}

You may have to include also 'androidx.work:work-runtime-ktx:2.7.1' or use 'androidx.core:core-ktx:1.7.0'
After that the build passed and I could start and use the app.
Not sure if that is all you need to support android 12 but it would be great to get a fix for this asap. :)

Hope it helps!

Best regards,

Josef

[BUG] A migration from 4 to 6 was required but not found issue with version 5.1.5

Describe the bug
After updating the mapp sdk to 5.1.5 we observed the following error from the logcat output:

E/webtrekk: 06.01.2023 14:36:14 -> Error getting the cached completed requests: java.lang.IllegalStateException: A migration from 4 to 6 was required but not found. Please provide the necessary Migration path via RoomDatabase.Builder.addMigration(Migration ...) or allow for destructive migrations via one of the RoomDatabase.Builder.fallbackToDestructiveMigration* methods.

This is not happening in version 5.1.3 and also not in 5.1.4.2

To Reproduce
Steps to reproduce the behavior:

  1. Update the mapp sdk to 5.1.5 and set logLevel to Basic (e.g. webtrekkConfigurationBuilder.logLevel(Logger.Level.BASIC))
  2. Start the app and observe logcat (you can filter for webtrekk)
  3. Use the app and at some point you'll see the error above

Smartphone (please complete the following information):

  • Device: Pixel 5
  • OS: Android 13
  • WebtrekkVersion 5.1.5

Additional context
This is not happening in version 5.1.3 and also not in 5.1.4.2

Activity Tracking still present even if disabled via Configuration

Describe the bug
In the tracking console, we see Activity tracking even if disableAutoTracking() is called on the Configuration Builder.

To Reproduce
Steps to reproduce the behavior:

  1. Build a Webtrekk Instance with the following config:
WebtrekkConfiguration
   .Builder(
      trackDomain = getTrackDomain(),
      trackIds = getTrackIds()
   )
   .disableAutoTracking()
   .enableMigration()   
   .logLevel(logLevel)
   .okHttpClient(okHttpClient)
   .setBatchSupport(true)
   .build()
  1. Start and run the app
  2. Check the logs in the Webtrekk console

Smartphone (please complete the following information):

  • Device: Several Android devices
  • OS: Android 8.0 -11
  • WebtrekkVersion: 5.1.1-beta1

Additional context
Please check webtrekk.android.sdk.core.AppStateImpl and webtrekk.android.sdk.module.InjectionModule.provideAppState(). TheAppState is missing where both Fragment and Activity tracking are suppressed.

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.