Skip to main content

3 posts tagged with "cordova"

View All Tags

Release 1.0

· 3 min read

It is a long way to reach the 1.0 release.

480 commits, 730 files changed, 16341 insertions(+), 24085 deletions(-)

1.0 is a serious rewrite of its internals and APIs to utilize the recently updated and upcoming Google AdMob SDK.

Apart from the usual Cordova plugin, AdMob Plus is now officially providing plugins for Ionic and Capacitor v3.

Cordova Plugin

Package of Cordova plugin has been renamed from cordova-admob-plus to admob-plus-cordova. This keeps @ionic-native/admob-plus working without breaking.

cordova-admob-plus is now deprecated in favor of the new plugin, Ionic users should transit to use @admob-plus/ionic for the latest improvements.

Documentation

TypeScript Support

admob-plus-cordova exports types for TypeScript projects.

Use Triple-slash directives to have global admob object typed,

/// <reference types="admob-plus-cordova" />

Regular import works too,

import { BannerAd } from 'admob-plus-cordova'

let banner: BannerAd

Multiple Ad Instances

It is now to manage multiple instances of the same ad format, thanks to the new API design.

const banner1 = admob.BannerAd({...})
const banner2 = admob.BannerAd({...})

Rewarded Interstitial Ad

As part fo utilizing the SDK, new ad format Rewarded Interstitial Ad is added.

App Tracking Transparency

requestTrackingAuthorization() was part of cordova-plugin-consent, is now moved to admob-plus-cordova,

admob.requestTrackingAuthorization()

While you could consider using it or not, this makes ATT integration much easier.

API Docs

API docs are automatically generated from source code to provide up-to-date reference to classes, methods and interfaces.

Ionic Plugin

The Ionic community has maintained @ionic-native/admob-plus for some time, it is hard to keep changes in sync with wrapping Cordova plugin due to the difference of release cycle.

By officially maintaining the Ionic plugin @admob-plus/ionic, the API and documentation will always be up-to-date.

Documentation

Capacitor Plugin

Capacitor 3 is around the corner, @admob-plus/capacitor provides familiar AdMob Plus APIs for those want to try it out.

Documentation

GitHub Sponsors

I have setup the Funding page since the project start to subsidize my open source work.

By adding GitHub Sponsors option, I wish there will be more recurring support.

Thank You

I would like to take the chance to say thank you to all contributors, especially to all sponsors supporting my work financially.

  • @krunalsk007
  • @shonek007
  • Aleh Belko
  • Amir
  • chawalit sittichai
  • Damien
  • EMI SANIMAN
  • guiñotepro
  • Ivan Lopez
  • J. Rafael
  • José Manuel Alarcón Lombardo
  • Leon Raymond Calcutt
  • Oliver
  • RyanDev Studio
  • stefan sprenger
  • titroo team Tasos, Kostis, Fotis
  • Vanilla
  • Varun Ramesh
  • Vincent Lepski
  • 김동규

(Names are sorted by alphabetical order)

How cordova-plugin-admobpro works

· 4 min read

I believe most cordova-plugin-admobpro users do not know how the plugin works, as the author does not explain it or intentionally hide it. This blog post is going to uncover the details, so users could have better understanding about what is added to their projects.

cordova-plugin-extension

When looking at the repository, it looks like a normal cordova plugin repository, where source code are src and www.

Until you read the source code line by line, you will find the native plugin classes are inherited from com.rjfun.cordova.ad.GenericAdPlugin and GenericAdPlugin, which are come from cordova-plugin-extension.

The author has removed the source repository which results the npm page pointing to a broken link in GitHub. This should prevent a normal user finding out the content, but an advanced user could still check the npm tarball content.

The plugin has included 2 suspicious binary files, cordova-generic-ad.jar and libCordovaGenericAd.a. Clearly, they are providing the base native plugin classes.

Phoning home

Since the base classes are coming from binray files, it is hard to know what they are doing. However, when trying to inspect the network requests with the plugin installed, it tells more. A HTTP request is sent after the app starts,

POST http://adlic.rjfun.com/adlic HTTP/1.1
Host: adlic.rjfun.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Demo/1.0.0 CFNetwork/901.1 Darwin/17.7.0
Accept-Language: en-us

app=com.rjfun.demo&os=ios&net=admob&lic=

It returns a JSON data,

{"r": 0, "b": "", "i": "", "n": "", "v": "", "js": ""}

At this point, it is clear the plugin collecting your app info to the author owned server and response data for the plugin to consume. A guess usage would be checking the license, but the author never mentions it in the documentation.

Remote controlling ads

Thanks to a document shared by a user (the original link is broken: https://drive.google.com/file/d/0B5vtpya8P4b-NUZTdUhBVkFlU0E/view), it revealed more about the black magic.

From the user,

i am using your plugin in my app. I have never use any license key. I wanted to share 2% of my ad. BUT! Your plugin took 30% of my ad.

From the plugin author,

After check, we find your app in the black list, and a random higher rate will be applied. Usually when a guy is using a fake license key, or send unusual attacking request (for example, request not from iOS/android cordova platform), the ant­crack logic will be triggered and move the app into the black list.

As mentioned in the license agreement, if you have earned more than $1000, a valid license is required, or else some ad sharing will be applied. When you use my code in your app, you are assumed to accept the license agreement. If you did not accept my term, then you are not allowed to use my code without permission.

Second, the ad sharing rate is not as what you guess. You may not know that, for any new app, the ad sharing is 0% from beginning, not 2%. When the system calculate your earning exceed $1000, if no license key is still provided, it will start to applied 2% ad sharing. But, when unusual request detected, it will increase the rate bit by bit, but no more than 30%.

The plugin has ability to control how much ad-sharing from the server, and will increase ad-sharing according to some undocumented conditions. The author claims it will not share more than 30% ad revenue.

Conclusion

The author of cordova-plugin-admobpro has using a very sophisticated approach to do ad-sharing without telling much details it, or writing a very detailed document to promote his plugin, but not mentioning the ad-sharing part. It is hard judge if it is an issue of honesty, but I don't think it aligns the spirit of open source.

With the increasing adoption of cordova-plugin-admob-free, I wish there is an enough momentum to finance a sustainable and trustable AdMob plugin.

If you do have to stick with cordova-plugin-admobpro, consider adding analytics whenever displaying ads to compare it with you ad display count, so as least you know how much is lost.

History of cordova-plugin-admob-free

· 2 min read

2 years ago, I have a cordova project needed to add Google AdMob for showing ads. I was searching an open source solution, soon landed to the popular cordova-plugin-admobpro.

Research

As my typical practice of choosing a open source project, apart from looking at Github stars and package download count, I would read the source code to evaluate the code quality and check past issues and pull requests for how well a project is maintained.

Like most Cordova Plugins, the code is written to be just work, not for read or extend. However, I was alerted when I was inspecting the source of its dependency, cordova-plugin-extension. I found 2 binary files were used, cordova-generic-ad.jar for Android and libCordovaGenericAd.a for iOS.

Then I searched through the documentation for explaination about the binary files, the author said nothing about them, but I found the pruchase license option, so it is very like some license verification code. After I run it under network monitoring, I discovered that the plugin is sending application information to http://adlic.rjfun.com/adlic to retrive Ad Unit ID. Searching the URL in the issue track reveals that a user reported lose revenue and the author explained it was some server bugs.

At this point, I have lost trust to the author, I started searching other solutions. Interestingly, there is no completely free and open source solution, many are doing ad-sharing without telling their users.

Fork

I then decided to fork a relative high quality plugin with the ad-sharing code removed, I picked cordova-plugin-admob-simple as it has the most recent commit at that time. Just 2 weeks after I had working on my fork version, cordova-plugin-admob author (the same author of cordova-plugin-admobpro) was claiming his credit.

As a result, cordova-plugin-admob-free becomes a fork of cordova-plugin-admob-simple and cordova-plugin-admob.

Next

AdMob Plus, being the successor of cordova-plugin-admob-free, is continue to be free and open source. Instead of stealing your revenve, I ask funding explictily, but you don't have to pay to enjoy all features.