Skip to content

Commit

Permalink
[Release] Feature Notification- sub feature "Select Interest" "Receiv…
Browse files Browse the repository at this point in the history
…e Notification" "View Notification in App" "Open Link" #38

* release-note - [feature-notification] sub feature complete "Select Interest" "Receive Notification" "View Notification in App" "Open Link on Tap"

* release note - fixed app crash on subscribe in release build

* release-note - version - 1.3.1
  • Loading branch information
syedahmedjamil committed Jan 23, 2024
2 parents 7ae812f + 2ada17c commit 5f7afd3
Show file tree
Hide file tree
Showing 106 changed files with 2,138 additions and 487 deletions.
77 changes: 70 additions & 7 deletions .github/workflows/dev-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,46 @@ on:
- '.github/**'
- 'README.md'
branches: [ "dev" ]

workflow_dispatch:

jobs:
unit-test:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup JDK And Gradle
uses: ./.github/actions/setup-jdk-gradle
with:
cache-read-only: false

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Get Google Services Json
env:
CERTIFICATE_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON }}
Expand All @@ -36,15 +63,30 @@ jobs:

integration-test:
needs: [unit-test]
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup JDK And Gradle
uses: ./.github/actions/setup-jdk-gradle
with:
cache-read-only: false
cache-read-only: true

- name: AVD cache
uses: actions/cache/restore@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29

- name: Get Google Services Json
env:
Expand All @@ -69,15 +111,30 @@ jobs:

acceptance-test:
needs: [unit-test]
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup JDK And Gradle
uses: ./.github/actions/setup-jdk-gradle
with:
cache-read-only: false
cache-read-only: true

- name: AVD cache
uses: actions/cache/restore@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29

- name: Get Google Services Json
env:
Expand All @@ -102,10 +159,16 @@ jobs:

assemble-debug:
needs: [unit-test, integration-test, acceptance-test]
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup JDK And Gradle
uses: ./.github/actions/setup-jdk-gradle
Expand All @@ -125,4 +188,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: debug-apk
path: app/build/outputs/apk/debug/*.apk
path: app/build/outputs/apk/debug/*.apk
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Update
Updating app using clean architecture, acceptance test driven development and continuous integration/delivery using Github Actions and Firebase App Distribution. To see the old version, navigate to this [commit](https://github.com/syedahmedjamil/pushier/commit/ea7f30f8890fba63ff5571d64c3dffbe08dd9bfd) and click "Browse Files".
Updating app using clean architecture, acceptance test driven development and continuous integration/delivery using Github Actions and Firebase App Distribution. To see the old version, navigate to this [commit](https://github.com/syedahmedjamil/pushier/commit/ea7f30f8890fba63ff5571d64c3dffbe08dd9bfd) and click on "Browse Files".

# About
Android client app that integrates with pusher beams to show realtime in-app notifications.
Expand Down
53 changes: 42 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.util.Properties
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.androidApplication)
Expand All @@ -9,6 +9,7 @@ plugins {
id("com.google.firebase.crashlytics")
id("com.google.firebase.appdistribution")
id("androidx.navigation.safeargs.kotlin")
id("com.google.dagger.hilt.android")
}
val keystorePropertiesFile = rootProject.file("app/keystore.properties")
val keystoreProperties = Properties()
Expand All @@ -23,13 +24,13 @@ android {
minSdk = 24
targetSdk = 33
versionCode = project.property("versionCode").toString().toInt()
versionName = "1.2.0"
versionName = "1.3.1"
testApplicationId = "com.github.syedahmedjamil.pushernotif.test"
//testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner = "io.cucumber.android.runner.CucumberAndroidJUnitRunner"
// testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// testInstrumentationRunner = "io.cucumber.android.runner.CucumberAndroidJUnitRunner"
testInstrumentationRunner = "com.github.syedahmedjamil.pushernotif.test.CustomRunner"
//apk file name
setProperty("archivesBaseName", "${rootProject.name}-${versionName}-${versionCode}")

}

signingConfigs {
Expand Down Expand Up @@ -61,7 +62,6 @@ android {
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
applicationIdSuffix = ".${suffix}"
versionNameSuffix = "-${suffix}"
signingConfig = signingConfigs.getByName("release")

Expand All @@ -88,15 +88,37 @@ android {
}

testOptions {
unitTests {
isIncludeAndroidResources = true
isReturnDefaultValues = true
}
animationsDisabled = true
packaging {
jniLibs {
useLegacyPackaging = true
}
}
}

kapt {
correctErrorTypes = true
}

packaging {
resources.excludes.addAll(
listOf(
"META-INF/LICENSE.md",
"META-INF/LICENSE-notice.md"
)
)
}

dependencies {

//project
implementation(project(":data"))
implementation(project(":domain"))
implementation(project(":usecases"))
implementation(project(":usecase"))
implementation(project(":core"))

//local
Expand All @@ -108,28 +130,37 @@ android {
implementation(libs.androidx.constraintlayout)
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2") // for asLiveData method
implementation("com.google.firebase:firebase-iid:21.1.0")
implementation("com.google.firebase:firebase-iid:21.1.0") // for pusher
implementation(platform("com.google.firebase:firebase-bom:32.7.0"))
implementation("com.google.firebase:firebase-messaging")
implementation("com.pusher:push-notifications-android:1.9.2")
implementation("androidx.navigation:navigation-ui-ktx:2.7.6")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.6")
implementation("com.squareup.picasso:picasso:2.8")
implementation("com.google.dagger:hilt-android:2.50")
kapt("com.google.dagger:hilt-android-compiler:2.50")
implementation("androidx.test.espresso:espresso-idling-resource:3.5.1") // for EspressoIdlingResource

//test
testImplementation(project(":shared-test"))
testImplementation(libs.junit)
testImplementation(libs.androidx.junit.ktx)
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") //for runTest and dispatchers
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") // for runTest and dispatchers
testImplementation("androidx.arch.core:core-testing:2.2.0") // for instant task executor rule

//androidTest
androidTestImplementation(project(":shared-test"))
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.cucumber.android)
androidTestImplementation(libs.androidx.rules)
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") // for runTest and dispatchers
androidTestImplementation("com.squareup.okhttp3:okhttp:3.12.0")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
androidTestImplementation("com.google.dagger:hilt-android-testing:2.50")
kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.50")
androidTestImplementation("io.cucumber:cucumber-android-hilt:7.14.0")
androidTestImplementation("io.mockk:mockk-android:1.13.9")
androidTestImplementation("androidx.fragment:fragment-testing:1.6.2") // for DataBindingIdlingResource
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Feature: Delete Notifications
User deletes all locally stored notifications


Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Feature: View Notifications
User cal view all locally stored notifications
5 changes: 5 additions & 0 deletions app/src/androidTest/assets/test_notification.preferences_pb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

�
$216b9ffe-1bf7-4ec5-89a5-1c6283ec37d9o*m{"body":"test","date":"test","image":"test","interest":"test1","link":"test","subText":"test","title":"test"}
�
$cd2467e0-28eb-46dc-b5ad-74b08638b21do*m{"body":"test","date":"test","image":"test","interest":"test2","link":"test","subText":"test","title":"test"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.github.syedahmedjamil.pushernotif.test

import android.content.Intent
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.test.core.app.ActivityScenario
import com.github.syedahmedjamil.pushernotif.ui.MainActivity
import io.cucumber.java.After
import javax.inject.Inject

class ActivityScenarioHolder {

private lateinit var scenario: ActivityScenario<MainActivity>


@Inject
lateinit var dataStore: DataStore<Preferences>

fun launch(intent: Intent) {
scenario = ActivityScenario.launch<MainActivity>(intent)
}

fun getScenario(): ActivityScenario<MainActivity> {
return scenario
}
/**
* Close activity after scenario
*/
@After
fun close() {
scenario.close()

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.github.syedahmedjamil.pushernotif.test

import android.app.Application
import android.content.Context
import com.github.syedahmedjamil.pushernotif.BaseApplication
import dagger.hilt.android.testing.CustomTestApplication
import io.cucumber.android.runner.CucumberAndroidJUnitRunner

@CustomTestApplication(BaseApplication::class)
interface CustomHiltTestApplication

class CustomRunner : CucumberAndroidJUnitRunner() {

override fun newApplication(cl: ClassLoader?, name: String?, context: Context?): Application {
return super.newApplication(cl, CustomHiltTestApplication_Application::class.java.name, context)
}
}
Loading

0 comments on commit 5f7afd3

Please sign in to comment.