ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

ITM-90809 IOS Deprecated API Usage #418

Open pirpy76 opened 4 years ago

pirpy76 commented 4 years ago

When I send my application for IOS to app store, I receive this message:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of app updates that use UIWebView APIs starting from December 2020. See https://developer.apple.com/documentation/uikit/uiwebview for more information

I tried to send app, removing only admob-free plugin and the above message disappeared; so, it's obviously admob-free plugin creates the issue.

Please update your plugin, removing all references to UIWebView and using the new Admob SDK version, that removes any reference to UIWebView

francoisduchemin commented 4 years ago

I can confirm the issue. Everytime I upload my iOS app to the App Store, I get the following email:

App Store Connect: Your app (...) has one or more issues
ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of app updates that use UIWebView APIs starting from December 2020. See https://developer.apple.com/documentation/uikit/uiwebview for more information. 

If I remove cordova-plugin-admob-free, then I don't receive this e-mail anymore:

cordova plugin remove cordova-plugin-admob-free

It looks like this is due to the fact that the plugin uses an older version of the Google AdMob SDK (7.42.1): https://gitlab.com/ratson/cordova-admob-sdk

The Mobile Ads SDK (iOS) release notes show that all references to UIWebView have been removed in the version 7.55.0: https://developers.google.com/admob/ios/rel-notes

However, I'm not 100% sure if the newest version (7.57.0) fixes the problem... see https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/QuZMbjIyxn8

pirpy76 commented 4 years ago

I think that ADMOB SDK is the problem, and until Google ADMOB SDK team doesn't solve the problem, the plugin will cause App Store ISSUE. But, I think that Google will solve it in a few days, because if they don't, no more IOS apps with ADMOB will be approved....

francoisduchemin commented 4 years ago

Yes the Mobile Ads SDK is definitely the issue. It looks like the last version (7.57.0) still doesn't fix the issue... so I guess we have to wait for Google to fix it!

The problem is that the App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020 (see https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/).

sergip76 commented 4 years ago

It seems that version 7.55 of Admob SDK removed all references to UIWebView: 7.55.0 | 2020‑02‑04 | Removed all references to UIWebView. UIWebView is no longer supported.

https://developers.google.com/admob/ios/rel-notes

Which Admob SDK version does this plugin use?

francoisduchemin commented 4 years ago

I have also received an email from Google indicating that "all the GMA SDK versions including and after 7.55.0 released on Feb 4th, 2020, default to WKWebview and have removed UIWebView entirely".

This plugin uses an older version of the Google AdMob SDK (7.42.1): https://gitlab.com/ratson/cordova-admob-sdk

sergip76 commented 4 years ago

In that case, we have to wait for an update of this plugin in order to use it in new iOS apps :-(

pedrumgolriz commented 4 years ago

Can we get an eta on this? I'm unable to add my apps to the app store

sergip76 commented 4 years ago

Nor do I. But the only alternative at the moment is admob-plus. It uses a recent version of Admob SDK. I would like to implement this plugin, but I have just tested and I think it has still too many bugs for a production purpose.

francoisduchemin commented 4 years ago

Indeed. It looks like admob-plus uses the version 7.57: https://github.com/admob-plus/admob-plus/blob/master/packages/cordova/plugin.xml

I guess a merge request is needed for cordova-admob-sdk and then a pull request for cordova-plugin-admob-free... @ratson seems to be quite active on the admob-plus project.

stionic commented 4 years ago

For now I think we can download SDK from Google then replace in cordova-admob-sdk plugin. But it is good if ratson update this plugin.

I tried admob-plus so many time and it still have bugs (also make app size bigger because of swift) so I required use admob-free plugin.

pirpy76 commented 4 years ago

For now I think we can download SDK from Google then replace in cordova-admob-sdk plugin. But it is good if ratson update this plugin.

I tried admob-plus so many time and it still have bugs (also make app size bigger because of swift) so I required use admob-free plugin.

It's so simple to solve the problem? Download and replace admob SDK? Where is located in the app directory?

stionic commented 4 years ago

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

================== Update 2021/02/20

Current Google released new Admob SDK 8. This comment mention version 7.67 If you have problem when replace with new SDK please try download old version here

https://dl.google.com/dl/cpdc/b7bc0f4694d26380/Google-Mobile-Ads-SDK-7.67.0.tar.gz

found above link from Cocoapods (https://github.com/CocoaPods/Specs/blob/master/Specs/5/9/a/Google-Mobile-Ads-SDK/7.67.0/Google-Mobile-Ads-SDK.podspec.json)

pedrumgolriz commented 4 years ago

@stionic is readding the platform necessary? Shouldn't ionic cordova ios prepare suffice?

sergip76 commented 4 years ago

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

It works for me!!

After doing the changes that @stionic suggests I have tried it with a banner ad and an interstitial ad. They both shows correctly and I could upload the app to the Test Flight without problems with UIWebview.

Thanks @stionic

pirpy76 commented 4 years ago

it didn't work for me. I tried to follow

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

it didn't work for me. I tried to follow your steps, but after submission I received "ITMS-90809: Deprecated API Usage" message.

mmysgr commented 4 years ago

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

It definitely works. Thanks!

stionic commented 4 years ago

it didn't work for me. I tried to follow your steps, but after submission I received "ITMS-90809: Deprecated API Usage" message.

It mean your project have other plugins using UIWebView.

You can check follow:

Also search more about your plugins list.

sergip76 commented 4 years ago

it didn't work for me. I tried to follow your steps, but after submission I received "ITMS-90809: Deprecated API Usage" message.

Try inserting this lines: <feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> <preference name="WKWebViewOnly" value="true" />

between: <platform name="ios"> </platform>

gbrits commented 4 years ago

Hi guys, thanks for providing answers in regard to fixing this - however, just adding the admob free plugin adds the UI framework to the build frameworks which then causes the deprecation notice. I am confident it is only the admob-free plugin that is adding the UI kit because it isn't present before installation and is present after installation. Any tips on this? Has anyone submitted an app with admob-free included (in an Ionic / Flutter etc Hybrid app) without deprecation notices?

sergip76 commented 4 years ago

Hi guys, thanks for providing answers in regard to fixing this - however, just adding the admob free plugin adds the UI framework to the build frameworks which then causes the deprecation notice. I am confident it is only the admob-free plugin that is adding the UI kit because it isn't present before installation and is present after installation. Any tips on this? Has anyone submitted an app with admob-free included (in an Ionic / Flutter etc Hybrid app) without deprecation notices?

I have already submited several apps to App Store this month, using admob-free plugin, and I hadn't any problem with UIView. I did the changes suggested here. I don't use Ionic, just Apache Cordova, but I think it works for both.

Be sure you do the changes suggested for cordova-admob-sdk plugin (installed with admob-free plugin). That's the most important thing to do.

gbrits commented 4 years ago

Thank you @sergip76 and @mmysgr - I can confirm that the most important step is to replace the SDK bundle for now. (And also the config adjustments, <preference name="WKWebViewOnly" value="true" />)

1.) Download .zip package file from https://developers.google.com/admob/ios/download 2.) Remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework Extract folder and copy (from .zip) GoogleMobileAds.framework to replace it at /plugins/cordova-admob-sdk/src/ios/ 3.) Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

A submission right before updating this folder, even with the config.xml changes still turned up with rejection, but after I updated the framework via the zip file and submitted again it accepted it. :)

heinrichcoetzee commented 4 years ago

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

14 Builds Later and then read this comment. This worked for me. Thanks so much.

Would be great if this can be fixed in a next release or something

jarodms commented 3 years ago

I use a cloud CI/CD server so manually updating the plugin in my project didn't seem like an option from what I could tell.

So I created my own git repos for cordova-admob-sdk and cordova-plugin-admob-free, then updated them with 7.63.0 of Google Mobile Ads SDK. Next I just added it like any other cordova plugin using the git url. Works fine so far when building for iOS and Android. App was submitted successfully to Apple. I'll let you know if anything breaks or gets denied.

https://github.com/jarodms/cordova-admob-sdk https://github.com/jarodms/cordova-plugin-admob-free

XavM commented 3 years ago

@jarodms : we gave a try to your fork, and we don't get the UIWebView "ITMS-90809: Deprecated API Usage" anymore when publishing to the AppStore; Nice job !!


By the way, and not sure this is related, but when trying to load an Ad (Interstitial or Banner) using our own adUnit, we always receive the event "LOAD_FAIL" with error: "(null)" on iOS, and error: 3, reason: "No fill" on Android

Using the Google test adUnits works fine (‘ca-app-pub-3940256099942544/1033173712’ and ‘ca-app-pub-3940256099942544/4411468910’)

We can see the ad requests received increase on the AdMob Report, but the match rate is still 0

Anyone having the same issue ?

UPDATE 08/27/2020 : The "LOAD_FAIL" issue only occurs on one of our App / Bundle ID and when further testing jarodms:admob-free with some other of our Apps (same AdMob publisher id / adUnit), we can load ads (test and prod mode) with success <- it must be something about our App config / ranking / whatever_on_the_AdMob side that we still need to investigate, but admob-free has nothing to do with the "LOAD_FAIL" issue

PabloVortex commented 3 years ago

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

Thank you! This workaround works for me. I also require to use AdmobFree.

I encountered another issue with NSBluetoothAlwaysUsageDescription because of this plugin. You can simply remove CoreBluetooth from your project in Xcode (another manual action) if you don't use Bluetooth. More detailed answer here https://github.com/ratson/cordova-plugin-admob-free/issues/396

I also see that some folks still have issues. I'm not sure if all guys use Ionic, but if yes then be sure to follow Ionic manual for ITMS-90809 as well https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/

Happy coding!

rafaellop commented 3 years ago

How about requesting app tracking transparency authorization for IDFA access which would be required for iOS 14 distribution?

Starting in iOS 14, IDFA will be unavailable until an app calls the App Tracking Transparency framework to present the app-tracking authorization request to the end user. If an app does not present this request, the IDFA will automatically be zeroed out which may lead to a significant loss in ad revenue. https://developers.google.com/admob/ios/ios14

While modification of the Info.plist is easy a call to the ATTrackingManager.requestTrackingAuthorization is required. I'm not keen on iOS native development, but the code for calling the request is:

#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
...
- (void)requestIDFA {
  [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
    // Tracking authorization completed. Start loading ads here.
    // [self loadAd];
  }];
}

Maybe someone better in native could provide a PR for this?

martijnmichel commented 3 years ago

if you use this forked update it includes the tracking auth and an update to the SDK https://github.com/tomitank/cordova-plugin-admob-tomitank

lookang commented 3 years ago

I use a cloud CI/CD server so manually updating the plugin in my project didn't seem like an option from what I could tell.

So I created my own git repos for cordova-admob-sdk and cordova-plugin-admob-free, then updated them with 7.63.0 of Google Mobile Ads SDK. Next I just added it like any other cordova plugin using the git url. Works fine so far when building for iOS and Android. App was submitted successfully to Apple. I'll let you know if anything breaks or gets denied.

https://github.com/jarodms/cordova-admob-sdk https://github.com/jarodms/cordova-plugin-admob-free

how do i run in my ionic project, your new cordova-plugin-admob-free? is it still? $ ionic cordova plugin add cordova-plugin-admob-free --save --variable ADMOB_APP_ID="ca-app-pub-0121577198857509~3332380085" or $ ionic cordova plugin add https://github.com/ratson/cordova-plugin-admob-free/ --save --variable ADMOB_APP_ID="ca-app-pub-0121577198857509~3332380085" or $ ionic cordova plugin add https://github.com/jarodms/cordova-plugin-admob-free --save --variable ADMOB_APP_ID="ca-app-pub-0121577198857509~3332380085"

i mean i dont understand how to reference the new version https://github.com/jarodms/cordova-plugin-admob-free

mnapoli76 commented 3 years ago

@lookang

I am using Ionic with Capacitor and use npm to install cordova plugin with the following syntax (the trick is the git+ part before the git url):

npm install git+https://github.com/jarodms/cordova-plugin-admob-free

I think the same syntax can be used with cordova plugin add... hope this helps.

jarodms commented 3 years ago

Correct. ionic cordova plugin add git+https://github.com/jarodms/cordova-plugin-admob-free

meetapp2017 commented 3 years ago

it works - Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

but real ads not show only test ads work ?? help?

piyushysoft commented 3 years ago

@pirpy76 yeah, simple download .zip package file from https://developers.google.com/admob/ios/download

In your project remove /plugins/cordova-admob-sdk/src/ios/GoogleMobileAds.framework

Extract file .zip downloaded and copy GoogleMobileAds.framework to /plugins/cordova-admob-sdk/src/ios/

Remove ios platform and add again: ionic cordova platform rm ios ionic cordova platform add ios

Done!

@stionic I follow all step then all getting issue of ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of app updates that use UIWebView APIs starting from December 2020. See https://developer.apple.com/documentation/uikit/uiwebview for more information.

Also another thing in zip download from link but not get same name folder on that sdk like "GoogleMobileAds.framework" Current have "GoogleMobileAds.xcframework" this name folder sdk download.

Untitled

Please let me help what's I should do now for resolve this issue ?

piyushysoft commented 3 years ago

I use a cloud CI/CD server so manually updating the plugin in my project didn't seem like an option from what I could tell.

So I created my own git repos for cordova-admob-sdk and cordova-plugin-admob-free, then updated them with 7.63.0 of Google Mobile Ads SDK. Next I just added it like any other cordova plugin using the git url. Works fine so far when building for iOS and Android. App was submitted successfully to Apple. I'll let you know if anything breaks or gets denied.

https://github.com/jarodms/cordova-admob-sdk https://github.com/jarodms/cordova-plugin-admob-free @jarodms

I try with this in my project not getting plugin in project. getting issue of install

Please guide me how to install your plugin using git URL.

jarodms commented 3 years ago

@piyushysoft The git command is in previous comments. Did you try that?

piyushysoft commented 3 years ago

@piyushysoft The git command is in previous comments. Did you try that?

Yes I try it not install plugin in ios.

jarodms commented 3 years ago

Please provide more detail, error message, or context. Thanks!

stionic commented 3 years ago

@piyushysoft previous version is 7. current 8. it seem Google has huge update their Admob SDK. I am trying find what different ;)

stionic commented 3 years ago

@piyushysoft

Updated old comment, you can try old version 7.67 https://dl.google.com/dl/cpdc/b7bc0f4694d26380/Google-Mobile-Ads-SDK-7.67.0.tar.gz

Please try it and check Ads show or not, because it is old SDK version.

piyushysoft commented 3 years ago

@piyushysoft

Updated old comment, you can try old version 7.67 https://dl.google.com/dl/cpdc/b7bc0f4694d26380/Google-Mobile-Ads-SDK-7.67.0.tar.gz

Please try it and check Ads show or not, because it is old SDK version.

First thing I not any issue with ads show or not. first thing we require to upload app with out issue of UIWebView. This version 7.67 is using UIWebView OR WKWebView ? How I over came that issue. Please guide me. How to resolve this using this plugin in ios.

piyushysoft commented 3 years ago

@piyushysoft

Updated old comment, you can try old version 7.67 https://dl.google.com/dl/cpdc/b7bc0f4694d26380/Google-Mobile-Ads-SDK-7.67.0.tar.gz

Please try it and check Ads show or not, because it is old SDK version.

@stionic

I have updated like same but getting same warning message on ios app upload.

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

piyushysoft commented 3 years ago

@stionic

================== Update 2021/02/20

Current Google released new Admob SDK 8. This comment mention version 7.67 If you have problem when replace with new SDK please try download old version here

https://dl.google.com/dl/cpdc/b7bc0f4694d26380/Google-Mobile-Ads-SDK-7.67.0.tar.gz

found above link from Cocoapods (https://github.com/CocoaPods/Specs/blob/master/Specs/5/9/a/Google-Mobile-Ads-SDK/7.67.0/Google-Mobile-Ads-SDK.podspec.json)

================================================================================ I am try with on today and before one week still getting issue of UIWebView. ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Please Guide how we can resolve this issue.

edf8b420-9a06-476c-9b8d-e7dfd85ad970

rafaellop commented 3 years ago

Replace the files manually in all locations you find. Then grep and if not found rebuild and submit to the appstore.

piyushysoft commented 3 years ago

Replace the files manually in all locations you find. Then grep and if not found rebuild and submit to the appstore.

What i need to replace ?

rafaellop commented 3 years ago

For example the file you marked on your screen. I had the same issues. Just grepped, replaced SDK files and done.

piyushysoft commented 3 years ago

For example the file you marked on your screen. I had the same issues. Just grepped, replaced SDK files and done.

I already do it as per below step then also still getting warning "ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview)."

This comment mention version 7.67 If you have problem when replace with new SDK please try download old version here

https://dl.google.com/dl/cpdc/b7bc0f4694d26380/Google-Mobile-Ads-SDK-7.67.0.tar.gz

found above link from Cocoapods (https://github.com/CocoaPods/Specs/blob/master/Specs/5/9/a/Google-Mobile-Ads-SDK/7.67.0/Google-Mobile-Ads-SDK.podspec.json)

piyushysoft commented 3 years ago

For example the file you marked on your screen. I had the same issues. Just grepped, replaced SDK files and done.

Which Version SDK are you using for replace in admob?.

martijnmichel commented 3 years ago

Just use @ratson 's new version of this plugin admob-plus-cordova and you're all set.

piyushysoft commented 3 years ago

Just use @ratson 's new version of this plugin admob-plus-cordova and you're all set.

I just install this plugin and its getting me error in build app in ios. That's why I using admob free plugin.

piyushysoft commented 3 years ago

@martijnmichel I check with admob-plus its not working in current app. its getting error when I install this plugin in ios app.

Please guide me what i need to do for approved app on ios store.