Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing some changes #566

Open
wants to merge 1 commit into
base: Post-release-changes-1.3.8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Iterable-React-Native-SDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'git+https://github.com/Iterable/react-native-sdk.git', :tag => s.version }

s.requires_arc = true
s.platform = :ios, '12.0'
s.platform = :ios, '13.4'

s.preserve_paths = 'LICENSE.md', 'README.md', 'package.json', 'index.js'
s.source_files = 'ios/**/*.{h,m,swift}'
Expand All @@ -24,6 +24,6 @@ Pod::Spec.new do |s|

s.swift_version = '5.3'

s.dependency 'Iterable-iOS-SDK', '~> 6.5.3'
s.dependency 'Iterable-iOS-SDK', '~> 6.5.4'
s.dependency 'React-Core'
end
23 changes: 21 additions & 2 deletions SampleApp/javascript/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'

platform :ios, '10.0'
platform :ios, '13.4'

target 'SampleApp' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
use_react_native!(:path => config[:reactNativePath])
end

target 'Rich Notification Extension' do
pod 'Iterable-iOS-AppExtensions'
end

# post_install do |installer|
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# # config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# installer.generated_projects.each do |project|
# project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# project.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# end
8 changes: 4 additions & 4 deletions SampleApp/javascript/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -841,10 +841,10 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==

"@iterable/react-native-sdk@^1.3.16":
version "1.3.17"
resolved "https://registry.yarnpkg.com/@iterable/react-native-sdk/-/react-native-sdk-1.3.17.tgz#3cf666241faa729c78abab6cc7ca33c5c054e76d"
integrity sha512-LHdTPDGTxuKxwlaC9tBLWtuZ0zY03GKEjv7tBcHOjTBRbS2+6j9qGQxuSBTUvlILucOEEph3gd97O78U6nqWvw==
"@iterable/react-native-sdk@^1.3.18":
version "1.3.18"
resolved "https://registry.yarnpkg.com/@iterable/react-native-sdk/-/react-native-sdk-1.3.18.tgz#98ffff88bd725f31d780bce5d0c6ef5c073bbf6d"
integrity sha512-ypIyRJ62rMsv9wA6vLUCp2LraknW6yK7Z98Caa7WK6ly9eVGB1FQaisIfhixOvpRRuEcWhZiX+b6c57kMaBIUQ==
dependencies:
"@react-native-community/hooks" "^2.6.0"
"@react-navigation/native" "^6.0.6"
Expand Down
67 changes: 43 additions & 24 deletions SampleApp/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,46 @@ TypeScript-based React Native application.

To run this sample:

1. In the **SampleApp/typescript** folder, run `yarn install`.

2. In the **SampleApp/typescript/ts** folder, rename **Config.sample.ts** to
**Config.ts**.

3. Provide a _Mobile_ [API key](https://support.iterable.com/hc/articles/360043464871)
for Iterable in the new **Config.ts** file:

```typescript
// in Config.js
export const iterableAPIKey = "<YOUR_API_KEY>";
```

**WARNING**: Never use _Standard_ Iterable API keys in client-side
code of any kind (for example, web or mobile). These API keys can access all
of your Iterable project's data, and they could potentially be compromised if
used in client-side code. In mobile apps, only use _Mobile_ API keys.

4. In the **SampleApp/typescript/ios** folder, install various iOS dependencies
by running `pod install`.

5. Run the app from the **SampleApp/typescript** folder by running either
`yarn ios` or `yarn android`.

1. In the **SampleApp/typescript** folder, run `yarn install`.

2. In the **SampleApp/typescript/ts** folder, rename **Config.sample.ts** to
**Config.ts**.

3. Provide a _Mobile_ [API key](https://support.iterable.com/hc/articles/360043464871)
for Iterable in the new **Config.ts** file:

```typescript
// in Config.js
export const iterableAPIKey = "<YOUR_API_KEY>";
```

**WARNING**: Never use _Standard_ Iterable API keys in client-side
code of any kind (for example, web or mobile). These API keys can access all
of your Iterable project's data, and they could potentially be compromised if
used in client-side code. In mobile apps, only use _Mobile_ API keys.

4. In the **SampleApp/typescript/ios** folder, install various iOS dependencies
by running `pod install`.

5. Run the app from the **SampleApp/typescript** folder by running either
`yarn ios` or `yarn android`.

# Loren Notes

- Runs on `react-native 0.68`, but throws an empty object error
- If using `nvm` on an M1, you need to add `.xcode.env`. This should be
documented.
- `Iterable-iOS-SDK` has been updated to `6.5.4`. Update here?
- Added script for setting the platform to `12.0` everywhere
- Added script to make M1 work
- Added script to make flipper work, though it still doesn't appear to be working
- Fixed script in AppDelegate which was causing build failure
- Updates to `.zshrc` needed to be made for M1
-- https://github.com/nvm-sh/nvm/issues/2881
-- https://noahpeeters.de/posts/apple-silicon/homebrew-setup/
- updates to `.metro.config.js`
- updates to `babel.config.js`
- updated `reactNativePath`:
https://stackoverflow.com/questions/74245902/ios-invalid-podfile-file-no-implicit-conversion-of-nil-into-string
- downgrade `react-native-ionicons` to @^4.x
- added `react-native-asset`: https://github.com/ant-design/ant-design-icons/issues/535
Binary file not shown.
7 changes: 5 additions & 2 deletions SampleApp/typescript/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "SampleApp",
"displayName": "SampleApp"
}
"displayName": "SampleApp",
"packagerOpts": {
"config": "metro.config.js"
}
}
1 change: 1 addition & 0 deletions SampleApp/typescript/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['@babel/plugin-transform-private-methods', '@babel/plugin-proposal-class-properties'],
};
3 changes: 3 additions & 0 deletions SampleApp/typescript/ios/.xcode.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
export NODE_BINARY=$(command -v node)
121 changes: 119 additions & 2 deletions SampleApp/typescript/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,130 @@
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'
# source 'https://github.com/CocoaPods/Specs'

platform :ios, '10.0'
deployment_target = '13.4'

platform :ios, '13.4'

target 'SampleApp' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
use_react_native!(
:path => config[:reactNativePath]
)

post_install do |installer|
react_native_post_install(installer)

# __apply_Xcode_12_5_M1_post_install_workaround(installer)

# Apple Silicon builds require a library path tweak for Swift library discovery or "symbol not found" for swift things
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
end
end
aggregate_target.user_project.save
end

# Flipper requires a crude patch to bump up iOS deployment target, or "error: thread-local storage is not supported for the current target"
# I'm not aware of any other way to fix this one other than bumping iOS deployment target to match react-native (iOS 11 now)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end

# ...but if you bump iOS deployment target, Flipper barfs again "Time.h:52:17: error: typedef redefinition with different types"
# We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_14_4/' Pods/RCT-Folly/folly/portability/Time.h`
end
end

target 'Rich Notification Extension' do
pod 'Iterable-iOS-AppExtensions'
end



# post_install do |installer|
# react_native_post_install(installer)

# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
# config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
# config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
# end

# case target.name
# when 'RCT-Folly'
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
# end
# end
# end
# end

# post_install do |installer|
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# # config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# end

# post_install do |installer|
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# # config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# installer.generated_projects.each do |project|
# project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# project.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# end

# post_install do |installer|
# react_native_post_install(installer)
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# # config.build_settings.delete "IPHONEOS_DEPLOYMENT_TARGET"
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# case target.name
# when 'RCT-Folly'
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
# end
# end
# end
# end

# def handle_targets_config(installer)
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
# end
# end
# end

# post_install do |installer|
# react_native_post_install(installer)
# handle_targets_config(installer)
# # We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# # ==> hack to modify the header file
# `sed -e $'s/__IPHONE_10_0/__IPHONE_13_0/' \
# Pods/Headers/Private/RCT-Folly/folly/portability/Time.h > temp_file \
# && mv temp_file Pods/Headers/Private/RCT-Folly/folly/portability/Time.h`
# end
37 changes: 37 additions & 0 deletions SampleApp/typescript/ios/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
Loading
Loading