line / abc-kmm-notifications

Remote Notification Manager for Kotlin Multiplatform Mobile iOS and Android
Apache License 2.0
60 stars 2 forks source link

Could not resolve com.linecorp.abc:kmm-notifications:0.4.1 #1

Open Kashif-E opened 2 years ago

Kashif-E commented 2 years ago

Hey! i am trying to use the latest version of kmm-notifications everything is work in common main and android main but when i try to add the dependency to ios main its not unable to resolve.

here is the code for my build.gradle file.

plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
    kotlin(KotlinPlugins.serialization) version Kotlin.version
    id("com.android.library")

}

version = "1.0"
val abcNotifications = "com.linecorp.abc:kmm-notifications:0.4.1"
kotlin {
    android()
    iosX64()
    iosArm64()
    iosSimulatorArm64()

    cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../markazSupplierIos/Podfile")

        framework {
            baseName = "shared"
        }
    }

    sourceSets {

        val commonMain by getting {
            dependencies {
                implementation(Ktor.core)
                implementation(Ktor.clientSerialization)
                implementation(Kotlinx.datetime)
                implementation(Koin.koin)
                implementation(Ktor.ktorLogging)
                implementation(Firebase.auth)
                implementation(MultiplatformSettings.core)
                implementation(MultiplatformSettings.coroutines)
                implementation(abcNotifications)
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt")
                implementation("io.islandtime:core:0.6.3")

            }
        }
        val androidMain by getting {
            dependencies {
                implementation(Ktor.android)
                implementation(Koin.koinAndroid)
                implementation(Ktor.androidLogging)
                runtimeOnly(Ktor.okhttp)
                implementation(Datastore.datastore)
                implementation(abcNotifications)
                api(abcNotifications)
                implementation(MultiplatformSettings.datastore)

            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))

            }
        }

        val androidTest by getting
        val iosX64Main by getting
        val iosArm64Main by getting
        val iosSimulatorArm64Main by getting
        val iosMain by creating {
            dependencies {
                implementation(Ktor.ios)

                implementation(abcNotifications)
                api(abcNotifications)

            }
            dependsOn(commonMain)
            iosX64Main.dependsOn(this)
            iosArm64Main.dependsOn(this)
            iosSimulatorArm64Main.dependsOn(this)
        }
        val iosX64Test by getting
        val iosArm64Test by getting
        val iosSimulatorArm64Test by getting
        val iosTest by creating {
            dependsOn(commonTest)
            iosX64Test.dependsOn(this)
            iosArm64Test.dependsOn(this)
            iosSimulatorArm64Test.dependsOn(this)
        }
    }
}

android {
    compileSdk = 31
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdk = 21
        targetSdk = 31
    }
}

here is the message i am getting

Could not resolve com.linecorp.abc:kmm-notifications:0.4.1

Could not resolve com.linecorp.abc:kmm-notifications:0.4.1.
Required by:
    project :shared

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Any help will be appreciated

shivamkanodia9143 commented 1 year ago

did you find any solution?

Kashif-E commented 1 year ago

Couldnt find any solution @shivamkanodia9143

shivamkanodia9143 commented 1 year ago

@Kashif-E then how did you implement push notifications for ios using kmm, with or without using this lib?

Kashif-E commented 1 year ago

I went with native implementation for both platforms rather than shared @shivamkanodia9143

vdcast commented 8 months ago

I went with native implementation for both platforms rather than shared @shivamkanodia9143

cool bro! would you be able to share the code of implementation for Android and IOS? I guess you're using expect/actual mechanism.

I'm still curious - were you able to sent notifications from background services on IOS and Android? For example, you have timer for 1 minute and you want to notify user after 1 minute is gone (doesn't matter App is active or not).