cordova-plugin-ionic-webview icon indicating copy to clipboard operation
cordova-plugin-ionic-webview copied to clipboard

The app references non-public selectors in Payload

Open azerturk opened this issue 6 years ago • 62 comments

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.

azerturk avatar Nov 09 '18 01:11 azerturk

Now seeing the same all of a sudden

adrynov avatar Jan 25 '19 13:01 adrynov

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.

mcondie avatar Jan 25 '19 20:01 mcondie

me too.

BenSegni avatar Jan 26 '19 11:01 BenSegni

Any updates. How to solve this issue?

anupamgovind1981 avatar Jan 27 '19 22:01 anupamgovind1981

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

flobiwankenobi avatar Jan 31 '19 10:01 flobiwankenobi

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

BenSegni avatar Jan 31 '19 10:01 BenSegni

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

michaelsampietro avatar Jan 31 '19 18:01 michaelsampietro

same here image

abalad avatar Feb 13 '19 00:02 abalad

Any updates for this?

ronaldborla avatar Feb 13 '19 07:02 ronaldborla

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.

azerturk avatar Feb 19 '19 20:02 azerturk

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.

mlynch avatar Feb 19 '19 21:02 mlynch

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?

dotmarn avatar Feb 20 '19 11:02 dotmarn

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.

BenSegni avatar Feb 20 '19 11:02 BenSegni

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?

dotmarn avatar Feb 20 '19 11:02 dotmarn

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.

BenSegni avatar Feb 20 '19 11:02 BenSegni

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

dotmarn avatar Feb 20 '19 11:02 dotmarn

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. :)

BenSegni avatar Feb 20 '19 11:02 BenSegni

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

dotmarn avatar Feb 20 '19 11:02 dotmarn

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!

BenSegni avatar Feb 20 '19 11:02 BenSegni

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 [email protected]. 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 [email protected]. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/Best regards,

The App Store Team

SimoneMSR avatar Jul 08 '19 09:07 SimoneMSR

@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.

Trafz avatar Jul 08 '19 14:07 Trafz

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 [email protected]
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.

SimoneMSR avatar Jul 09 '19 08:07 SimoneMSR

@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.

kensodemann avatar Jul 09 '19 10:07 kensodemann

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 [email protected]
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.

ilclaudio avatar Jul 09 '19 11:07 ilclaudio

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

mlynch avatar Jul 09 '19 17:07 mlynch

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.

ackanir avatar Jul 10 '19 08:07 ackanir

@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.

Trafz avatar Jul 10 '19 08:07 Trafz

@remifleurance I don't see these lines in the latest code in this repo, or in the package published on NPM: https://unpkg.com/[email protected]/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?

sachingarg05 avatar Jul 14 '19 15:07 sachingarg05

@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.

ackanir avatar Jul 15 '19 08:07 ackanir

@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.

sachingarg05 avatar Jul 15 '19 10:07 sachingarg05