Skip to content

Commit

Permalink
Update to Blueprint 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva committed May 18, 2021
1 parent deef0e1 commit cfbbf6f
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 49 deletions.
16 changes: 0 additions & 16 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion app/build.gradle
Expand Up @@ -2,7 +2,9 @@
/*
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
Expand All @@ -29,6 +31,7 @@ android {
buildToolsVersion Versions.buildTools

defaultConfig {
buildConfigField("String", "ONESIGNAL_APP_ID", "\"$OneSignal.appId\"")
manifestPlaceholders = [
onesignal_app_id : OneSignal.appId,
onesignal_google_project_number: OneSignal.googleProjectNumber
Expand All @@ -54,6 +57,9 @@ android {
}

buildTypes {
buildTypes.each {
it.buildConfigField("String", "ONESIGNAL_APP_ID", "\"$OneSignal.appId\"")
}
release {
debuggable false
zipAlignEnabled true
Expand Down
8 changes: 7 additions & 1 deletion app/proguard-rules.pro
Expand Up @@ -38,6 +38,12 @@
-dontwarn okio.**
-dontwarn javax.annotation.**

-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}
-keep public final class * extends android.view.AbsSavedState
-keepclassmembers public final class * extends android.view.AbsSavedState { *; }

# Retrofit
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
Expand All @@ -52,4 +58,4 @@
-keep,allowobfuscation interface <1>

-dontwarn
-ignorewarnings
-ignorewarnings
10 changes: 2 additions & 8 deletions app/src/main/AndroidManifest.xml
Expand Up @@ -278,14 +278,8 @@

<!-- OneSignal Notifications Service -->
<!-- TODO: Remove comment marks to enable
<service
android:name=".NotificationService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE">
<intent-filter>
<action android:name="com.onesignal.NotificationExtender" />
</intent-filter>
</service>
<meta-data android:name="com.onesignal.NotificationServiceExtension"
android:value="${applicationId}.NotificationServiceExtension" />
-->
</application>
</manifest>
20 changes: 15 additions & 5 deletions app/src/main/kotlin/dev/jahir/blueprint/app/MyApplication.kt
Expand Up @@ -4,16 +4,26 @@ import dev.jahir.frames.ui.FramesApplication

// TODO: Remove comment marks to enable
// import com.onesignal.OneSignal
// import com.onesignal.OSNotificationReceivedEvent
// import dev.jahir.frames.extensions.context.preferences

class MyApplication : FramesApplication() {
override fun onCreate() {
super.onCreate()
// TODO: Remove comment marks to enable
/*
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init()
OneSignal.initWithContext(this);
OneSignal.setAppId(BuildConfig.ONESIGNAL_APP_ID);
OneSignal.setNotificationWillShowInForegroundHandler { notificationReceivedEvent: OSNotificationReceivedEvent ->
notificationReceivedEvent.complete(
if (preferences.notificationsEnabled)
notificationReceivedEvent.notification
else null
)
}
OneSignal.unsubscribeWhenNotificationsAreDisabled(true)
OneSignal.pauseInAppMessages(true)
OneSignal.setLocationShared(false)
*/
}
}
}
12 changes: 0 additions & 12 deletions app/src/main/kotlin/dev/jahir/blueprint/app/NotificationService.kt

This file was deleted.

@@ -0,0 +1,30 @@
package dev.jahir.blueprint.app

/* TODO: Remove comment marks to enable
import android.content.Context
import androidx.core.app.NotificationCompat
import com.onesignal.OSNotificationReceivedEvent
import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler
import dev.jahir.frames.extensions.context.color
import dev.jahir.frames.extensions.context.drawable
import dev.jahir.frames.extensions.context.preferences
class NotificationServiceExtension : OSRemoteNotificationReceivedHandler {
override fun remoteNotificationReceived(
context: Context,
notificationReceivedEvent: OSNotificationReceivedEvent
) {
if(!context.preferences.notificationsEnabled) {
notificationReceivedEvent.complete(null)
return
}
val notification = notificationReceivedEvent.notification
val mutableNotification = notification.mutableCopy()
mutableNotification.setExtender { builder: NotificationCompat.Builder ->
builder.color = context.color(R.color.accent)
builder.setSmallIcon(R.drawable.ic_notification)
}
notificationReceivedEvent.complete(mutableNotification)
}
}
*/
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/MyApp.kt
Expand Up @@ -2,6 +2,6 @@

object MyApp {
const val appId = "dev.jahir.blueprint.app"
const val version = 222
const val versionName = "2.2.2"
const val version = 223
const val versionName = "2.2.3"
}
8 changes: 4 additions & 4 deletions buildSrc/src/main/java/Versions.kt
Expand Up @@ -2,18 +2,18 @@

object Versions {
// Plugins
const val gradle = "4.2.0"
const val kotlin = "1.4.32"
const val gradle = "4.2.1"
const val kotlin = "1.5.0"

// OneSignal
const val oneSignalPlugin = "0.12.10"
const val oneSignal = "4.3.3"
const val oneSignal = "4.3.4"

// App
const val minSdk = 21
const val targetSdk = 30
const val buildTools = "30.0.2"

// Blueprint
const val blueprint = "2.2.2"
const val blueprint = "2.2.3"
}

0 comments on commit cfbbf6f

Please sign in to comment.