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

feature request: admob #79

Closed
birdchan opened this Issue Dec 13, 2016 · 17 comments

Comments

Projects
None yet
5 participants
@birdchan

birdchan commented Dec 13, 2016

Add admob support, or other types of ads.

@wajahatch888

This comment has been minimized.

Contributor

wajahatch888 commented Dec 16, 2016

+1

2 similar comments
@lukeramsden

This comment has been minimized.

Contributor

lukeramsden commented Dec 17, 2016

+1

@jkkorn

This comment has been minimized.

jkkorn commented Dec 20, 2016

+1

@wajahatch888

This comment has been minimized.

Contributor

wajahatch888 commented Dec 26, 2016

@gliechtenstein

This comment has been minimized.

Contributor

gliechtenstein commented Dec 28, 2016

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Thanks to @wajahatch888 we now have Ad support on iOS Jasonette! Just like the rest of Jasonette, you can add/remove AdMob ads simply by specifying them in the JSON markup. More on the syntax below, but first, here's an adhoc "howto" instruction (Official documentation coming soon):

One thing to keep in mind: Ads are not enabled by default, so you must enable them. To enable, follow the following steps:

  1. Download the latest version of Jasonette from develop branch and unzip: https://github.com/Jasonette/JASONETTE-iOS/archive/develop.zip
  2. Download CocoaPods app from here: https://cocoapods.org/app
  3. Run CocoaPods app. From the app menu, open File > Open Podfile. Then find the project folder you just unzipped. From the project folder, go into app folder and you should see a file called Podfile. Select that file and open it from CocoaPods app. You should see this screen:

screen shot 2016-12-28 at 7 12 59 am

  1. Uncomment the pod 'GoogleMobileAds', '~> 7.8' line (By removing the # character) and press the install button at the top right corner. The install will start. After that you'll see the following screen:

screen shot 2016-12-28 at 6 45 36 am

Notice the green Installing GoogleMobileAds line from above screenshot. That means the library has been successfully installed into the project and you can use it.

  1. Now from Finder, go to your project root folder and run Setup and walk through the setup process just like any other Jasonette project.

  2. One last thing, you need to turn on the Ad feature from the code as well. To do this, open Jasonette > Config > Constants.h file from XCode, Uncomment the line: #define ADS 1 (by removing the //). The result should look something like this:

screen shot 2016-12-28 at 6 54 53 am

And that's it! You're good to go. You can now summon ads by using the following syntax:

{
 "$jason": {
   "body": {
     ..
     "ads": [{
       "type": "admob",
       "options": {
         "type": "banner",
         "unitId": "a14dccd0fb24d45"
       }
     }, {
       "type": "admob",
       "options": {
         "type": "interstial",
         "unitId": "ca-app-pub-6606303247985815/7014816684"
       }
     }]
   }
 }
} 

Check out this Github issue thread to learn more #92 (comment)

@wajahatch888 please correct me if I got anything wrong.

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

@wajahatch888

This comment has been minimized.

Contributor

wajahatch888 commented Dec 28, 2016

@gliechtenstein , You have covered each and every point in detail. 👍

@lukeramsden

This comment has been minimized.

Contributor

lukeramsden commented Dec 28, 2016

I'll do some work of the documentation when I get home 🎉🎉🎉

@wajahatch888

This comment has been minimized.

Contributor

wajahatch888 commented Dec 28, 2016

@lukeramsden , That would be Awsome 👍

@birdchan

This comment has been minimized.

birdchan commented Dec 28, 2016

thanks @wajahatch888 and @gliechtenstein for the hard work, I can keep my apps free now. =)

@gliechtenstein

This comment has been minimized.

Contributor

gliechtenstein commented Dec 28, 2016

@birdchan please try out and let us know if things don't work as expected! 🎉

@lukeramsden

This comment has been minimized.

Contributor

lukeramsden commented Dec 29, 2016

@gliechtenstein @wajahatch888 Alright, I'm working on the docs. So, theres 2 types of ads, right? banner and interstial (spelled wrong, its interstitial). And how does the unitID format work? I'm not familiar with admob, is there more than one format for unitID (or can they put whatever they want in it and it just gets sent regardless)?

@lukeramsden

This comment has been minimized.

Contributor

lukeramsden commented Dec 29, 2016

After looking at the code, there is a footer ad aswell, does that use any more specific options? Does it have to go inside a specific view?

@lukeramsden

This comment has been minimized.

Contributor

lukeramsden commented Dec 29, 2016

Do you think you could come up with an example app for me to see how it should look?

@lukeramsden

This comment has been minimized.

Contributor

lukeramsden commented Dec 29, 2016

After some testing, I can't get it to work. Do you think you could send me a screenshot of it in action for the docs?

@wajahatch888

This comment has been minimized.

Contributor

wajahatch888 commented Dec 29, 2016

@lukeramsden , When you create Admob ad (Banner/ interstitial) on https://apps.admob.com/ they give you unitId e.g ca-app-pub-6606303247985815/7014816684. This unitId is string type.
footer ad is actually banner. It always shows on bottom of screen. If json has body.footer then banner ad will appear above footer.
Have you followed all the steps which @gliechtenstein mentioned above? or do you need json url to make it work?

@wajahatch888

This comment has been minimized.

Contributor

wajahatch888 commented Dec 29, 2016

@lukeramsden , You can use following json to show ad in your app after doing above steps.
https://jasonbase.com/things/BmP.

Screenshots

Banner Ad

bannerad

Interstitial Ad

interstitialad

@gliechtenstein

This comment has been minimized.

Contributor

gliechtenstein commented Dec 30, 2016

@lukeramsden if you ever get it to work, please let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment