Closed lodev09 closed 6 months ago
To use 6.5.16-0
you need to add this pod on your Podfile:
# Add temporary IQKeyboardManagerSwift fork to solve problems with PrivacyInfo.xcprivacy
pod 'IQKeyboardManagerSwift', :git => 'https://github.com/douglasjunior/IQKeyboardManager.git', :branch => 'react-native-keyboard-manager'
If you still in 6.5.11-2
, you will have problems with Apple, because in this version the IQKeyboardManager
have no PrivacyInfo.xcprivacy.
I just submitted a build to TestFlight using 6.5.11-2
just fine (didn't get that privacy email). As I mentioned, I'm using expo, which we don't normally modify the pod ourselves.
I guess you could put a note in the repo to use lower version when using expo?
The right thing to do is to use the privacy manifest, IQKeyboardManager is listed on the Apple required third-party SDKs.
The proper version to this, right know, is the most recent that I published on NPM.
Have you tried building it using Expo? Maybe I missed something. All I can do is to downgrade to a lower version without the privacy manifest.
Anyway, to use this library with expo you need to run the prebuild to get access to the native files.
https://docs.expo.dev/workflow/prebuild/
So just add this line o Podfile
dependencies:
# Add temporary IQKeyboardManagerSwift fork to solve problems with PrivacyInfo.xcprivacy
pod 'IQKeyboardManagerSwift', :git => 'https://github.com/douglasjunior/IQKeyboardManager.git', :branch => 'react-native-keyboard-manager'
That defeats the purpose of expo CNG. I can however, create a custom config plugin for it but it's overkill and won't make sense.
What I'm trying to say is that there's NO issue with PrivacyInfo.xcprivacy
if you're using Expo (and maybe in bare react-native as well) for as long as the user provides it in the app config. Here's the guide.
I understand, but first of all, Expo is react-native, so if a package runs on React Native, this package should run with expo.
Furthermore, regardless of the framework, IQKeyboardManager must export its privacy manifest.
Okay.. if you must include the privacy manifest then it's all good. However, it needs to at least fix itself without needing to configure the pod. Building it with expo, without any modification of the Podfile, fails and that's bad dev experience. I'm just saying.
The version 6 was outdated by IQKeyboardManager
and version 7 is incompatible with React Native yet: https://github.com/douglasjunior/react-native-keyboard-manager/issues/109
So the only option was to fork the IQKeyboardManager
version 6 and make the fix to work with the privacy manifest added only version 7.
Yes we MUST export privacy manifest for
IQKeyboardManager
: https://developer.apple.com/support/third-party-SDK-requirements/
Of course, it would be better to work without needing of a fork to be added to Podfile, that's obvious, and it's been like that for the last 7 years.
Unfortunately, this is how the open source world sometimes works, we need to play with the tools that we have in our hands.
I got it to work on Expo with the latest version with a plugin. Here's how:
plugins
withPodfile.js
const { withDangerousMod, withPlugins } = require('@expo/config-plugins');
const fs = require('fs');
const path = require('path');
async function readFile(path) {
return fs.promises.readFile(path, 'utf8');
}
async function saveFile(path, content) {
return fs.promises.writeFile(path, content, 'utf8');
}
module.exports = (config) =>
withPlugins(config, [
(config) => {
return withDangerousMod(config, [
'iOS',
async (config) => {
const file = path.join(config.modRequest.platformProjectRoot, 'Podfile');
/*
* You need to remove the line before adding it.
* If you don't do this and you run `expo prebuild` in a dirt project
* your file will have the same line added twice
*/
const contents = (await readFile(file)).replace(
/pod 'IQKeyboardManagerSwift', :git => 'https:\/\/github.com\/douglasjunior\/IQKeyboardManager.git', :branch => 'react-native-keyboard-manager'\n\n/g,
'',
);
/*
* Now re-adds the content
*/
await saveFile(
file,
`pod 'IQKeyboardManagerSwift', :git => 'https://github.com/douglasjunior/IQKeyboardManager.git', :branch => 'react-native-keyboard-manager'\n\n${contents}`,
);
return config;
},
]);
},
]);
app.json
{
"expo": {
"name": "bidaction",
...
"plugins": [
...
"./plugins/withPodfile"
],
...
}
}
npx expo prebuild --clean
Nice @samuelbeaulieu, I'm going to link your comment on README.
Apple just accepted my updates without the privacy file from this package FYI
@lodev09 please man, don't be stubborn, take a look at the rules published by Apple:
Source: https://developer.apple.com/support/third-party-SDK-requirements/
And see that IQKeyboardManager is on the list:
You haven't had to use privacy yet because your app already existed before the rule was created.
Every new app now requires the PrivacyInfo for third-party SDKs.
Hey man, I'm just saying based on experience. Haven't submitted a new app yet so you might be right. It was just an FYI for those people using Expo and having build issues with this package.
I got it to work on Expo with the latest version with a plugin. Here's how:
- Create a new folder in the root of your project named
plugins
- Create a file inside the newly created folder named
withPodfile.js
Thanks so much for writing this plugin, however, I found it is only working after I updating the "iOS" to "ios", according to the latest of Expo doc (https://docs.expo.dev/config-plugins/plugins-and-mods/#experimental-functionality)
so this line:
return withDangerousMod(config, [
'iOS',
has to be
return withDangerousMod(config, [
'ios',
Version
6.5.16-0
breaks IOS build due to invalidPrivacyInfo.xcprivacy
with Expo 51.I think we can safely ignore this since it will be up for the user to add the privacy file in their project. Expo does it via the
app.json
config.Reverting to
6.5.11-2
works just fine.