Rinku
Rinku copied to clipboard
[Question] iOS Setup
how do we setup the library on iOS if we have something like this. I didn't see any example
First, you need to set up the deeplink and universal links in your app, and judging by the code that you posted, I assume you did not complete this part of the process. I do not cover this step in the documentation because there are tons of tutorials online.
here you can find links for both platforms: https://github.com/theolm/Rinku#initial-setup
But as a guideline basically, you need to:
1- Configure deeplinks and universal links in your app, so your application can receive the deeplink from the system and the Rinku can treat it. btw, I think you will need to create an app delegate for that.
2- Create an instance a Rinku instance inside the app delegate
3- Inside the appdelegate, implemented the functions to receive the deeplink and with the URL received call
rinku.onDeepLinkReceived(url: urlReceived)
I don't have time now, but I'll work on a sample for your case. Meanwhile, I think if you use an appdelegate adapter: https://www.hackingwithswift.com/quick-start/swiftui/how-to-add-an-appdelegate-to-a-swiftui-app
You should be able to copy the appdelegate from the readme (or from the sample).
I'll keep the issue open for now.
Thanks for pointing me in the right direction. My major problem now is accessing RinkuIos in the AppDelegate file. I've exported the dependency and used api declaration like the installation guide states and imported the shared module, but for some reason it still doesn't recognise RinkuIos, so I was wondering if there is anything specific I need to do in Xcode
Could you provide a sample of your code?
so this is the delegate class you suggested and what i tried to do is create a wrapper class in my iosMain sourceset where i just forward the calls down to Rinku. I haven't been able to test it out yet, but i hope it works.
I would have to check your project setup. Do you have a repository with the code? Did you exported rinku to the ios framework?
kotlin {
...
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
// Specify iOS targets
).forEach { iosTarget ->
iosTarget.binaries.framework {
// Export of Rinku library to the iOS framework
export("dev.theolm:rinku:<latest_version>")
...
}
}
...
sourceSets {
commonMain.dependencies {
api("dev.theolm:rinku:<latest_version>")
// For compose multiplatform projects
implementation("dev.theolm:rinku-compose-ext:<latest_version>")
}
}
}
The api and the export are required so you can access the lib in the ios code.
closing for inactivity
Hi @theolm i have the same issues i did all the steps api and export in the ios block but i still, face the same issue
Please provide a sample so I can understand what is happening.