Hi, is there any way to monetize apps on Compose i...
# compose-ios
t
Hi, is there any way to monetize apps on Compose iOS? Since AdMob is currently unavailable, is there an alternative, such as in-app purchases, or is there no viable option at the moment?
a
Why the AdMob is unavailable for iOS?
There is no big difference between compose iOS app and native one. All platform APIs and known monetisation methods are available for you. I use admob for ads and revenuecat for purchases. Both methods can be easily wrapped and used from shared code for iOS/android
m
You can probably use an interface to wrap the AdMob iOS library methods and then call it in your shared code. Similar to something done in this article.
t
Oh I see,im a kotlin dev and have no experience on ios. But ill try it out
Can someone show me an example of how it should look like, I tried this https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-ios-ui-integration.html#use-swiftui-inside-compose-multiplatform, and I dont know how to display the ads on a specific composable
a
You should add AdMob cocoappod and use ad view with cinterop and UIKitView compostable
t
I already did add Admob im just stuck on setting it to actually display. If it's possible can you send me code snippets of how you got banner ads to work? I already fixed it for android just need to complete the iOS side
a
I'm not using banners so i dont have a working sample right now. You should use
UIKitView
(as AndroidView equivalent on iOS) with
GADBannerView
https://developers.google.com/admob/ios/banner#objective-c
t
Oh okay thanks I fixed it, they work now
478 Views