How to remove permissions for ios using expo - ios

I have an app using expo, but I want to remove NSMicrophoneUsageDescription from de infoplist.
Using this command expo config --type introspect
I got
ios: {
....
config: {
....
},
infoPlist: {
....
NSCameraUsageDescription: 'Allow $(PRODUCT_NAME) to access your camera',
NSPhotoLibraryUsageDescription: 'Allow $(PRODUCT_NAME) to access your photos',
NSMicrophoneUsageDescription: 'Allow $(PRODUCT_NAME) to access your microphone',
...
}
my package.json dependencies
"dependencies": {
"#expo/config": "^6.0.16",
"#react-native-community/netinfo": "6.0.2",
"#react-native-community/picker": "^1.8.1",
"#react-navigation/elements": "^1.3.3",
"#react-navigation/native": "^6.0.6",
"#react-navigation/native-stack": "^6.2.5",
"#react-navigation/stack": "^6.0.11",
"#reduxjs/toolkit": "^1.6.2",
"#sentry/react-native": "^3.4.3",
"#stripe/stripe-react-native": "0.2.2",
"axios": "^0.24.0",
"date-fns": "^2.28.0",
"dotenv": "^16.0.0",
"expo": "~43.0.2",
"expo-app-loading": "~1.2.1",
"expo-apple-authentication": "~4.0.3",
"expo-application": "~4.0.0",
"expo-auth-session": "~3.4.2",
"expo-clipboard": "~2.0.3",
"expo-constants": "~12.1.3",
"expo-crypto": "~10.0.3",
"expo-dev-client": "~0.6.3",
"expo-device": "~4.0.3",
"expo-document-picker": "~10.0.3",
"expo-font": "~10.0.3",
"expo-image-picker": "~11.0.3",
"expo-linear-gradient": "^10.0.3",
"expo-linking": "~2.4.2",
"expo-localization": "~11.0.0",
"expo-notifications": "~0.13.3",
"expo-random": "~12.0.1",
"expo-secure-store": "~11.0.3",
"expo-status-bar": "~1.1.0",
"expo-updates": "~0.10.15",
"expo-web-browser": "~10.0.3",
"firebase": "^9.5.0",
"formik": "^2.2.9",
"husky": "^7.0.4",
"js-base64": "^3.7.2",
"jwt-decode": "^3.1.2",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-app-intro-slider": "^4.0.4",
"react-native-countdown-circle-timer": "^3.0.9",
"react-native-country-picker-modal": "^2.0.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-get-random-values": "~1.7.0",
"react-native-global-props": "^1.1.5",
"react-native-paper": "^4.12.2",
"react-native-paper-dates": "^0.8.7",
"react-native-phone-number-input": "^2.1.0",
"react-native-picker-select": "^8.0.4",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-step-indicator": "^1.0.3",
"react-native-svg": "^12.1.1",
"react-native-toast-message": "^2.1.1",
"react-native-vector-icons": "^9.0.0",
"react-native-web": "0.17.1",
"react-native-webview": "11.13.0",
"react-redux": "^7.2.6",
"redux-logger": "^3.0.6",
"redux-saga": "^1.1.3",
"sentry-expo": "^4.2.0",
"ts-interface-builder": "^0.3.2",
"ts-interface-checker": "^1.0.2",
"uuid": "^8.3.2",
"yup": "^0.32.11"
},
So, I want to remove unused permissions as NSMicrophoneUsageDescription but I don't know how, can you help me?
I read the documentation in expo for permissions but it says that the plugins has its own configurations for permissions but it does not say somenthing about remove them
https://docs.expo.dev/guides/permissions/

I am assuming you want to deploy your app. If you are not requesting permission in your whole app.js, you dont have to do anything to remove the permission in the general.
In my experience, the apple store connects will still approve your app. On the apple store download page, the description will not show any permission required.
If I guess wrong and you just want to remove the permission, I recommend you eject the app. It will give you more flexibility to control the infoPlist.

This was resolved updating SDK to 45 and expo-image-picker to it more recent version, here you can modify in the app.json like this
[
"expo-image-picker",
{
"microphonePermission": false
}
]

Related

NestJS & TypeORM addEntitiesByConnection is not a function

I'm currently working on a project that has a backend that uses NestJS and TypeORM with a Postgres db, running in Docker. It used to work fine, but now it suddenly gives this error message whenever I try to run the container:
Debugger listening on ws://127.0.0.1:9229/c2cbb7df-e460-4138-8150-ae93910007b3
2022-06-30T10:18:02.583873300Z For help, see: https://nodejs.org/en/docs/inspector
2022-06-30T10:18:03.478586800Z
2022-06-30T10:18:03.479191200Z /usr/src/app/node_modules/#nestjs/typeorm/dist/typeorm.module.js:27
2022-06-30T10:18:03.479199600Z entities_metadata_storage_1.EntitiesMetadataStorage.addEntitiesByConnection(connection, [
2022-06-30T10:18:03.479203000Z ^
2022-06-30T10:18:03.479205400Z TypeError: entities_metadata_storage_1.EntitiesMetadataStorage.addEntitiesByConnection is not a function
2022-06-30T10:18:03.479207800Z at Function.forFeature (/usr/src/app/node_modules/#nestjs/typeorm/dist/typeorm.module.js:27:61)
2022-06-30T10:18:03.479210000Z at Object.<anonymous> (/usr/src/app/src/modules/sample.module.ts:9:27)
2022-06-30T10:18:03.479212500Z at Module._compile (internal/modules/cjs/loader.js:1085:14)
2022-06-30T10:18:03.479214700Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
2022-06-30T10:18:03.479216800Z at Module.load (internal/modules/cjs/loader.js:950:32)
2022-06-30T10:18:03.479218900Z at Function.Module._load (internal/modules/cjs/loader.js:790:12)
2022-06-30T10:18:03.479221100Z at Module.require (internal/modules/cjs/loader.js:974:19)
2022-06-30T10:18:03.479223200Z at require (internal/modules/cjs/helpers.js:101:18)
2022-06-30T10:18:03.479225200Z at Object.<anonymous> (/usr/src/app/src/app.module.ts:2:1)
2022-06-30T10:18:03.479227400Z at Module._compile (internal/modules/cjs/loader.js:1085:14)
To go along with that, here is my package.json dependencies and dev dependencies, because I think the issue could lie there, as I hadn't changed any functional code when this started happening:
"dependencies": {
"#nestjs/common": "^8.1.1",
"#nestjs/config": "^2.0.0",
"#nestjs/core": "^8.1.1",
"#nestjs/passport": "^8.2.1",
"#nestjs/platform-express": "^8.1.1",
"#nestjs/swagger": "^5.2.0",
"#nestjs/typeorm": "^8.0.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"joi": "^17.6.0",
"jsonwebtoken": "^8.5.1",
"pg": "^8.7.3",
"postgres": "^3.2.4",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.4.0",
"swagger-ui-express": "^4.3.0",
"ts-mocha": "^8.0.0",
"typeorm": "^0.2.38",
"typeorm-seeding": "^1.6.1",
"webpack": "^5.73.0"
},
"devDependencies": {
"#nestjs/cli": "^8.1.3",
"#nestjs/schematics": "^8.0.4",
"#nestjs/testing": "^8.1.1",
"#types/express": "^4.17.13",
"#types/jest": "^27.0.2",
"#types/jsonwebtoken": "^8.5.8",
"#types/node": "^16.11.1",
"#types/supertest": "^2.0.11",
"#typescript-eslint/eslint-plugin": "^4.29.2",
"#typescript-eslint/parser": "^4.29.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
"jest": "^27.3.0",
"prettier": "^2.4.1",
"source-map-support": "^0.5.20",
"supertest": "^6.1.6",
"ts-jest": "^27.0.7",
"ts-loader": "^9.2.6",
"ts-node": "^10.3.0",
"tsconfig-paths": "^3.11.0",
"typescript": "^4.4.4",
"webpack": "^5.73.0"
}
Does anybody know why this error is suddenly appearing, and how to fix it?

iOS: SyntaxError: Invalid regular expression: range out of order in character class (Vue3)

I am trying to go in production with my vuejs (Vue 3) website. Everything is working fine but yesterday I tried it with iOS Safari and was shocked because it only renders a white blank page and an error message: (There was no detail about where this error occured)
iOS: SyntaxError: Invalid regular expression: range out of order in character class
I went through my whole project but I dont even use regular expressions. Could it come from a dependency? Anyone else stumbled over this error message?
Thanks in advance!
PS: I dont know if it helps but this are my dependencies from package.json
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^6.1.1",
"#fortawesome/free-solid-svg-icons": "^6.1.1",
"#fortawesome/vue-fontawesome": "^3.0.0-5",
"#kyvg/vue3-notification": "^2.3.4",
"#tailwindcss/line-clamp": "^0.4.0",
"#vitejs/plugin-vue": "^2.3.3",
"autoprefixer": "^10.4.7",
"bcrypt": "^5.0.1",
"body-parser": "^1.19.1",
"cors": "^2.8.5",
"express": "^4.17.3",
"express-fileupload": "^1.2.1",
"express-rate-limit": "^5.5.1",
"helmet": "^4.6.0",
"imgur": "^2.1.3",
"jsonwebtoken": "^8.5.1",
"moment": "^2.29.3",
"mongoose": "^6.1.2",
"morgan": "^1.10.0",
"nodemailer": "^6.7.5",
"nprogress": "^0.2.0",
"pdfmake": "^0.2.5",
"socket.io": "^4.4.1",
"tailwindcss": "^3.1.2",
"validator": "^13.7.0",
"vite": "^2.9.12",
"vue": "^3.2.31",
"vue-axios": "^3.4.1",
"vue-content-loader": "^2.0.1",
"vue-csv-import": "^4.1.2",
"vue-router": "^4.0.16",
"vue3-qrcode-reader": "^0.0.1",
"vue3-table-lite": "^1.2.3",
"vuex": "^4.0.2"
},

Moving from Yarn to Npm in Rails project breaks Webpacker with missing dependencies errors

I am migrating a Rails project from Yarn to Npm because my team doesn't plan on upgrading to Yarn Berry. I've removed all traces of Yarn and replaced them with Npm and followed this Rails/Webpacker/Npm tutorial.
When starting my webpack server with npm run webpack-dev-server however, I run into the following errors:
Module not found: Error: Can't resolve 'worker_threads' in './node_modules/terser-webpack-plugin/node_modules/jest-worker/build/workers'
Not sure what could be causing this error. I've deleted yarn.lock and the node_modules directory multiple times to no avail.
Here is my package.json
{
"dependencies": {
"#hapi/hoek": "^8.5.1",
"#rails/webpacker": "^5.2.1",
"autoprefixer": "^8.0.0",
"axios": "^0.18.1",
"babel-core": "^6.26.0",
"babel-loader": "7.x",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"camelize2": "^1.0.0",
"coffee-loader": "^0.9.0",
"coffeescript": "^1.12.7",
"compression-webpack-plugin": "^3.0.1",
"consolidate": "^0.16.0",
"css-loader": "^3.4.1",
"file-loader": "^4.3.0",
"glob": "^7.1.2",
"got": "^8.0.1",
"handlebars": "^4.5.2",
"jest-serializer-vue": "^2.0.2",
"js-yaml": "^3.13.1",
"mem": "^4.0.0",
"mini-css-extract-plugin": "^0.9.0",
"moment": "^2.19.4",
"moment-timezone": "^0.5.27",
"node-gyp": "^4.0.0",
"node-sass": "^4.14.1",
"path-complete-extname": "^0.1.0",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"precss": "^2.0.0",
"rails-erb-loader": "^5.5.2",
"resolve-url-loader": "^3.1.1",
"sass-loader": "^8.0.0",
"style-loader": "^1.1.2",
"terser-webpack-plugin": "^2.3.1",
"vue": "^2.5.9",
"vue-loader": "^15.9.3",
"vue-template-compiler": "^2.5.9",
"webpack-manifest-plugin": "^2.2.0",
"webpack-merge": "^4.1.1",
"whiskers": "^0.4.0"
},
"devDependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-object-rest-spread": "^7.8.3",
"#babel/polyfill": "^7.8.3",
"#vue/test-utils": "^1.0.0-beta.30",
"babel-jest": "^21.2.0",
"jest": "^26.0.1",
"npm-install-webpack-plugin": "^4.0.5",
"vue-jest": "^3.0.5",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"engines": {
"node": "12.18.4"
},
"scripts": {
"webpack-dev-server": "webpack-dev-server",
"webpack": "webpack"
}
}
Here is my bin/webpack-dev-server script
#!/usr/bin/env ruby
$stdout.sync = true
require "shellwords"
require "yaml"
ENV["RAILS_ENV"] ||= "development"
RAILS_ENV = ENV["RAILS_ENV"]
ENV["NODE_ENV"] ||= RAILS_ENV
NODE_ENV = ENV["NODE_ENV"]
APP_PATH = File.expand_path("../", __dir__)
CONFIG_FILE = File.join(APP_PATH, "config/webpacker.yml")
NODE_MODULES_PATH = File.join(APP_PATH, "node_modules")
WEBPACK_CONFIG = File.join(APP_PATH, "config/webpack/development.js")
def args(key)
index = ARGV.index(key)
index ? ARGV[index + 1] : nil
end
begin
dev_server = YAML.load_file(CONFIG_FILE)["development"]["dev_server"]
protocol = args('--https') || dev_server["https"] ? 'https' : 'http'
host = args('--host') || dev_server["host"]
port = args('--port') || dev_server["port"]
DEV_SERVER_HOST = "#{protocol}://#{host}:#{port}".freeze
rescue Errno::ENOENT, NoMethodError
puts "Webpack dev_server configuration not found in #{CONFIG_FILE}."
puts "Please run bundle exec rails webpacker:install to install webpacker"
exit!
end
newenv = {
"NODE_PATH" => NODE_MODULES_PATH.shellescape,
"ASSET_HOST" => DEV_SERVER_HOST.shellescape
}.freeze
cmdline = ["npm", "run", "webpack-dev-server", "--color", "--config", WEBPACK_CONFIG] + ARGV
Dir.chdir(APP_PATH) do
exec newenv, *cmdline
end
Let me know if more code snippets would be helpful to help debug!
Thanks

white screen displayed after splashscreen in nativescript ios

There is white screen displaying after splash screen for few seconds in nativescript ios. It has been happening only for our project but sample project is working fine. I checked both simulator and iPhone 5, iPhone 6 , iPad mini ,white screen is displaying in all devices. I am using Nativescript with Angular 4, Here I included my package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "com.preludesys.calladoc",
"tns-ios": {
"version": "3.1.0"
}
},
"scripts": {
"tslint": "tslint -p tsconfig.json",
"ns-bundle": "ns-bundle",
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
"start-android-bundle": "npm run ns-bundle --android --run-app",
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
"build-android-bundle": "npm run ns-bundle --android --build-app",
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
},
"dependencies": {
"#angular/animations": "~4.1.0",
"#angular/common": "~4.1.0",
"#angular/compiler": "~4.1.0",
"#angular/core": "~4.1.0",
"#angular/forms": "~4.1.0",
"#angular/http": "~4.1.0",
"#angular/platform-browser": "~4.1.0",
"#angular/router": "~4.1.0",
"nativescript": "^3.2.0",
"nativescript-angular": "~3.0.0",
"nativescript-camera": "^3.0.1",
"nativescript-drop-down": "^3.1.0",
"nativescript-google-maps-sdk": "^2.3.2",
"nativescript-imagepicker": "^3.0.6",
"nativescript-iqkeyboardmanager": "^1.1.0",
"nativescript-loading-indicator": "^2.3.2",
"nativescript-phone": "^1.3.1",
"nativescript-ripple": "^2.0.0",
"nativescript-telerik-ui": "^3.0.4",
"nativescript-theme-core": "~1.0.2",
"nativescript-unit-test-runner": "^0.3.4",
"nativescript-xml2js": "^0.5.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.3.0",
"tns-core-modules": "^3.1.1",
"zone.js": "~0.8.2"
},
"devDependencies": {
"#angular/compiler-cli": "~4.1.0",
"#ngtools/webpack": "^1.3.0",
"babel-traverse": "6.24.1",
"babel-types": "6.24.1",
"babylon": "6.17.1",
"codelyzer": "^3.0.1",
"copy-webpack-plugin": "~4.0.1",
"extract-text-webpack-plugin": "~2.1.0",
"filewalker": "^0.1.3",
"jasmine-core": "^2.6.2",
"karma": "^1.7.0",
"karma-jasmine": "^1.0.2",
"karma-nativescript-launcher": "^0.4.0",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-typescript": "~0.4.0",
"nativescript-dev-webpack": "next",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.0.2",
"tslint": "^5.4.2",
"typescript": "~2.2.1",
"webpack": "~2.6.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "~1.0.1",
"nativescript-worker-loader": "~0.8.1"
}
}
i dont know what is the issue and how can i fix it. so please j=help me.
You should repeat the layout of your boot screen or a slightly different version of it (with a spinner and loading... message) hard coded that gets removed or drawn over once the app is actually loaded. This will give a smooth and professional looking transition between the boot screen and the loaded application.
This short "splash after the splashscreen" appears on iOS during the load of the initial page.
You cannot avoid it. However, you can change the color in your global CSS file with this code:
Page {
background-color: black;
}
In our apps this white screen becomes more prominent after adding a few "heavy" plugins, as nativescript-telerik-ui, nativescript-google-maps-sdk, etc.
It happens on old (slow) Android devices, too.
It seems it is unavoidable, which is a shame, really. One thing you could try is to optimize the loading time with Webpack, lazy loading, etc., so the app loads faster.
It also is recommended to change the Page background color programmatically on boot.
I am using frames and i found solution to make Frame background same as Splash screen
Frame {
background:#4285F4;
}
For this to work on Android {N}7 too, do:
frame.ns-root {
background-color: black;
}

Nativescript + iOS webview + local files

I'm currently working in a simple app, which has a HTML section which uses a webview.
The contents are in an app/www folder, and I access them from a "home.ts" component with something like this in the HTML
<GridLayout
class="main-layout"
columns="*"
rows="*"
>
<WebView
src="~/www/index.html"
class="web-view"
col="0"
id="wv"
row="0"
></WebView>
</GridLayout>
This file uses a few images, some JS and some CSS.
It works fine on Android, but I can't make it work on iOS. Oh, and it works fine on the iOS emulator, but not in an actual device (I currently have a iOS 9 iPod touch for testing these things).
I have the correct keys configured on Info.plist (it works with URLs as https://www.google.com), and I think I'm not doing anything weird.
This is my package.json
{
"description": "WebView App",
"license": "LicenseRef-LICENSE",
"readme": "README",
"nativescript": {
"id": "com.app.name"
},
"dependencies": {
"#angular/animations": "~4.1.0",
"#angular/common": "~4.1.0",
"#angular/compiler": "~4.1.0",
"#angular/core": "~4.1.0",
"#angular/forms": "~4.1.0",
"#angular/http": "~4.1.0",
"#angular/platform-browser": "~4.1.0",
"#angular/router": "~4.1.0",
"nativescript-angular": "~3.0.0",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.3.0",
"tns-core-modules": "^3.0.1",
"zone.js": "~0.8.2"
},
"devDependencies": {
"#angular/compiler-cli": "~4.1.0",
"babel-traverse": "6.24.1",
"babel-types": "6.24.1",
"babylon": "6.17.1",
"copy-webpack-plugin": "~4.0.1",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-typescript": "~0.4.0",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.0.2",
"tns-platform-declarations": "^3.0.0-rc.2",
"typescript": "~2.2.1"
}
}
It's a known bug for local pages, it's not able to determine what ~ means in terms of filesystem
you need to change the src in your code and figure out what ~refers to.
using :
import * as fs from "tns-core-modules/file-system";
public webViewSRC: string = encodeURI(`${fs.knownFolders.currentApp().path}/www/index.html`);
See this issue :
https://github.com/NativeScript/NativeScript/issues/4443

Resources