diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 1716bdc4..1cffc931 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1499,7 +1499,7 @@ PODS: - React-logger (= 0.75.4) - React-perflogger (= 0.75.4) - React-utils (= 0.75.4) - - RNPermissions (5.0.0): + - RNPermissions (5.0.1): - React-Core - RNVectorIcons (10.2.0): - DoubleConversion @@ -1794,7 +1794,7 @@ SPEC CHECKSUMS: React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0 ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1 ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad - RNPermissions: 71b219b536d93ecf39169432f1037f6cb45aa9ec + RNPermissions: ed7216b9f49ed98b6cf56b8030de68b9a10b2423 RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 diff --git a/package.json b/package.json index 670068e6..ff9c5f41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-permissions", - "version": "5.0.0", + "version": "5.0.1", "license": "MIT", "description": "An unified permissions API for React Native on iOS, Android and Windows", "author": "Mathieu Acthernoene ", diff --git a/src/expo.ts b/src/expo.ts index 3595c6fd..6ff52314 100644 --- a/src/expo.ts +++ b/src/expo.ts @@ -1,4 +1,4 @@ -import {ConfigPlugin, withDangerousMod} from '@expo/config-plugins'; +import {ConfigPlugin, createRunOncePlugin, withDangerousMod} from '@expo/config-plugins'; import {mergeContents} from '@expo/config-plugins/build/utils/generateCode'; import * as fs from 'fs/promises'; import * as path from 'path'; @@ -60,16 +60,9 @@ ${iosPermissions.map((permission) => ` '${permission}',`).join('\n')} comment: '#', }); - if (!withRequire.didMerge || !withSetup.didMerge) { - console.error( - "ERROR: Cannot add react-native-permissions to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.", - ); - return config; - } - await fs.writeFile(file, withSetup.contents, 'utf-8'); return config; }, ]); -export default withPermissions; +export default createRunOncePlugin(withPermissions, 'react-native-permissions');