@@ -24,31 +24,40 @@ setup_permissions([
2424] )
2525
2626linkage = ENV [ 'USE_FRAMEWORKS' ]
27- if linkage != nil
27+ if linkage
2828 Pod ::UI . puts "Configuring Pod with #{ linkage } ally linked Frameworks" . green
2929 use_frameworks! :linkage => linkage . to_sym
3030end
3131
3232config = use_native_modules!
3333
34- target 'ReactNativeNavigationSdkExample' do
35- use_react_native! (
36- :path => config [ :reactNativePath ] ,
34+ def shared_example_target_config ( name , config )
35+ target name do
36+ use_react_native! (
37+ :path => config [ :reactNativePath ] ,
3738 # An absolute path to your application root.
38- :app_path => "#{ Pod ::Config . instance . installation_root } /.."
39- )
40- end
39+ :app_path => "#{ Pod ::Config . instance . installation_root } /.." ,
40+ )
4141
42- target 'ReactNativeNavigationSdkExampleCarPlay' do
43- use_react_native! (
44- :path => config [ :reactNativePath ] ,
45- # An absolute path to your application root.
46- :app_path => "#{ Pod ::Config . instance . installation_root } /.."
47- )
42+ pod 'RNPermissions' , :path => '../node_modules/react-native-permissions'
43+ pod 'react-native-navigation-sdk' , :path => '../..'
44+
45+ unless name . end_with? ( "CarPlay" )
46+ setup_permissions ( [
47+ 'LocationAccuracy' ,
48+ 'LocationAlways' ,
49+ 'LocationWhenInUse' ,
50+ 'Notifications' ,
51+ ] )
52+ end
53+ end
4854end
4955
50- # Test target that inherits from the app
56+ shared_example_target_config ( 'ReactNativeNavigationSdkExample' , config )
57+ shared_example_target_config ( 'ReactNativeNavigationSdkExampleCarPlay' , config )
58+
5159target 'ReactNativeNavigationSdkExampleTests' do
60+ # Test target that inherits from the app
5261 inherit! :complete
5362end
5463
@@ -65,4 +74,4 @@ post_install do |installer|
6574 :mac_catalyst_enabled => false ,
6675 # :ccache_enabled => true
6776 )
68- end
77+ end
0 commit comments