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

[📚] AdMob - use @invertase/react-native-google-ads #5329

Closed
mmskvortsov opened this issue May 18, 2021 · 89 comments
Closed

[📚] AdMob - use @invertase/react-native-google-ads #5329

mmskvortsov opened this issue May 18, 2021 · 89 comments
Labels
help: good-first-issue Issues that are non-critical issues & well defined for first time contributors.

Comments

@mmskvortsov
Copy link

AdMob documentation availability

Hi there! I've noticed that AdMob documentation is not available on the official website: https://rnfirebase.io/admob
There is a 404 error:
image

Is there any issue with that or this part of documentation turned off intentionally?
Thanks!

@mmskvortsov mmskvortsov added help: good-first-issue Issues that are non-critical issues & well defined for first time contributors. Type: Docs labels May 18, 2021
@Deodes
Copy link

Deodes commented May 18, 2021

Try this link

@mikehardy
Copy link
Collaborator

This came up as a comment on an unrelated issue and I think I may understand the confusion now - pasting in my comment from there:

Ah - sorry, we've already merged the change where Admob is removed from firebase following it's removal upstream, and the documentation site goes live immediately after merges to main branch.

It is not as great of an experience but for now until we have the admob code re-hosted in a non-firebase repo you can go direct to the usage docs and types / API reference from the v11.5.0 (current stable) tag

https://github.com/invertase/react-native-firebase/tree/v11.5.0/docs/admob
https://github.com/invertase/react-native-firebase/blob/v11.5.0/packages/admob/lib/index.d.ts

Normally it's a great thing that the docs site is updated immediately between releases, but in this case it means the documentation for a module that is still live (and will always be, in that version) is gone. I'll have to think on that to see if there's some better way we can keep docs for old versions alive as they are still quite useful

@mikehardy mikehardy pinned this issue May 18, 2021
@mikehardy
Copy link
Collaborator

I've pinned this issue for others

@mmskvortsov
Copy link
Author

@mikehardy Thanks for clarification!

@Kamani
Copy link

Kamani commented May 18, 2021

@mikehardy Sorry it may seem stupid question but please help me.
You said Admob is removed. does it mean that we will be not able to use yarn add @react-native-firebase/admob? As document is not available does it mean that? I would like to understand as I am creating app and want to integrate package I can go ahead right?

@mikehardy
Copy link
Collaborator

@Kamani v11.5.0 contains admob. That is the current latest release so you may use the command you mention.
As admob will not be in the next release, it may be best to specify the version precisely so it does not auto-update other packages, all of your react-native-firebase packages should be pinned to exactly '@11.5.0' vs having any semver range

@Kamani
Copy link

Kamani commented May 18, 2021

@mikehardy Thank you for your reply. I really appriciate. Admob will be again integrade in future release? Or you guys are planning to remove it permenantly?

@mikehardy
Copy link
Collaborator

It's gone from upstream. The Google Firebase team have removed it. We track them. It will never be in react-native-firebase again.

We have plans to re-host the code on an external repository, but you will not be able to update react-native-firebase and use admob at the same time until we do so

This may not be great to hear but please understand we are downstream consumers of the SDKs. This is not our decision.

@Kamani
Copy link

Kamani commented May 18, 2021

@mikehardy I can understand. Thank you for explaining in detail. May be this detailed comment will be also useful for new users.

@bezenson
Copy link

Maybe someone knows great alternative admob libraries which are supported today?

@mikehardy
Copy link
Collaborator

V11.5 was just fine 2 days ago and is still fine today? Please be a little patient and the code will be in a new repo. Or there is react-native-admob I think?

@bezenson
Copy link

V11.5 was just fine 2 days ago and is still fine today? Please be a little patient and the code will be in a new repo. Or there is react-native-admob I think?

Oh, if you are going to create separate library then it is cool.

react-native-admob last updated 2 years ago and I had problems while installing on 0.64 RN

@ifsnow
Copy link
Contributor

ifsnow commented May 21, 2021

@mikehardy Thank you for your hard work and responses.

Do you have an expected timeline for @invertase/react-native-admob? I'm worried that I will not be able to apply the new version of react-native-firebase for a long time. There is no problem at all right now :)

@mikehardy
Copy link
Collaborator

Unfortunately not, and with admob it's a little tricky because even before the most recent change the code here was already in need of a breaking forward port #5150 - that forward port itself means that step 1 is simply to move the code, step 2 is then to forward port it (otherwise there will be collisions for folks trying to use up to date GoogleAppMeasurement symbols - which Firebase Analytics shares).

This is all unfunded work so it's a lower priority - I do love making things work but I have to prioritize as there is of course an infinite task queue ;-).

If you wanted to help it would be really really welcome and even before moving (step 1 as I listed it) it is actually possible to start with what I listed as step 2 by branching from the v11.5.0 tag here and beginning the forward port based on google documentation. Any work done here can then be merged onto a branch and I'll just use the branch for the repo extraction, but the forward port work will have the support of all our E2E testing / test app infrastructure which is tremendously helpful I think.

@mikehardy
Copy link
Collaborator

That offer is open to anyone of course! Any future admob repo will have to have a large community participation to move forward, but the test infrastructure and CI and build/release tooling and stuff - that's what we / the future repo will get all for free so it's easy to contribute I hope.

@aleluiah
Copy link

setDebugGeography dosen't reflect even when i whitelist my deviceId

@spazfeed
Copy link

Use react-native-admob-next for admob this is based on expo-ads-admob.

@mikehardy
Copy link
Collaborator

That sounds good and could be a good solution @spazfeed do you know if it's already forward-ported to the new AdMob breaking changes? I'm just curious, because we are not forward-ported here, and if that library already is then it is ahead of anything we'd have by splitting the previous code here out

@mars-lan
Copy link
Contributor

mars-lan commented Jun 1, 2021

That sounds good and could be a good solution @spazfeed do you know if it's already forward-ported to the new AdMob breaking changes? I'm just curious, because we are not forward-ported here, and if that library already is then it is ahead of anything we'd have by splitting the previous code here out

Most probably not. It's still on v19 (Android) & v7 (iOS).

@nonth
Copy link

nonth commented Jun 16, 2021

That sounds good and could be a good solution @spazfeed do you know if it's already forward-ported to the new AdMob breaking changes? I'm just curious, because we are not forward-ported here, and if that library already is then it is ahead of anything we'd have by splitting the previous code here out

Most probably not. It's still on v19 (Android) & v7 (iOS).

I just create pull request for update Mobile Ads SDK here or you can use it directly from my fork

@Mikenso
Copy link

Mikenso commented Jun 17, 2021

It seems like @invertase/react-native-admob has huge advantage (comparing to react-native-admob-next) as it allows to create few interstitial instances and react-native-admob-next does not (correct me if I am wrong)
So I hope @invertase/react-native-admob will find itself in good hands of developer

@mikehardy
Copy link
Collaborator

Still on the radar as something to port out yes but I was curious yes if it still had value compared to any other efforts, thanks for chiming in

@teamseamive
Copy link

Any plans to update AdMob & IID to the latest version? Stuck on 11.5.0 due to both.

@haresh4d
Copy link

haresh4d commented Sep 7, 2021

That sounds good and could be a good solution @spazfeed do you know if it's already forward-ported to the new AdMob breaking changes? I'm just curious, because we are not forward-ported here, and if that library already is then it is ahead of anything we'd have by splitting the previous code here out

Most probably not. It's still on v19 (Android) & v7 (iOS).

I just create pull request for update Mobile Ads SDK here or you can use it directly from my fork

How can I use your fork? How to install it?

@mikehardy
Copy link
Collaborator

mikehardy commented Sep 7, 2021

Just FYI, we're getting close here, I'm at the "setting up e2e testing" part but the module from previous code here / extracted moved is public now https://github.com/invertase/react-native-google-ads/

next steps are finish a quick e2e bringup to verify functionality, then forward port

No documentation is available yet and it's not on npmjs.com but git references should work

for the migration the general idea is "admob" is now "googleAds" / "AdMob" in types is now "GoogleAds" etc, and the example app shows how to use app.json (not firebase.json) to put in the config keys

It's my current project here, it will be finished before I move to something else

@haresh4d
Copy link

Found a great alternative which also supports app open ads.

https://github.com/react-native-admob/admob

@bilarslan
Copy link

Just FYI, we're getting close here, I'm at the "setting up e2e testing" part but the module from previous code here / extracted moved is public now https://github.com/invertase/react-native-google-ads/

next steps are finish a quick e2e bringup to verify functionality, then forward port

No documentation is available yet and it's not on npmjs.com but git references should work

for the migration the general idea is "admob" is now "googleAds" / "AdMob" in types is now "GoogleAds" etc, and the example app shows how to use app.json (not firebase.json) to put in the config keys

It's my current project here, it will be finished before I move to something else

Glad to hear that 🎉 Looking forward to first release 👀

@haresh4d
Copy link

@mikehardy any update? when https://github.com/invertase/react-native-google-ads/ will be released? Will you also support app open ads?

@mikehardy
Copy link
Collaborator

When it's released it will hopefully support the entire API surface area of google ads, and one of the reasons to do a native module wrapper vs pure JS is that if it's possible with the SDK natively (app open ads, for example) it will be possible with the wrapper.

As for progress the last time I had a good chunk of hours to throw at it, I thought it was pretty close 🤷 - it is slow going though, I do understand. Only so many hours in the day and I have a couple hot work projects at the moment

@RodolfoGS
Copy link

RodolfoGS commented Nov 10, 2021

@mikehardy I've a question regarding to: one of the reasons to do a native module wrapper vs pure JS is...

The previous library (@react-native-firebase/admob) was a "native module wrapper" or a "pure JS"? And the new library will be "native wrapper" or "pure js"? So, the future library will work with the same architecture or will be different?

Thanks

PD: Thank you so much for your hard work!

@mikehardy
Copy link
Collaborator

Hi @RodolfoGS - the previous incarnation of admob in @react-native-firebase/admob was a native module wrapper, yes. If you just want JS you can probably do that right now without waiting on anyone :-), but it won't have any native integrations

@Pingou
Copy link

Pingou commented Nov 24, 2021

@mikehardy Any update? I understand you must be very busy, I'm just wondering if I should wait out a bit more or switch to another package.

@dylancom
Copy link
Contributor

dylancom commented Dec 4, 2021

I submitted a few PR's which makes the new repo usable (at least on iOS). For the time being (no npm package yet) it can be added to your projects package.json using: "react-native-google-ads": "github:invertase/react-native-google-ads".

Thanks for getting those in fast @mikehardy!

@mikehardy
Copy link
Collaborator

Happy to help! Thanks for helping get out the door. Sorry I did not have the time but I do want to make it clear that the goal is for the package to be alive, and I will look at and merge any PRs that help get it there, as I have with those from @dylancom :-)

@mikehardy
Copy link
Collaborator

The new repo is alive and updated to the latest SDKs for AdMob now. It's still moving very quickly and you should test carefully before deploying on it, but it's alive. I'm going to close this, cheers

@mikehardy mikehardy changed the title [📚] AdMob documentation availability [📚] AdMob - use @invertase/react-native-google-ads Dec 13, 2021
@Ronald3217
Copy link

This came up as a comment on an unrelated issue and I think I may understand the confusion now - pasting in my comment from there:

Ah - sorry, we've already merged the change where Admob is removed from firebase following it's removal upstream, and the documentation site goes live immediately after merges to main branch.

It is not as great of an experience but for now until we have the admob code re-hosted in a non-firebase repo you can go direct to the usage docs and types / API reference from the v11.5.0 (current stable) tag

https://github.com/invertase/react-native-firebase/tree/v11.5.0/docs/admob https://github.com/invertase/react-native-firebase/blob/v11.5.0/packages/admob/lib/index.d.ts

Normally it's a great thing that the docs site is updated immediately between releases, but in this case it means the documentation for a module that is still live (and will always be, in that version) is gone. I'll have to think on that to see if there's some better way we can keep docs for old versions alive as they are still quite useful

Do you have any idea if it is being updated, or are you planning to update the library in the future? version 11.5.0 is the latest stable version and it works perfectly, but I have doubts if updating the @react-native-firebase/app core to version 14.5.0 makes the application stop working.

Have you used admob v11.5.0 with app v14.5.0?
or is this not possible? Sorry for the question, it may sound a bit silly.

@mikehardy
Copy link
Collaborator

@Ronald3217 you are in luck! It was peeled out to https://github.com/invertase/react-native-google-mobile-ads and has gone through a few revisions so it is all up to date, it now appears to be stable and we're consolidating the rest of the react-native admob packages in to it (by working with / collaborating with their maintainers)

Go grab that package and move forward with admob, fully separate from Firebase

@mikehardy
Copy link
Collaborator

mikehardy commented Feb 21, 2022

Oh, and as for versioning, never mix versions of react-native-firebase: https://invertase.io/blog/react-native-firebase-versioning

@Ronald3217
Copy link

@Ronald3217 you are in luck! It was peeled out to https://github.com/invertase/react-native-google-mobile-ads and has gone through a few revisions so it is all up to date, it now appears to be stable and we're consolidating the rest of the react-native admob packages in to it (by working with / collaborating with their maintainers)

Go grab that package and move forward with admob, fully separate from Firebase

i am working with @react-native-firebase/app and @react-native-firebase/admob versions 11.5.0 (in released apps) but building one and using firestore and app v14.5.0.

From what I understand you no longer recommend working with the /admob module and instead use react-native-google-mobile-ads (because I've been using the /admob module for a long time and I'm used to its implementation) but it is better implement the new library, I'll have to learn how to use it.

@birdofpreyru
Copy link

birdofpreyru commented Feb 21, 2022

@Ronald3217 https://github.com/invertase/react-native-google-mobile-ads, as of its v4.2.0 is just react-native-firebase/admob module split into a standalone package, with a bunch of updates / fixes done on the way. You won't have to learn how to use it, just carefully rename library imports and config files in your source code, and maybe do a few other minor changes according to the changelog.

RN Firebase 11.5.0 is almost one year old at this point, still using it you are probably missing some performance / features because of older underlying SDKs, and keep around some bugs fixed since then.

@Ronald3217
Copy link

@Ronald3217 https://github.com/invertase/react-native-google-mobile-ads, as of its v4.2.0 is just react-native-firebase/admob module split into a standalone package, with a bunch of updates / fixes done on the way. You won't have to learn how to use it, just carefully rename library imports and config files in your source code, and maybe do a few other minor changes according to the changelog.

RN Firebase 11.5.0 is almost one year old at this point, still using it you are probably missing some performance / features because of older underlying SDKs, and keep around some bugs fixed since then.

Reading the documentation, I don't see that dependencies need to be implemented in build.gradle app and project.
I just have to install it, add app.json and implement it as it says in the documentation?

Thanks in advance for taking the time to respond.

@birdofpreyru
Copy link

Yeah, just follow the docs. I believe, there is nothing to do in gradle config for this lib.

@Ronald3217
Copy link

@mikehardy thank you very much, have a nice afternoon.

@Ronald3217
Copy link

Yeah, just follow the docs. I believe, there is nothing to do in gradle config for this lib.

Hello, I have a question for you, have you implemented the new library https://docs.page/invertase/react-native-google-mobile-ads? I've been trying all day but I couldn't.

I have sdk 29, do you think that is the problem. If so, which one should I use?

@mikehardy
Copy link
Collaborator

@Ronald3217 if you have a problem with that library, please post in that library. Prior to doing so, please examine the example app (and/or the example construction script - it's scripted: https://github.com/invertase/react-native-google-mobile-ads/blob/main/refresh-example.sh) to make sure you are following best practices and that your local environment is not busted in some way

@sdb1228
Copy link

sdb1228 commented Feb 28, 2022

I know this is closed but @mikehardy and Team over at invertase have done a fantastic job with the new admob package and made migrating from this package super simple (removed firebase admob from package.json cleared dependencies for ios and node_modules reinstalled and added my app id to my app.json) I personally strongly encourage anyone who hasn't yet migrated to do so. Thanks again to @mikehardy and team for putting for the effort to keep this package running.

@Salakar Salakar unpinned this issue Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: good-first-issue Issues that are non-critical issues & well defined for first time contributors.
Projects
None yet
Development

No branches or pull requests