Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access underlying platform-specific APIs #483

Open
tgyhlsb opened this issue Mar 28, 2024 · 1 comment
Open

Access underlying platform-specific APIs #483

tgyhlsb opened this issue Mar 28, 2024 · 1 comment

Comments

@tgyhlsb
Copy link

tgyhlsb commented Mar 28, 2024

I'm trying to create extensions on types that are missing some methods.

My understanding is that any commonMain type has a .ios property that I can use from iosMain. I've found such property but I'm unable to use it because I can't import the "FIR" type that backs it.

Example:
I'm trying to add a method to StorageReference.
In iosMain I have:

import dev.gitlive.firebase.storage.StorageReference
import cocoapods.FirebaseStorage.FIRStorageReference // Error: Unresolved reference: cocoapods

actual fun StorageReference.putBytes(data: ByteArray) {
    println(this.ios.name()) // Error: Unresolved reference: name
}

How am I supposed to import and access FIRStorageReference properties?

@nbransby
Copy link
Member

I believe in the case of iOS you need to add the relevant pod to your build.gradle to resolve that, like we have here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants