ionic-team / cordova-plugin-ionic-webview

Web View plugin for Cordova, specialized for Ionic apps.
Apache License 2.0
486 stars 393 forks source link

The app references non-public selectors in Payload #209

Open azerturk opened 5 years ago

azerturk commented 5 years ago

I successfully submit the ipa file to the App Store using Application Loader. But it shows the warning - The app references non-public selectors in Payload ...: _setAlwaysRunsAtForegroundPriority:

Note: I'm using the ionic v1 and phonegap build service.

adrynov commented 5 years ago

Now seeing the same all of a sudden

mcondie commented 5 years ago

I'm seeing the same today with a build that isn't materially different from yesterday (I haven't run npm install or made any changes other than minor javascript changes). I'm wondering if it is a change in Apple's automated processing today.

BenSegni commented 5 years ago

me too.

anupamgovind1981 commented 5 years ago

Any updates. How to solve this issue?

flobiwankenobi commented 5 years ago

Does this mean you can't upload it to the App Store?

BenSegni commented 5 years ago

mine passed review, so as it's just a warning, might not be a massive thing to worry about.

michaelsampietro commented 5 years ago

Same error here. Got a warning message on the first try, but now I can't submit the app due to this.

abalad commented 5 years ago

same here image

ronaldborla commented 5 years ago

Any updates for this?

azerturk commented 5 years ago

mine also passed review and after i also uploaded the app several times then it shows same warning. Today i upload it again and there is not any warning messages.

mlynch commented 5 years ago

We released 4.0.0 which removes this API. I believe the 2.x release line was also updated to remove this API. Please update to the latest.

dotmarn commented 5 years ago

We released 4.0.0 which removes this API. I believe the 2.x release line was also updated to remove this API. Please update to the latest.

But i hope it doesnt have severe effect or some kind of rejection by Apple?

BenSegni commented 5 years ago

I can confirm that @mlynch 's post is correct, I have just uploaded to the store and warnings have been removed and it passed checks into the AppStore.

dotmarn commented 5 years ago

I can confirm that @mlynch 's post is correct, I have just uploaded to the store and warnings have been removed and it passed checks into the AppStore.

Do you mean without updating to v4 yet?

BenSegni commented 5 years ago

So follow these instructions:

  1. cordova plugin rm cordova-plugin-ionic-webview
  2. cordova plugin add cordova-plugin-ionic-webview@latest

Check that you are using the latest verion 4.0.0 (package.json) and then you can run your builds. The validation in XCode shows a successful check and then upload confirmation shows no warnings.

dotmarn commented 5 years ago

Thank you so much @BenSegni although i already uploaded to Apple store with the warnings won't it be rejected?

screen shot 2019-02-20 at 12 33 48 pm
BenSegni commented 5 years ago

No, they are just warnings and not failures (those are the issues you need to watch for), which you should see if you're using XCode. As mentioned before - further up the feed. These warnings haven't stopped publishing to production on the AppStore for me.

But if you follow the instructions in my previous comment (I have just done that today) - you will see the build flies through, with no warnings. :)

dotmarn commented 5 years ago

Thank you so much once again @BenSegni for the clear-cut explanation. I will definitely note this for future update.

BenSegni commented 5 years ago

You're welcome @dotmarn - the fixes are detailed in this plugins docs 'migrating to v4': https://github.com/ionic-team/cordova-plugin-ionic-webview this worked for me, so best of luck dude!

SimoneMSR commented 5 years ago

This is still an issue with the following settings cordova-plugin-ionic-webview : 4.1.1 cordova-ios : 5.0.1 ionic-angular : 3.9.2

I receive this after successfully uloading the ipa to App Store Connect

Dear Developer, We identified one or more issues with a recent delivery for your app,*****. Please correct the following issues, then upload again.

ITMS-90338: Non-public API usage - The app references non-public selectors in *****: _setAlwaysRunsAtForegroundPriority:. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. If you think this message was sent in error and that you have only used Apple-published APIs in accordance with the guidelines, send the app's Apple ID, along with detailed information about why you believe the above APIs were incorrectly flagged, to appreview@apple.com. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/Best regards,The App Store Team |   |   | Dear Developer,We identified one or more issues with a recent delivery for your app, "Vitruvio" 1.1 (1.1). Please correct the following issues, then upload again.ITMS-90338: Non-public API usage - The app references non-public selectors in Panatta Plus: _setAlwaysRunsAtForegroundPriority:. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.

If you think this message was sent in error and that you have only used Apple-published APIs in accordance with the guidelines, send the app's Apple ID, along with detailed information about why you believe the above APIs were incorrectly flagged, to appreview@apple.com. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/Best regards,

The App Store Team

Trafz commented 5 years ago

@SimoneMSR - https://stackoverflow.com/a/56934236 So change your webview from 4.1.1 to 4.1.0. Just tried it myself and it works.

SimoneMSR commented 5 years ago

The issue is not resolved doing

rm -R node_modules cordova-plugin-ionic-webview
rm yarn.lock
yarn
ionic cordova plugin remove cordova-plugin-ionic-webview
ionic cordova plugin add cordova-plugin-ionic-webview@4.1.0
rm -R www
ionic cordova build ios

Maybe there is another library causing the problem... I have

"cordova-android": "8.0.0",
"cordova-browser": "6.0.0",
"cordova-ios": "5.0.1",
"cordova-plugin-add-swift-support": "2.0.2",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-ionic": "^5.3.0",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "4.1.0",
"cordova-plugin-network-information": "2.0.1",
"cordova-plugin-qrscanner": "^3.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova.plugins.diagnostic": "^4.0.12"

So then, I will post this issue in the ionic repository.

kensodemann commented 5 years ago

@SimoneMSR - it has to be a plugin causing the problem, so it is not Ionic Framework related, so posting it in the Ionic repo would not be appropriate. If it is some other library, it would make the most sense for you to determine which library and post an issue in its repo.

Based on what you said you did above, however, it is very possible that you are still using the old plugin. You purged www, but that is the web app. What you really need to hit is the native app. There are two ways of doing this:

If you are on the latest version of the Ionic CLI (currently 5.2.1) you can do ionic repair --cordova (I forget when the --cordova option was added, but it was fairly recent).

If you are on an older version of the CLI, you should probably upgrade, you can still use it with your v3 app, but beyond that, you can do this manually as such:

  1. rm -rf plugins/ platforms/
  2. cordova prepare

That will purge your existing plugins and platforms and start you with fresh a fresh build of your native side stuff.

If you still have a problem after that, then grep your plugins directory looking for the plugin that is using the deprecated API.

After that, try your build again. You will have to re-setup your provisioning profile and whatnot in Xcode of course.

ilclaudio commented 5 years ago

I had the same error this morning with an app I've published a few days ago for the last time. After adding some bug fixes, this morning, I wasn't able to upload again the app.

I've solved with:

cordova plugin rm cordova-plugin-ionic-webview
rm -rf node_modules
cordova plugin add cordova-plugin-ionic-webview@4.1.0
npm installionic cordova build ios --prod 

I can confirm that @4.1.1 doesn't work.

I've removed the plugin: cordova.plugins.diagnostic because non used, but I don't think that was causing the problem.

mlynch commented 5 years ago

@jcesarmobile when you're back, looks like 4.1.1 is triggering some warnings here from the app store automated submission process

ackanir commented 5 years ago

I can confirm the issue. My application was refused from the Apple Store and I had this message: ITMS-90338: Non-public API usage - The app references non-public selectors in <app name>: _setAlwaysRunsAtForegroundPriority

It really seems to be related to webview, and not any other plugin. I have the issue with 4.1.1 but not with 4.1.0.

Trafz commented 5 years ago

@mlynch & @jcesarmobile - I think it's important to note that it's not only warnings anymore. It's refusals for some of us. The screenshot above states an ignorable warning, but the rest of us got our apps refused. Unable to even upload them because of this issue.

sachingarg05 commented 5 years ago

@remifleurance I don't see these lines in the latest code in this repo, or in the package published on NPM: https://unpkg.com/cordova-plugin-ionic-webview@4.1.1/src/ios/CDVWKWebViewEngine.m

In the latest code in 4.1.1, the call for _alwaysRunsAtForegroundPriority is base64 encoded:

    if(![settings cordovaBoolSettingForKey:@"WKSuspendInBackground" defaultValue:YES]){
        NSString* _BGStatus;
        if (@available(iOS 12.2, *)) {
            // do stuff for iOS 12.2 and newer
            NSLog(@"iOS 12.2+ detected");
            NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
            NSData* data  = [[NSData alloc] initWithBase64EncodedString:str options:0];
            _BGStatus = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        } else {
            // do stuff for iOS 12.1 and older
            NSLog(@"iOS Below 12.2 detected");
            NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
            NSData* data  = [[NSData alloc] initWithBase64EncodedString:str options:0];
            _BGStatus = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        }
        [configuration setValue:[NSNumber numberWithBool:YES]
                         forKey:_BGStatus];
    }

Could this be because your app is mistakenly using a much older version of this plugin that directly referenced this private API? Maybe because of version mismatch in config.xml and package.json?

ackanir commented 5 years ago

@sachingarg05 config.xml and package match. But I tried again and nothing was returned for version 4.1.1. I think I mixed results from different tests I made so I edited my reply.

sachingarg05 commented 5 years ago

@remifleurance I am now curious if your submission might just succeed with 4.1.1. Maybe the only problem was that your node_modules had an older version of plugin which directly referenced _setAlwaysRunsAtForegroundPriority, and there is nothing that needs to be fixed with 4.1.1?

I did not get this error or warning when I submitted a build yesterday. I am not using this plugin, but my own plugin has this exact same base64 code that I copied above and Apple didn't complain. But then this app is a VOIP app which is allowed to run in the background by Apple/iOS, so maybe that caused it to go through.

I would suggest trying to upload another build with 4.1.1.

mlynch commented 5 years ago

Looking into it on our end and will hopefully have an update soon

jcesarmobile commented 5 years ago

I've created a new app with 4.1.1 and passed validation, then downgraded to 3.0.0 and got the validation errors mentioned here, finally upgraded to 4.1.1 again and the errors were gone again. From 4.0.0 those selectors are not in the plugin code (nor in 2.4.0+ for v2.x branch). So, if you are in 3.x, update to 4.0.0 or newer (latest 4.1.1 at the moment), if you are in 2.x update to 2.4.0 or newer (latest 2.5.1 at the moment). If you updated and still getting those errors, try removing platforms, plugins and node_modules folders and start over (npm install, cordova prepare ios, etc). If still getting errors after that, open the Xcode workspace on platforms/ios and do a search for _setAlwaysRunsAtForegroundPriority to see if there is another plugin using it.

petergrau commented 5 years ago

But isn't it only a matter of time till apple will discover the base 64 encoded name of the private method?

mebibou commented 5 years ago

So what is the solution for this? I have the version 4.1.1 and same error. I deleted platforms, plugins, node_modules, ionic cordova prepare ios and still having this message and I can't upload the app. What can I do? searching for _setAlwaysRunsAtForegroundPriority gives no result

SimoneMSR commented 5 years ago

@mebibou follow this

RituProjects commented 5 years ago

I had the same error with an app I've published a few days ago for the last time.

This Works for me:--

cordova plugin rm cordova-plugin-ionic-webview rm -rf node_modules cordova plugin add cordova-plugin-ionic-webview@4.1.0 npm installionic cordova build ios --prod

nickstucko commented 5 years ago

For those who aren't ready to make the jump to v4, I can confirm version 2.5.1 fixes the issue as well. Apple quickly approved my app with no issues or warnings.

ionic cordova plugin rm cordova-plugin-ionic-webview ionic cordova plugin add cordova-plugin-ionic-webview@2.5.1

inestyne commented 5 years ago

This worked for me, i had to put --force onto the rm statement however

RaschidJFR commented 5 years ago

I had the same error with an app I've published a few days ago for the last time.

This Works for me:--

cordova plugin rm cordova-plugin-ionic-webview rm -rf node_modules cordova plugin add cordova-plugin-ionic-webview@4.1.0 npm installionic cordova build ios --prod

@RituProjects is there a typo in npm installionic cordova build ios --prod perhaps? Should it be:

 npm install
ionic cordova build ios --prod

or

npm install ionic
cordova build ios --prod

First one makes more sense to me though... just to be sure

mohsaniqbal387 commented 5 years ago

I faced the same issue I resolved: cordova plugin rm cordova-plugin-ionic-webview cordova plugin add cordova-plugin-ionic-webview@4.1.0 Delete platform/ios ionic cordova build ios

mohsaniqbal387 commented 5 years ago

I faced the same issue I resolved: cordova plugin rm cordova-plugin-ionic-webview cordova plugin add cordova-plugin-ionic-webview@4.1.0 Delete platform/ios ionic cordova build ios

ddtch commented 5 years ago

For me, it's even working with version 4.1.1

bunday commented 5 years ago

The issues is because of webview version 4.1.0, this can be fixed running the following commands

cordova plugin rm cordova-plugin-ionic-webview cordova plugin add cordova-plugin-ionic-webview@latest

make sure the installed version is 4.1.1 upward

klochko7 commented 3 years ago

I faced the same issue.. I used cordova-plugin-ionic-webview 5.0.0

Distribution completed with error.
App Store Connect Operation Warning.
The app references non-public selectors in Payload/Parts.app/Parts: dispatchEvent:

Any ideas? Thanks!

kevingrabher commented 3 years ago

I faced the same issue.. I used cordova-plugin-ionic-webview 5.0.0

Distribution completed with error.
App Store Connect Operation Warning.
The app references non-public selectors in Payload/Parts.app/Parts: dispatchEvent:

Any ideas? Thanks!

Can you post the full message? There should be more after dispatchEvent:

klochko7 commented 3 years ago

I faced the same issue.. I used cordova-plugin-ionic-webview 5.0.0

Distribution completed with error.
App Store Connect Operation Warning.
The app references non-public selectors in Payload/Parts.app/Parts: dispatchEvent:

Any ideas? Thanks!

Can you post the full message? There should be more after dispatchEvent:

Unfortunately no.

error_apple

kevingrabher commented 3 years ago

I faced the same issue.. I used cordova-plugin-ionic-webview 5.0.0

Distribution completed with error.
App Store Connect Operation Warning.
The app references non-public selectors in Payload/Parts.app/Parts: dispatchEvent:

Any ideas? Thanks!

Can you post the full message? There should be more after dispatchEvent:

Unfortunately no.

error_apple

I think you'll need to do some more troubleshooting. It seems unclear if you're actually facing the issue in the thread discussed (perhaps try deleting plugins one-by-one to narrow down the source of error).

klochko7 commented 3 years ago

Thanks.. Deleting plugins one-by-one It is to complicated for me. I have more then 20 plugins at project ..

com-sarriaroman-photoviewer 1.2.4 “PhotoViewer”
cordova-clipboard 1.3.0 “Clipboard”
cordova-plugin-advanced-http 3.1.0 “Advanced HTTP plugin”
cordova-plugin-android-permissions 1.1.2 “Permissions”
cordova-plugin-app-version 0.1.12 “AppVersion”
cordova-plugin-background-mode 0.7.3 “BackgroundMode”
cordova-plugin-badge 0.8.8 “Badge”
cordova-plugin-compat 1.2.0 “Compat”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-file-opener2 3.0.5 “File Opener2”
cordova-plugin-file-transfer 2.0.0-dev “File Transfer”
cordova-plugin-file 6.0.2 “File”
cordova-plugin-inappbrowser 4.1.0 “InAppBrowser”
cordova-plugin-ionic-keyboard 2.2.0 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 4.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-local-notification 0.9.0-beta.2 “LocalNotification”
cordova-plugin-ms-adal 0.8.1 “ADAL for Cordova”
cordova-plugin-nativestorage 2.3.2 “NativeStorage”
cordova-plugin-network-information 2.0.2 “Network Information”
cordova-plugin-printer 0.8.0 “Printer”
cordova-plugin-screen-orientation 3.0.2 “Screen Orientation”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-vibration 3.1.1 “Vibration”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-plugin-wkwebview-engine 1.2.2-dev “Cordova WKWebView Engine”
cordova-plugin-wkwebviewxhrfix 1.0.0 “Cordova WKWebView File XHR Fix”
cordova-plugin-zip 3.1.0 “cordova-plugin-zip”
cordova-sqlite-storage 5.1.1-dev “Cordova sqlite storage plugin - cordova-sqlite-storage plugin version”
cordova.plugins.diagnostic 6.0.3 “Diagnostic”

I try cordova plugin rm cordova-plugin-ionic-webview cordova plugin add cordova-plugin-ionic-webview@latest

klochko7 commented 3 years ago

I get an answer from Apple Developer Program Support.

After researching your app, I found that you are still using UIWebView in your app. It is no longer accepted as of April 2020. Could anyone suggest please how to understand with plugin use UIWebView ?

levesquejf commented 3 years ago

@klochko7 Have you tried <preference name="WKWebViewOnly" value="true" />?

More info at https://cordova.apache.org/howto/2020/03/18/wkwebviewonly.html