Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ jobs:
run: ./gradlew -PisRelease=true :android-kit-base:testRelease
- name: "Run Kit Release Tests and Build"
run: ./gradlew -PisRelease=true -p kits testRelease -c ../settings-kits.gradle
- name: "Run Isolated Kit Compatibility Tests (urbanairship-kit)"
working-directory: kits/urbanairship-kit
- name: "Run Isolated Kit Compatibility Tests (urbanairship)"
working-directory: kits/urbanairship/urbanairship-20
run: ./gradlew -PisRelease=true testRelease

automerge-dependabot:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
[submodule "kits/tune-kit"]
path = kits/tune-kit
url = git@github.com:mParticle-integrations/mparticle-android-integration-tune.git
[submodule "kits/urbanairship-kit"]
path = kits/urbanairship-kit
url = git@github.com:mparticle-integrations/mparticle-android-integration-urbanairship.git
[submodule "kits/wootric-kit"]
path = kits/wootric-kit
url = git@github.com:mParticle-integrations/mparticle-android-integration-wootric.git
2 changes: 2 additions & 0 deletions .mobsf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- webview_javascript_interface # Intentional: JS bridge for mParticle WebView SDK; workspace token controls access
- android_manifest_insecure_minsdk_error # Example apps; SDK minSdk 14+ per AGENTS.md
- android_manifest_allow_backup # Example apps only; acceptable for demo/debug
- android_manifest_missing_explicit_allow_backup # Kit lib manifests; allowBackup not applicable
- android_task_hijacking1 # Sample apps; acceptable for demo
- hardcoded_api_key
- hardcoded_username
- android_kotlin_hardcoded
Expand Down
1 change: 1 addition & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ lint:
- kits/radar/radar-3/**
- kits/rokt/rokt/**
- kits/singular/singular-12/**
- kits/urbanairship/urbanairship-20/**
actions:
enabled:
- trunk-announce
Expand Down
8 changes: 4 additions & 4 deletions ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ Kotlin version.

**Currently isolated:**

- `urbanairship-kit` (Kotlin 2.2.x, `urbanairship-core:20.3.0`)
- `kits/urbanairship/urbanairship-20` (Kotlin 2.2.x, `urbanairship-core:20.3.0`)

To build an isolated kit after publishing core to mavenLocal:

```bash
cd kits/urbanairship-kit
cd kits/urbanairship/urbanairship-20
./gradlew testRelease publishReleaseLocal
```

Expand All @@ -165,13 +165,13 @@ To verify all kits (main + isolated):
```bash
./gradlew -PisRelease=true publishReleaseLocal
./gradlew -PisRelease=true testRelease publishReleaseLocal -c settings-kits.gradle
cd kits/urbanairship-kit && ./gradlew -PisRelease=true testRelease
cd kits/urbanairship/urbanairship-20 && ./gradlew -PisRelease=true testRelease
```

**Adding a new isolated kit:** If a kit upgrades to a Kotlin version
incompatible with the root KGP (2.0.20), remove it from
`settings-kits.gradle` with a comment, and add standalone build steps
to the CI workflows following the urbanairship-kit pattern.
to the CI workflows following the urbanairship pattern.

## Read More

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class IterableKit :
).onFailure(
object : Future.FailureCallback {
override fun onFailure(throwable: Throwable?) {
Log.e(ITERABLE_KIT_ERROR_TAG, ITERABLE_KIT_ERROR_MESSAGE, throwable)
Log.e(ITERABLE_KIT_ERROR_TAG, ITERABLE_KIT_ERROR_MESSAGE)
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import org.junit.Before
import org.junit.Test
import org.mockito.Mockito
import java.util.HashMap
import java.util.Random
import java.util.UUID

class OptimizelyKitTests {
Expand Down Expand Up @@ -111,7 +110,7 @@ class OptimizelyKitTests {
.addProduct(product2)
.addProduct(product3)
.build()
val mpid = Random().nextLong()
val mpid = randomUtils.randomLong(1, Long.MAX_VALUE)
val customerId = randomUtils.getAlphaNumericString(20)
val email = randomUtils.getAlphaNumericString(10)
val identities: MutableMap<IdentityType, String> = HashMap()
Expand Down
1 change: 0 additions & 1 deletion kits/urbanairship-kit
Submodule urbanairship-kit deleted from ec958f
9 changes: 9 additions & 0 deletions kits/urbanairship/urbanairship-20/PushSample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
36 changes: 36 additions & 0 deletions kits/urbanairship/urbanairship-20/PushSample/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apply plugin: 'com.android.application'

android {
buildToolsVersion "26.0.2"
compileSdkVersion 27
defaultConfig {
applicationId "com.mparticle.kits.pushsample"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.mparticle:android-urbanairship-kit:5+'

implementation 'com.google.firebase:firebase-messaging:15.0.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'

androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})

testImplementation 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
*
* Replace this with the real google-services.json from your project, available in the Firebase console
*
**/
{
"project_info": {
"project_number": "12345sample54321",
"firebase_url": "https://sample.sampe.com",
"project_id": "sampleprojectid",
"storage_bucket": "sample.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:12345:android:12345",
"android_client_info": {
"package_name": "com.mparticle.kits.pushsample"
}
},
"oauth_client": [
{
"client_id": "12345sample54321.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "12345sample54321.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "ABcdEFghIJ_k12345LMmnp6789"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/wpassidomo/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.mparticle.kits.pushsample">

<application
android:name=".SamplePushApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity

Check warning on line 13 in kits/urbanairship/urbanairship-20/PushSample/app/src/main/AndroidManifest.xml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Mark this component as exported.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-android-sdk&issues=AZzeD3T9ODK20i_YHuWB&open=AZzeD3T9ODK20i_YHuWB&pullRequest=673
android:name="com.mparticle.kits.pushsample.MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.mparticle.MPReceiver"

Check warning on line 24 in kits/urbanairship/urbanairship-20/PushSample/app/src/main/AndroidManifest.xml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Mark this component as exported.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-android-sdk&issues=AZzeD3T9ODK20i_YHuWC&open=AZzeD3T9ODK20i_YHuWC&pullRequest=673
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Use your package name as the category -->
<category android:name="com.mparticle.kits.pushsample" />
</intent-filter>
</receiver>

<service android:name="com.mparticle.MPService" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mparticle.kits.pushsample;

import android.os.Bundle;
import android.os.PersistableBundle;
import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
setContentView(R.layout.activity_main);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.mparticle.kits.pushsample;

import android.app.Application;

import com.mparticle.MParticle;

public class SamplePushApplication extends Application {

@Override
public void onCreate() {
super.onCreate();
MParticle.start(this, "{YOUR_APP_KEY}", "{YOUR_APP_SECRET}");
MParticle
.getInstance()
.Messaging()
.enablePushNotifications("{YOUR_SENDER_ID}");

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/hello"
android:textColor="@android:color/darker_gray"
android:textSize="36sp"/>
</LinearLayout>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">PushSample</string>
<string name="hello">Hello,\nsend me a push notification</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>
23 changes: 23 additions & 0 deletions kits/urbanairship/urbanairship-20/PushSample/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.1.2'
}
}

allprojects {
repositories {
mavenCentral()
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
17 changes: 17 additions & 0 deletions kits/urbanairship/urbanairship-20/PushSample/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Tue Mar 27 14:05:57 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Loading
Loading