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

add needed permission to the docs for android #2

Open
jeb192004 opened this issue Feb 2, 2025 · 7 comments
Open

add needed permission to the docs for android #2

jeb192004 opened this issue Feb 2, 2025 · 7 comments

Comments

@jeb192004
Copy link

could you please add this to the docs to let others know they need to include this permission in the pyproject.toml file

[tool.flet.android.permission]
"com.google.android.gms.permission.AD_ID" = true

or add this to the build aab command

--android-permissions com.google.android.gms.permission.AD_ID=True

i have yet to figure out how to test for ios to know whats needed for that.

@ndonkoHenri
Copy link

May I ask what's it's use? Any link for details on it?

And do you mean it should be added in addition to the user's admob app ID?

@jeb192004
Copy link
Author

jeb192004 commented Feb 3, 2025

yes. the permission should be added in addition to the users admob id. maybe...

the ads were not loading on my device reliably everyday. i connected to computer to read logcat and i kept getting this warning.

Dynamic lookup for intent failed for action: com.google.android.gms.ads.service.START

heres the stackoverflow where i found the answer that i needed that permission.
https://stackoverflow.com/questions/75421197/dynamic-lookup-for-intent-failed-for-action-com-google-android-gms-ads-service

after adding the permission yesterday the ads started working again.

But... that may not be the issue why ads were not loading sometimes. upon checking the app on my phone this morning the ads were not working again even with that permission. this time i went to phone settings and searched for "ads" and reset my advertizing id for my device. after that the ads started working again. so idk whats going on.

also, idk how things work behind the scenes with flet but if it uses googles advertising id api it then requires the permission in the manifest
https://support.google.com/googleplay/android-developer/answer/6048248?hl=en

@geceyzlm
Copy link

geceyzlm commented Feb 3, 2025

evet. izin, kullanıcının admob kimliğine ek olarak eklenmeli. belki...

Reklamlar cihazıma her gün güvenilir bir şekilde yüklenmiyordu. Logcat'i okumak için bilgisayarıma bağlandım ve bu uyarıyı almaya devam ettim.

Dynamic lookup for intent failed for action: com.google.android.gms.ads.service.START

İşte ihtiyacım olan izne dair cevabı bulduğum stackoverflow. https://stackoverflow.com/questions/75421197/dynamic-lookup-for-intent-failed-for-action-com-google-android-gms-ads-service

dün izni ekledikten sonra reklamlar tekrar çalışmaya başladı.

Ama... reklamların bazen yüklenmemesinin nedeni bu olmayabilir. Bu sabah telefonumdaki uygulamayı kontrol ettiğimde, bu izinle bile reklamların tekrar çalışmadığını gördüm. Bu sefer telefon ayarlarına gidip "reklamlar"ı aradım ve cihazım için reklam kimliğimi sıfırladım. Ondan sonra reklamlar tekrar çalışmaya başladı. Bu yüzden ne olduğunu bilmiyorum.

ayrıca flet ile perde arkasında işlerin nasıl yürüdüğünü bilmiyorum ama eğer google'ın reklam kimliği api'sini kullanıyorsa manifest dosyasında izin gerekiyor https://support.google.com/googleplay/android-developer/answer/6048248?hl=tr

Could you send sample code about flet ads.I cant use ads in flet

@jeb192004
Copy link
Author

Could you send sample code about flet ads.I cant use ads in flet

theres more info here.
https://flet.dev/docs/controls/ads
you may also need to go to admobs website to create an app there to get an app id and create ad units for you app which will also give you an ad unit id.

admob webiste https://admob.google.com/home/

the samples in these docs work. just need to make sure you have your ids for the app and ads. and dont forget when you build the flet app to add

--include-packages flet_ads

to your build command.

also from my testing, the ads will not work on degoogle devices. if you're on discord i have messages on there showing how i got around the error from that and i just dont show the ads on degoogled devices

@geceyzlm
Copy link

geceyzlm commented Feb 3, 2025

Flet reklamları hakkında örnek kod gönderebilir misiniz? Flet'te reklamları kullanamıyorum

Daha fazla bilgi için buraya tıklayın. https://flet.dev/docs/controls/ads Ayrıca AdMob web sitesine gidip orada bir uygulama oluşturmanız, uygulama kimliği almanız ve uygulamanız için reklam birimleri oluşturmanız gerekebilir; bu da size bir reklam birimi kimliği verecektir.

admob web sitesi https://admob.google.com/home/

Bu dokümanlardaki örnekler işe yarıyor. Sadece uygulama ve reklamlar için kimliklerinizin olduğundan emin olmanız gerekiyor. Ve flet uygulamasını oluştururken eklemeyi unutmayın

--include-packages flet_ads

yapı komutunuza.

ayrıca testlerimden de anlaşılacağı üzere reklamlar degoogle cihazlarda çalışmıyor. discord'daysanız orada bu hatayı nasıl aştığımı gösteren mesajlarım var ve degoogle cihazlarda reklamları göstermiyorum

Thanks for your comment but i tried codes the codes did not work .Can you share sample zip i have id .Sory for my english

@jeb192004
Copy link
Author

Thanks for your comment but i tried codes the codes did not work .Can you share sample zip i have id .Sory for my english

if you clone this repo theres an example file. navigate to example/ads_example/

there should be a pyproject.toml file there. edit that to add your admob app id to the bottom of that file.

[tool.flet.android.meta_data]
"com.google.android.gms.ads.APPLICATION_ID" = "ca-app-pub-your-app-id"

there should also be "src" folder there too. the main app is inside that folder. from the same folder the toml file is in, in the cli run this command

flet build apk --include-packages flet_ads && adb install build/apk/app-release.apk

that will build the app and install it to your device or emulator. i have just done all these steps and confirmed it works in the android emulator

@geceyzlm
Copy link

geceyzlm commented Feb 3, 2025

Could you send sample code about flet ads.I cant use ads in flet

theres more info here. https://flet.dev/docs/controls/ads you may also need to go to admobs website to create an app there to get an app id and create ad units for you app which will also give you an ad unit id.

admob webiste https://admob.google.com/home/

the samples in these docs work. just need to make sure you have your ids for the app and ads. and dont forget when you build the flet app to add

--include-packages flet_ads

to your build command.

also from my testing, the ads will not work on degoogle devices. if you're on discord i have messages on there showing how i got around the error from that and i just dont show the ads on degoogled devices

Thanks a lot.My computer does not support Android Studio, so I can translate it to APK thanks to workflow. Is what you said useful 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

3 participants