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

feature request: admob #79

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

feature request: admob #79

birdchan opened this issue Dec 13, 2016 · 17 comments

Comments

@birdchan
Copy link

Add admob support, or other types of ads.

@wajahatch888
Copy link
Contributor

+1

2 similar comments
@lukeramsden
Copy link
Contributor

+1

@jkkorn
Copy link

jkkorn commented Dec 20, 2016

+1

@wajahatch888
Copy link
Contributor

wajahatch888 commented Dec 26, 2016

Pull Request :)

@gliechtenstein
Copy link
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
Copy link
Contributor

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

@lukeramsden
Copy link
Contributor

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

@wajahatch888
Copy link
Contributor

@lukeramsden , That would be Awsome 👍

@birdchan
Copy link
Author

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

@gliechtenstein
Copy link
Contributor

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

@lukeramsden
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link
Contributor

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

@lukeramsden
Copy link
Contributor

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
Copy link
Contributor

@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
Copy link
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
Copy link
Contributor

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants