bdlukaa / native_admob_flutter

Easy-to-make native ads in flutter using AdMOB SDK.
https://pub.dev/packages/native_admob_flutter
BSD 3-Clause "New" or "Revised" License
80 stars 56 forks source link

Supporting native ads on iOS #31

Open shimaatech opened 3 years ago

shimaatech commented 3 years ago

Thanks for this great package. Is there any plans to support native ads on iOS?

bdlukaa commented 3 years ago

Hey! Unfortunately no :/. The current implementation was made with android in mind, and porting it to iOS is hard (some people have tried and didn't have success). I also can't do it myself because I don't have a mac, so porting it to iOS depends on the community.

ad-on-is commented 3 years ago

Well, this is a bit misleading then... You named your package "native_admob_flutter" and even the README shows iOS as supported platform. We were in hope that we can use the Widgets, which btw work great on Android, on iOS too, in a near future.

Also, you could just set up macOS on VMWare. It works great and is sufficient for testing purposes. I used it myself for a while, until I bought a cheap intel Nuc and built a "hacintosh" for cheap.

bdlukaa commented 3 years ago

We were in hope that we can use the Widgets

This was my plan for this plugin from the beggining, but it isn't a viable option, then I decided to make it look mostly like widgets.

Using Widgets should come from google (in their admob plugin). It's their framework and it's their ad server, it shouldn't be up to the community to do so. There are a lot things I'd like to do with this plugin but I can't because of such limitations, and there's nothing I can do about it.

The reason NativeAds in iOS isn't supported is because of Android. The current implementation was thought on Android and I had no idea how it's like to program in SwiftUI (iOS) the time I developed this. Porting this to iOS means I'd need to recreate the whole NativeAd implementation in a way it'd be good for both SwiftUI and for Android

Also, I think everyone should read Developer's note at the top of the NativeAd wiki.

Also, you could just set up macOS on VMWare.

Unfortunally this isn't a viable option. A macOS VM takes more than 15GB of disk, and I'm not doing this.

Either way, if anyone want to do the iOS implementation for iOS, I can guide you through discord: https://discord.gg/674gpDQUVq

Bruno.

ad-on-is commented 3 years ago

Using Widgets should come from google (in their admob plugin). It's their framework and it's their ad server

I totally agree here! When they announced google_admob recently, I was hoping they've tackled this issue, which they didn't, and this is something that pisses me off. They just did something, that some developers have had already done before, like you did, but IMHO, you even did a better job 👍

I'd love to contribute, but I'm absolutely not familiar with Swift/Kotlin.

I hope someone is willing to pick up on the iOS side, this would really be helpful.

Unfortunally this isn't a viable option. A macOS VM takes more than 15GB of disk, and I'm not doing this.

Dude, are u workin' on an Raspberry Pi with 64GB SD-card? 😂😂

bdlukaa commented 3 years ago

I mean, some progress is already done with NativeAds on iOS. You can run the example app and the native ads looks kinda the same, but it's totally not stable. The thing left to do is make it look like the same as Android, which I can't achieve.

Dude, are u workin' on an Raspberry Pi with 64GB SD-card? 😂😂

🤣

bdlukaa commented 3 years ago

And my goal, when I started to make this plugin, was to make a plugin better than flutter_native_admob, which I achieved.

niypoo commented 3 years ago

I hope someone made it.

ramtinq commented 3 years ago

Thanks for your great plugin. This plugin is much more performant than the official google_mobile_ads plugin. I just wanted to know if the support for iOS is implemented or not? because the docs says it does. However I haven't been able to make it work on iOS. The app just jumps out, and in xCode I get the following error: Module 'native_admob_flutter' not found

bdlukaa commented 3 years ago

@ramtinq It is implemented. Can you try running flutter clean?

ramtinq commented 3 years ago

Thank you. The problem was caused by me forgetting to run pod install in ios directory after adding this plugin to my pubspec.yaml.

Now I have another problem: The UI in iOS is too much laggy after adding Native ads via this plugin. Without ads, the app runs on my iOS device smoother than my android device, so the problem shouldn't probably be with the iOS device having lower hardware resources.

In Android however, showing a Native ad via this plugin seems not to affect the smoothness/performance at all (in contrast to using google_mobile_ads plugin in the exact same app, which is as laggy as the iOS version of this plugin in both Android & iOS).

PS: I'm showing native ads inside draggable Positioned widgets.

would be so much thankful if any improvements could be made on the iOS support of this plugin. Thanks.

bdlukaa commented 3 years ago

True. The performance issues would be there even after the full-support for iOS because it uses hybrid composition. In Android, Virtual Display is used by default, but unfortunatelly it's not enabled on iOS. Even the official google_mobile_ads plugin have the same performance issue. Tho in release mode it shouldn't affect performance the way it does on debug mode.

bdlukaa commented 3 years ago

Please see https://github.com/bdlukaa/native_admob_flutter/issues/58