Skip to content

Commit

Permalink
Merge pull request zoontek#372 from Dimon70007/dg/344_invalid_permission
Browse files Browse the repository at this point in the history
Dg/344 invalid permission
  • Loading branch information
zoontek authored Nov 26, 2019
2 parents 9fde6b0 + 9db57a1 commit 07abf12
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ $ yarn add react-native-permissions

By default no permission handler is installed. Update your `Podfile` by choosing the ones you want to check or request, then run `pod install`.

```ruby
# if you have prebuild dynamic cocoapods dependencies and could not migrate
# to use_modular_headers you should use workaround for linking app with dynamic frameworks
# and with static libraries by placing this code at the top of Podfile
#
# Add this code at the top of Podfile right after platform definition
use_frameworks!

dynamic_frameworks = ['RxCocoa', 'RxSwift', 'WhatEverSDKName']

# make all the other dependencies into static libraries by overriding the static_library
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
puts "Overriding the static_library for #{pod.name}"
def pod.build_type;
Pod::Target::BuildType.static_library
# for static framework -
# Pod::Target::BuildType.static_framework
end
end
end
end
```

```ruby
# 🚨 If you use use_framework! 🚨
# - Ensure that you have installed at least Cocoapods 1.5.0
Expand Down
19 changes: 19 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
platform :ios, '9.0'

# if you have prebuild dynamic cocoapods dependencies and could not migrate
# to use_modular_headers you should use workaround for linking app with dynamic frameworks
# and with static libraries by uncommenting next code

# use_frameworks!
# dynamic_frameworks = []
# pre_install do |installer|
# # make all the other libraries into static frameworks by overriding the static_library
# installer.pod_targets.each do |pod|
# if !dynamic_frameworks.include?(pod.name)
# puts "Overriding the static_framework? method for #{pod.name}"
# def pod.build_type;
# Pod::Target::BuildType.static_library
# end
# end
# end
# end

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'RNPermissionsExample' do
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,6 @@ SPEC CHECKSUMS:
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
Yoga: 14927e37bd25376d216b150ab2a561773d57911f

PODFILE CHECKSUM: fd41fb3cc785483e3289e017b0986b9b143fd760
PODFILE CHECKSUM: 9188a4aace868c237f075e5ce6f84fb03952b3e2

COCOAPODS: 1.8.4
8 changes: 4 additions & 4 deletions example/ios/RNPermissionsExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
01942B9A460F342DD2C59941 /* libPods-RNPermissionsExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9589A3603474A4FFDED0D10B /* libPods-RNPermissionsExample.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
6875196781331FFE9E603F87 /* libPods-RNPermissionsExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DD155AF45729590903A0B306 /* libPods-RNPermissionsExample.a */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -23,9 +23,9 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNPermissionsExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNPermissionsExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNPermissionsExample/main.m; sourceTree = "<group>"; };
9589A3603474A4FFDED0D10B /* libPods-RNPermissionsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNPermissionsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AEA89E08943D1AC580FE431E /* Pods-RNPermissionsExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNPermissionsExample.release.xcconfig"; path = "Target Support Files/Pods-RNPermissionsExample/Pods-RNPermissionsExample.release.xcconfig"; sourceTree = "<group>"; };
D6698846DE1278CE89BAFBAD /* Pods-RNPermissionsExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNPermissionsExample.debug.xcconfig"; path = "Target Support Files/Pods-RNPermissionsExample/Pods-RNPermissionsExample.debug.xcconfig"; sourceTree = "<group>"; };
DD155AF45729590903A0B306 /* libPods-RNPermissionsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNPermissionsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */
Expand All @@ -35,7 +35,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6875196781331FFE9E603F87 /* libPods-RNPermissionsExample.a in Frameworks */,
01942B9A460F342DD2C59941 /* libPods-RNPermissionsExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -70,7 +70,7 @@
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
DD155AF45729590903A0B306 /* libPods-RNPermissionsExample.a */,
9589A3603474A4FFDED0D10B /* libPods-RNPermissionsExample.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down

0 comments on commit 07abf12

Please sign in to comment.