Hey, after a lot of work, my KMP Compose multiplatform app is now in production and :android-new: s...
m
Hey, after a lot of work, my KMP Compose multiplatform app is now in production and android new successfully published in Google Play ๐ŸŽ successfully published on App Store Features: โ€ข Networking/ local database โ€ข Complex custom UI + Animations โ€ข Native interactions for importing contacts โ€ข Proper DI via Koin โ€ข properly Modularized project with clean architecture (where applicable) โ€ข Platform specific effects (eg. Ripple on Android, iOS like hover/onclick on iOS), for correct look&feel on each platform When i started some weeks back I remember I had many questions on my end about KMP and CMP. I solved them obviously by trial/error. But i was for months hesitant to start. Most important findings: โ€ข iOS performance is great. BETTER than Flutter, feels basically as smooth as native โ€ข medium-steep learning curve, once DI/networking/db is setup, development speed is high If anybody has questions, feel free to ask. I know when i was quietly reading this channel here, i had so many doubt if i should try it, and most importantly: will it even be worth it, will iOS feel as native? If i can help somehow easy anybodies doubts, ask!
๐Ÿš€ 36
โค๏ธ 15
๐Ÿ‘ 7
๐Ÿ‘๐Ÿพ 2
m
Great! Can you share the app links on Google Play and App Store?
โž• 5
a
@Max are u using ktor with darwin on ios? if yes, can u kindly check if the app's memory usage keeps going up on every http request you do? I ditched building an ios app using ktor because of all the memory leaks
m
@Alex Styl Yes i will check that on the weekend. I do use darwin ktor
@mohamed rejeb unfortunately not yet, legal reasons. But will share in the future
u
@Max Did you share the ui with compose multiplatform or did you write it natively in swift?
m
@ืืœื™ื”ื• ื”ื“ืก Shared with CMP
@Alex Styl hmm, I was curious, and Iโ€™m not 100% about the results. Performed 10 subsequent POST requests, waited 1min, again 10.. the whole process 4 times. After the memory usage has settled, iโ€™m each time 2mb up. Can of course be due to other leak in the background. E.g. coroutines. Maybe even something that gets cleaned up with a big delay. Did you create a minimal reproducible project with ktor showing the memory leak? You sure itโ€™s nothing like coroutines creating more threads or so, which would get cleaned up if space is needed?
u
@Max Wow it's really impressive that you had better performance than with flutter, it's really promising for cmp, especially since it's still in beta on ios. I really hate for projects like calf or compose cupertino to reach their final version.
m
@ืืœื™ื”ื• ื”ื“ืก on iOS itโ€™s Alpha actually๐Ÿ˜‚ Looking forward for it being stable I agree, mentioned libs are cool, but one credo iโ€™m following currently is pure-vanilla compose where possible, Each lib introduces possible problems going forward. So iโ€™m building the ios look and feel myself for now to avoid compatibility issues
j
The tooling, like publish and stuff like crashlytics, what did you use? :) Also curious, which navigation framework did you end up with?
a
@Max havent tried on a separate project as my case was very basic and i was porting my android/jvm app to ios. same business logic. only different was the engine, so im 90% sure the issue is with the darwin engine
m
@Joel Denke currently the first version was manual publishing, will look into automation at a later stage. Needed a proof of concept that whole lifecycle of an CMP app works (development to publishing) No crashlytics yet, but will implement Firebase Crashlytics or so and provide an implementation for iOS and Android myself. Decided against gitlive, to avoid compatibility issues in the future where possible. Only official sdks Navigation currently Voyager. Quite happy with it. Was imo best option to later migrate to official Jetbrains navigation, since there is no overhead.
๐Ÿ‘ 1
j
Cool, Yeah I used Fastlane for iOS + Android. But want happy about it and no way share Swift libraries in KMP Gradle plugins as I know of. But worked in general quite well automate publish to app store which was painful with Apple certificates. I think Sentry is multiplatform but not sure if not need Firebase. I tried using official libs but wasnt the easiest get it right. Hence curious. For navigation I choose Circuit as supported all platforms. With wasm support in Alpha. I am not sure Jetbrains navigation will be good. From what it looks like it will inherit androidx compose navigation. It has potentials but lacks a lot of features Voyager, Circuit etc having. I hope I am wrong. Will be interesting how unify urls in web, deep links, desktop navigation and regular Android vs iOS. Really cool see more apps in CMP launched in production.
m
Good idea with Sentry, will check it. Only thing that bugs me about voyager: no out of the box swipe back for iOS. But found a gist and will try it. In general, iโ€™m quite conservative against third party libs, worked with Flutter for a while where there is a lib for everything. For example for working with local phone contacts. But itโ€™s half baked, you need to trust the developer with very sensible data (and study the source code) - so i prefer to implement things on Android and iOS instead using a lib. For example, importing contacts was 1h work together with ChatGPT and it worked. And from now on it will always use the offfial Apple library, no privacy concerns, no bridging-library that maybe saves 30min implementation but brings potential breakages. But thatโ€™s just me and my approach:) used libs heavily in the past with Android apps and spent days after major Android releases because lib-developers stopped updating after some years
t
Great @Max!
iOS performance is great. BETTER than Flutter, feels basically as smooth as native
Can you share insights on how were you measuring this? Also was your flutter app optimised in terms of performance?
j
@Max Yeah that was another reason I choose Circuit. It has very native back swipe handling in both Android and iOS. Yeah I have always tried stick with only androidx, Jetbrains and good maintained libraries. Like Timber still going strong. Using vanilla Kotlin and native SDK directly is nice in KMP. I only wished there was direct Swift interop, then could use iOS SDK for crypto or Firebase iOS directly. That will hopefully come soon, that will take CMP sky high I think in user adoption. I think youre approach is good regardless native, Flutter, CMP or something else. Depending on to many libraries making code base hard maintain and easy breaking. However if things like androidx solve security things really good with backward compatibility its worth it. Using Apple Crypto and Android Keystore directly can be complex. Easy using "wrong" algorithms either not working on all devices or insecure.
m
@Tejeshwar Amirthy Iโ€™m a iPhone user since years myself and used a lot of Flutter apps + also developed some myself. Even with the most basic Flutter apps, you โ€œfeelโ€ the lag on large lists or when pressing a button, the ms it takes for the animation. With CMP out of the box, i did not find difference to native. How you mean optimized for performance? Used pure Flutter latest versions each time
j
@Max Was that Flutter performance mentioned with new Impeller engine or old one? I thought Flutter had better performance.
j
@Joel Denke afaik impeller is on iOS the default render engine
j
So Flutter having bad performance with Impeller compared to CMP?
j
I think so
k
we built this a while ago using cmp, absolutely amazing performance. everything is shared from business logic to ui https://apps.apple.com/pk/app/markaz-resell-and-earn-money/id6470020517
๐Ÿ‘ 3
๐Ÿ‘Œ 1
๐Ÿš€ 1
m
@Kashismails regularly checking on your app. Noticed you added swipe back on iOS. Great work!
kodee walking 1
k
yes it was long pending finally add it to the release
j
@Kashismails I managed to show play notifications on iOS with AVPlayer, maybe this is also interesting for your project
k
thats awesome @Jimmy Nelle, we currently dont have a usecase for it but i really want to know you did it
j
@Kashismails is there any workaround to trying your app on an iPhone? Mine complains about the app not being available in my country (I'm in NL).
k
@Jacob Ras its available now
thank you color 1
f
@Kashismails I understand that in your last release, you implemented back gesture on iOs, rigth? I would like know how do you achieved this? I'm trying to do this and I use Compose Multiplatform CMP and also I use Compose Navigation; but I haven't achieved yet. I need implement the back gesture on iOS, on Android this work perfectly (by Android), but on iOS the back gesture not work. How do you achieve this? Thanks.
141 Views