-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathPodfile
More file actions
85 lines (69 loc) · 3.05 KB
/
Copy pathPodfile
File metadata and controls
85 lines (69 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# -------------
# This code only used internally for Customer.io testing
require 'open-uri'
IO.copy_stream(URI.open('https://raw.githubusercontent.com/customerio/customerio-ios/main/scripts/cocoapods_override_sdk.rb'), "/tmp/override_cio_sdk.rb")
load "/tmp/override_cio_sdk.rb"
# end of internal Customer.io testing code
# -------------
# Resolve scripts with node to allow for hoisting
def node_require(script)
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
require_relative "../scripts/ios_project_setup_utils.rb"
platform :ios, min_ios_version_supported
prepare_react_native_project!
setup_permissions([
'LocationWhenInUse',
])
push_provider = (ENV["PUSH_PROVIDER"] || "apn").downcase
app_target_name = "SampleApp"
nse_target_name = "NotificationServiceExtension"
installation_root = Pod::Config.instance.installation_root
# This function is very specific to the sample app setup
# and is not part of the SDK or its usage.
create_project_file_if_not_exists(installation_root, app_target_name)
update_project_build_settings(installation_root, app_target_name, nse_target_name, push_provider)
# React Native 0.82 (New Architecture only) does not support dynamic frameworks yet
# Use static frameworks instead when using FCM
# See: https://github.com/reactwg/react-native-new-architecture/discussions/115
if push_provider == "fcm"
linkage = "static"
else
linkage = ENV["USE_FRAMEWORKS"]
end
if linkage != nil
Pod::UI.puts "Configuring the app for #{push_provider.upcase} setup with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
cio_package_path = "../.."
target app_target_name do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
:app_path => "#{installation_root}/..",
)
pod "customerio-reactnative", :path => cio_package_path, :subspecs => [push_provider, "location"]
# install_non_production_ios_sdk_local_path(local_path: '~/code/customerio-ios/', is_app_extension: false, push_service: push_provider)
# install_non_production_ios_sdk_git_branch(branch_name: 'feature/wrappers-inline-support', is_app_extension: false, push_service: push_provider)
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
end
target nse_target_name do
inherit! :none
# Ideally, installing non-production SDK to main target should be enough
# We should not need to install non-production SDK to app extension separately
pod "customerio-reactnative-richpush/#{push_provider}", :path => cio_package_path
# install_non_production_ios_sdk_local_path(local_path: '~/code/customerio-ios/', is_app_extension: true, push_service: push_provider)
# install_non_production_ios_sdk_git_branch(branch_name: 'BRANCH-NAME-HERE', is_app_extension: true, push_service: push_provider)
end