├── .editorconfig ├── .gitattributes ├── .github ├── actions │ └── setup │ │ └── action.yml └── workflows │ ├── ci.yml │ └── publish.yml ├── .gitignore ├── .nvmrc ├── .watchmanconfig ├── .yarn ├── plugins │ └── @yarnpkg │ │ ├── plugin-interactive-tools.cjs │ │ └── plugin-workspace-tools.cjs └── releases │ └── yarn-3.6.1.cjs ├── .yarnrc.yml ├── AppLogsPod ├── AppLogs.podspec ├── AppLogs.swift └── LICENSE ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradle.properties └── src │ ├── main │ ├── AndroidManifest.xml │ ├── AndroidManifestNew.xml │ └── java │ │ └── com │ │ └── applogs │ │ ├── AppLogsModule.kt │ │ └── AppLogsPackage.kt │ ├── newarch │ └── AppLogsSpec.kt │ └── oldarch │ └── AppLogsSpec.kt ├── babel.config.js ├── docs └── static │ └── img │ ├── bg-dark.png │ └── bg-light.png ├── example ├── .bundle │ └── config ├── .watchmanconfig ├── Gemfile ├── Gemfile.lock ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── applogs │ │ │ │ └── example │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── .xcode.env │ ├── AppLogsExample-Bridging-Header.h │ ├── AppLogsExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── AppLogsExample.xcscheme │ ├── AppLogsExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── AppLogsExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── AppLogsExample.entitlements │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ ├── PrivacyInfo.xcprivacy │ │ └── main.m │ ├── AppLogsExampleTests │ │ ├── AppLogsExampleTests.m │ │ └── Info.plist │ ├── ExampleTestLog.swift │ ├── File.swift │ ├── NotificationService │ │ ├── Info.plist │ │ ├── NotificationService.entitlements │ │ └── NotificationService.swift │ ├── Podfile │ └── Podfile.lock ├── jest.config.js ├── metro.config.js ├── package.json ├── react-native.config.js └── src │ └── App.tsx ├── ios ├── AppLogs.h ├── AppLogs.mm └── OSLogStoreHelper.swift ├── jest └── index.js ├── lefthook.yml ├── lib ├── commonjs │ ├── NativeAppLogs.js │ ├── NativeAppLogs.js.map │ ├── bindings.ios.js │ ├── bindings.ios.js.map │ ├── bindings.js │ ├── bindings.js.map │ ├── index.js │ ├── index.js.map │ ├── types.js │ └── types.js.map ├── module │ ├── NativeAppLogs.js │ ├── NativeAppLogs.js.map │ ├── bindings.ios.js │ ├── bindings.ios.js.map │ ├── bindings.js │ ├── bindings.js.map │ ├── index.js │ ├── index.js.map │ ├── types.js │ └── types.js.map └── typescript │ └── src │ ├── NativeAppLogs.d.ts │ ├── NativeAppLogs.d.ts.map │ ├── __tests__ │ ├── index.test.d.ts │ └── index.test.d.ts.map │ ├── bindings.d.ts │ ├── bindings.d.ts.map │ ├── bindings.ios.d.ts │ ├── bindings.ios.d.ts.map │ ├── index.d.ts │ ├── index.d.ts.map │ ├── types.d.ts │ └── types.d.ts.map ├── package.json ├── react-native-app-logs.podspec ├── src ├── NativeAppLogs.ts ├── __tests__ │ └── index.test.tsx ├── bindings.ios.ts ├── bindings.ts ├── index.tsx └── types.ts ├── tsconfig.build.json ├── tsconfig.json ├── turbo.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.github/actions/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: Setup 2 | description: Setup Node.js and install dependencies 3 | 4 | runs: 5 | using: composite 6 | steps: 7 | - name: Setup Node.js 8 | uses: actions/setup-node@v3 9 | with: 10 | node-version-file: .nvmrc 11 | 12 | - name: Cache dependencies 13 | id: yarn-cache 14 | uses: actions/cache@v3 15 | with: 16 | path: | 17 | **/node_modules 18 | .yarn/install-state.gz 19 | key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} 20 | restore-keys: | 21 | ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} 22 | ${{ runner.os }}-yarn- 23 | 24 | - name: Install dependencies 25 | if: steps.yarn-cache.outputs.cache-hit != 'true' 26 | run: yarn install --immutable 27 | shell: bash 28 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | branches: 8 | - main 9 | merge_group: 10 | types: 11 | - checks_requested 12 | 13 | jobs: 14 | lint: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v3 19 | 20 | - name: Setup 21 | uses: ./.github/actions/setup 22 | 23 | - name: Lint files 24 | run: yarn lint 25 | 26 | - name: Typecheck files 27 | run: yarn typecheck 28 | 29 | test: 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: Checkout 33 | uses: actions/checkout@v3 34 | 35 | - name: Setup 36 | uses: ./.github/actions/setup 37 | 38 | - name: Run unit tests 39 | run: yarn test --maxWorkers=2 --coverage 40 | 41 | build-library: 42 | runs-on: ubuntu-latest 43 | steps: 44 | - name: Checkout 45 | uses: actions/checkout@v3 46 | 47 | - name: Setup 48 | uses: ./.github/actions/setup 49 | 50 | - name: Build package 51 | run: yarn prepare 52 | 53 | build-android: 54 | runs-on: ubuntu-latest 55 | env: 56 | TURBO_CACHE_DIR: .turbo/android 57 | steps: 58 | - name: Checkout 59 | uses: actions/checkout@v3 60 | 61 | - name: Setup 62 | uses: ./.github/actions/setup 63 | 64 | - name: Cache turborepo for Android 65 | uses: actions/cache@v3 66 | with: 67 | path: ${{ env.TURBO_CACHE_DIR }} 68 | key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }} 69 | restore-keys: | 70 | ${{ runner.os }}-turborepo-android- 71 | 72 | - name: Check turborepo cache for Android 73 | run: | 74 | TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status") 75 | 76 | if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then 77 | echo "turbo_cache_hit=1" >> $GITHUB_ENV 78 | fi 79 | 80 | - name: Install JDK 81 | if: env.turbo_cache_hit != 1 82 | uses: actions/setup-java@v3 83 | with: 84 | distribution: 'zulu' 85 | java-version: '17' 86 | 87 | - name: Finalize Android SDK 88 | if: env.turbo_cache_hit != 1 89 | run: | 90 | /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" 91 | 92 | - name: Cache Gradle 93 | if: env.turbo_cache_hit != 1 94 | uses: actions/cache@v3 95 | with: 96 | path: | 97 | ~/.gradle/wrapper 98 | ~/.gradle/caches 99 | key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} 100 | restore-keys: | 101 | ${{ runner.os }}-gradle- 102 | 103 | - name: Build example for Android 104 | env: 105 | JAVA_OPTS: '-XX:MaxHeapSize=6g' 106 | run: | 107 | yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" 108 | 109 | build-ios: 110 | runs-on: macos-14 111 | env: 112 | TURBO_CACHE_DIR: .turbo/ios 113 | steps: 114 | - name: Checkout 115 | uses: actions/checkout@v3 116 | 117 | - name: Setup 118 | uses: ./.github/actions/setup 119 | 120 | - name: Cache turborepo for iOS 121 | uses: actions/cache@v3 122 | with: 123 | path: ${{ env.TURBO_CACHE_DIR }} 124 | key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }} 125 | restore-keys: | 126 | ${{ runner.os }}-turborepo-ios- 127 | 128 | - name: Check turborepo cache for iOS 129 | run: | 130 | TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status") 131 | 132 | if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then 133 | echo "turbo_cache_hit=1" >> $GITHUB_ENV 134 | fi 135 | 136 | - name: Cache cocoapods 137 | if: env.turbo_cache_hit != 1 138 | id: cocoapods-cache 139 | uses: actions/cache@v3 140 | with: 141 | path: | 142 | **/ios/Pods 143 | key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} 144 | restore-keys: | 145 | ${{ runner.os }}-cocoapods- 146 | 147 | - name: Install cocoapods 148 | # if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' 149 | run: | 150 | cd example/ios 151 | pod install 152 | env: 153 | NO_FLIPPER: 1 154 | 155 | - name: Build example for iOS 156 | run: | 157 | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" 158 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: 🌐 Publish Package to npmjs 2 | 3 | on: 4 | release: 5 | types: [created] 6 | workflow_dispatch: 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | permissions: 11 | contents: read 12 | id-token: write 13 | steps: 14 | - uses: actions/checkout@v4 15 | # Setup .npmrc file to publish to npm 16 | - uses: actions/setup-node@v4 17 | with: 18 | node-version: '18.x' 19 | registry-url: 'https://registry.npmjs.org' 20 | cache: yarn 21 | - run: yarn install --frozen-lockfile 22 | - run: npm publish --provenance 23 | env: 24 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 25 | NPM_CONFIG_ACCESS: public 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | *.env.local 32 | 33 | # Android/IJ 34 | # 35 | .classpath 36 | .cxx 37 | .gradle 38 | .idea 39 | .project 40 | .settings 41 | local.properties 42 | android.iml 43 | 44 | # Cocoapods 45 | # 46 | example/ios/Pods 47 | 48 | # Ruby 49 | example/vendor/ 50 | 51 | # node.js 52 | # 53 | node_modules/ 54 | npm-debug.log 55 | yarn-debug.log 56 | yarn-error.log 57 | 58 | # BUCK 59 | buck-out/ 60 | \.buckd/ 61 | android/app/libs 62 | android/keystores/debug.keystore 63 | 64 | # Yarn 65 | .yarn/* 66 | !.yarn/patches 67 | !.yarn/plugins 68 | !.yarn/releases 69 | !.yarn/sdks 70 | !.yarn/versions 71 | 72 | # Expo 73 | .expo/ 74 | 75 | # Turborepo 76 | .turbo/ 77 | 78 | # generated by bob 79 | # temporary publish lib to git until the build will be published to npm 80 | # lib/ 81 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v18 2 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | nmHoistingLimits: workspaces 3 | 4 | plugins: 5 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 6 | spec: "@yarnpkg/plugin-interactive-tools" 7 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 8 | spec: "@yarnpkg/plugin-workspace-tools" 9 | 10 | yarnPath: .yarn/releases/yarn-3.6.1.cjs 11 | -------------------------------------------------------------------------------- /AppLogsPod/AppLogs.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'AppLogs' 3 | s.version = '0.1.0' 4 | s.summary = 'A helper for OSLogStore.' 5 | 6 | s.description = <<-DESC 7 | AppLogs provides a simple interface for setting up an OSLogStore 8 | and retrieving logs within a specified process. It's designed to work 9 | with iOS 15.0 and later. 10 | DESC 11 | 12 | s.homepage = 'https://example.com/AppLogs' 13 | s.license = { :type => 'MIT', :file => 'LICENSE' } 14 | s.author = { 'Kiryl Ziusko' => 'kiryl@margelo.io' } 15 | s.source = { :git => 'https://example.com/AppLogs.git', :tag => s.version.to_s } 16 | 17 | s.module_name = 'AppLogs' 18 | 19 | s.source_files = '**/*.{h,m,mm,swift}' 20 | s.public_header_files = '**/*.h' 21 | s.swift_version = '5.0' 22 | end -------------------------------------------------------------------------------- /AppLogsPod/AppLogs.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppLogs.swift 3 | // react-native-app-logs 4 | // 5 | // Created by Kiryl Ziusko on 09/07/2024. 6 | // 7 | 8 | import Foundation 9 | import OSLog 10 | 11 | extension DateFormatter { 12 | func apply(closure: (DateFormatter) -> Void) -> DateFormatter { 13 | closure(self) 14 | return self 15 | } 16 | } 17 | 18 | @available(iOS 15.0, *) 19 | extension OSLogEntryLog.Level: CustomStringConvertible { 20 | public var description: String { 21 | switch self { 22 | case .undefined: 23 | return "undefined" 24 | case .debug: 25 | return "debug" 26 | case .info: 27 | return "info" 28 | case .notice: 29 | return "notice" 30 | case .error: 31 | return "error" 32 | case .fault: 33 | return "fault" 34 | default: 35 | return "unknown" 36 | } 37 | } 38 | } 39 | 40 | @available(iOS 15.0, *) 41 | @objc 42 | public class AppLogs: NSObject { 43 | private var logStore: OSLogStore? 44 | private static var lastLogCheckTime = Date(timeIntervalSince1970: 0) 45 | private let formatter = DateFormatter().apply { 46 | $0.timeZone = TimeZone(abbreviation: "UTC"); 47 | $0.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'" 48 | } 49 | 50 | @objc public func forwardLogsTo(appGroup: String) { 51 | do { 52 | logStore = try OSLogStore(scope: .currentProcessIdentifier) 53 | } catch { 54 | print("Failed to create OSLogStore: \(error)") 55 | } 56 | 57 | checkForNewLogs(appGroup: appGroup) 58 | } 59 | 60 | @objc func checkForNewLogs(appGroup: String) { 61 | print("Checking logs from: \(AppLogs.lastLogCheckTime)") 62 | getNewLogs(since: AppLogs.lastLogCheckTime) { logs in 63 | let userDefaults = UserDefaults(suiteName: appGroup) 64 | userDefaults?.set(logs, forKey: "logs") 65 | userDefaults?.synchronize() 66 | 67 | // Post a Darwin notification 68 | let notificationName = "io.margelo.newLogsAvailable" 69 | os_log("Posting notification: %{public}@", log: .default, type: .debug, notificationName) 70 | CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), 71 | CFNotificationName(notificationName as CFString), 72 | nil, nil, true) 73 | } 74 | AppLogs.lastLogCheckTime = Date() 75 | } 76 | 77 | @objc public func getNewLogs(since startTime: Date, completion: @escaping ([NSDictionary]) -> Void) { 78 | guard let logStore = logStore else { 79 | completion([]) 80 | return 81 | } 82 | 83 | DispatchQueue.global().async { 84 | let start = CFAbsoluteTimeGetCurrent() 85 | let now = Date() 86 | let predicate = NSPredicate(format: "date >= %@ AND date <= %@", startTime as NSDate, now as NSDate) 87 | var entries: [NSDictionary] = [] 88 | 89 | do { 90 | let allEntries = try logStore.getEntries(matching: predicate) 91 | 92 | for entry in allEntries { 93 | if let logEntry = entry as? OSLogEntryLog { 94 | entries.append([ 95 | "message": logEntry.composedMessage, 96 | "timestamp": self.formatter.string(from: logEntry.date), 97 | "process": logEntry.process, 98 | "pid": logEntry.processIdentifier, 99 | "tid": logEntry.threadIdentifier, 100 | "level": logEntry.level.description, 101 | ]) 102 | } 103 | } 104 | } catch { 105 | print("Failed to get log entries: \(error)") 106 | } 107 | 108 | let diff = CFAbsoluteTimeGetCurrent() - start 109 | print("Took \(diff) seconds Logs: \(entries.count)") 110 | 111 | completion(entries) 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /AppLogsPod/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Kiryl Ziusko 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | [INSERT CONTACT METHOD]. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are always welcome, no matter how large or small! 4 | 5 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md). 6 | 7 | ## Development workflow 8 | 9 | This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages: 10 | 11 | - The library package in the root directory. 12 | - An example app in the `example/` directory. 13 | 14 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: 15 | 16 | ```sh 17 | yarn 18 | ``` 19 | 20 | > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development. 21 | 22 | The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. 23 | 24 | It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app. 25 | 26 | If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/AppLogsExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-app-logs`. 27 | 28 | To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-app-logs` under `Android`. 29 | 30 | You can use various commands from the root directory to work with the project. 31 | 32 | To start the packager: 33 | 34 | ```sh 35 | yarn example start 36 | ``` 37 | 38 | To run the example app on Android: 39 | 40 | ```sh 41 | yarn example android 42 | ``` 43 | 44 | To run the example app on iOS: 45 | 46 | ```sh 47 | yarn example ios 48 | ``` 49 | 50 | By default, the example is configured to build with the old architecture. To run the example with the new architecture, you can do the following: 51 | 52 | 1. For Android, run: 53 | 54 | ```sh 55 | ORG_GRADLE_PROJECT_newArchEnabled=true yarn example android 56 | ``` 57 | 58 | 2. For iOS, run: 59 | 60 | ```sh 61 | cd example/ios 62 | RCT_NEW_ARCH_ENABLED=1 pod install 63 | cd - 64 | yarn example ios 65 | ``` 66 | 67 | If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders: 68 | 69 | ```sh 70 | yarn clean 71 | ``` 72 | 73 | To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this: 74 | 75 | ```sh 76 | Running "AppLogsExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1} 77 | ``` 78 | 79 | Note the `"fabric":true` and `"concurrentRoot":true` properties. 80 | 81 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 82 | 83 | ```sh 84 | yarn typecheck 85 | yarn lint 86 | ``` 87 | 88 | To fix formatting errors, run the following: 89 | 90 | ```sh 91 | yarn lint --fix 92 | ``` 93 | 94 | Remember to add tests for your change if possible. Run the unit tests by: 95 | 96 | ```sh 97 | yarn test 98 | ``` 99 | 100 | ### Commit message convention 101 | 102 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 103 | 104 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 105 | - `feat`: new features, e.g. add new method to the module. 106 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 107 | - `docs`: changes into documentation, e.g. add usage example for the module.. 108 | - `test`: adding or updating tests, e.g. add integration tests using detox. 109 | - `chore`: tooling changes, e.g. change CI config. 110 | 111 | Our pre-commit hooks verify that your commit message matches this format when committing. 112 | 113 | ### Linting and tests 114 | 115 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 116 | 117 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 118 | 119 | Our pre-commit hooks verify that the linter and tests pass when committing. 120 | 121 | ### Publishing to npm 122 | 123 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. 124 | 125 | To publish new versions, run the following: 126 | 127 | ```sh 128 | yarn release 129 | ``` 130 | 131 | ### Scripts 132 | 133 | The `package.json` file contains various scripts for common tasks: 134 | 135 | - `yarn`: setup project by installing dependencies. 136 | - `yarn typecheck`: type-check files with TypeScript. 137 | - `yarn lint`: lint files with ESLint. 138 | - `yarn test`: run unit tests with Jest. 139 | - `yarn example start`: start the Metro server for the example app. 140 | - `yarn example android`: run the example app on Android. 141 | - `yarn example ios`: run the example app on iOS. 142 | 143 | ### Sending a pull request 144 | 145 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). 146 | 147 | When you're sending a pull request: 148 | 149 | - Prefer small pull requests focused on one change. 150 | - Verify that linters and tests are passing. 151 | - Review the documentation to make sure it looks good. 152 | - Follow the pull request template when opening a pull request. 153 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 154 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Kiryl Ziusko 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AppLogs 6 | 7 | 8 | 9 | # react-native-app-logs 10 | 11 | Access native logs from JS code 12 | 13 | ## Installation 14 | 15 | ```sh 16 | npm install react-native-app-logs 17 | ``` 18 | 19 | ## Usage 20 | 21 | ### Basic usage 22 | 23 | The code snippet below will intercept all logs from the main app. 24 | 25 | ```js 26 | import AppLogs from 'react-native-app-logs'; 27 | 28 | // ... 29 | 30 | AppLogs.configure({ interval: 5 }); 31 | 32 | AppLogs.registerHandler({ 33 | filter: '[AppName]', 34 | handler: ({ filter, logs }) => { 35 | if (logs.length !== 0) { 36 | Alert.alert(filter, logs.join('\n')); 37 | } 38 | }, 39 | }); 40 | ``` 41 | 42 | ### Intercept logs from `NotificationServiceExtension` 43 | 44 | On iOS each process has its own logs and they live only within the process (and do not share the logs with other processes). 45 | 46 | To intercept logs from `NotificationServiceExtension` you need to: 47 | 48 | - give common app group for both `NotificationServiceExtension` and the main app; 49 | - specify `appGroupName` in `AppLogs.configure` method: 50 | 51 | ```ts 52 | import AppLogs from 'react-native-app-logs'; 53 | 54 | AppLogs.configure({ appGroupName: 'group.applogs.example', interval: 5 }); 55 | ``` 56 | 57 | - add new Pod to your `NotificationServiceExtension`: 58 | 59 | ```rb 60 | target 'NotificationService' do 61 | pod 'AppLogs', :path => '../../AppLogsPod/' 62 | end 63 | ``` 64 | 65 | - forward logs from `NotificationServiceExtension` to the main app: 66 | 67 | ```swift 68 | import AppLogs 69 | 70 | class NotificationService: UNNotificationServiceExtension { 71 | let appLogs: AppLogs = .init() 72 | 73 | deinit { 74 | appLogs.forwardLogsTo(appGroup: "group.applogs.example") 75 | } 76 | } 77 | ``` 78 | 79 | ## Contributing 80 | 81 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. 82 | 83 | ## License 84 | 85 | MIT 86 | 87 | --- 88 | 89 | Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob) 90 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | // Buildscript is evaluated before everything else so we can't use getExtOrDefault 3 | def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["AppLogs_kotlinVersion"] 4 | 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | classpath "com.android.tools.build:gradle:7.2.1" 12 | // noinspection DifferentKotlinGradleVersion 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | def reactNativeArchitectures() { 18 | def value = rootProject.getProperties().get("reactNativeArchitectures") 19 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 20 | } 21 | 22 | def isNewArchitectureEnabled() { 23 | return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" 24 | } 25 | 26 | apply plugin: "com.android.library" 27 | apply plugin: "kotlin-android" 28 | 29 | if (isNewArchitectureEnabled()) { 30 | apply plugin: "com.facebook.react" 31 | } 32 | 33 | def getExtOrDefault(name) { 34 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["AppLogs_" + name] 35 | } 36 | 37 | def getExtOrIntegerDefault(name) { 38 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AppLogs_" + name]).toInteger() 39 | } 40 | 41 | def supportsNamespace() { 42 | def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.') 43 | def major = parsed[0].toInteger() 44 | def minor = parsed[1].toInteger() 45 | 46 | // Namespace support was added in 7.3.0 47 | return (major == 7 && minor >= 3) || major >= 8 48 | } 49 | 50 | android { 51 | if (supportsNamespace()) { 52 | namespace "com.applogs" 53 | 54 | sourceSets { 55 | main { 56 | manifest.srcFile "src/main/AndroidManifestNew.xml" 57 | } 58 | } 59 | } 60 | 61 | compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") 62 | 63 | defaultConfig { 64 | minSdkVersion getExtOrIntegerDefault("minSdkVersion") 65 | targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") 66 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 67 | 68 | } 69 | 70 | buildFeatures { 71 | buildConfig true 72 | } 73 | 74 | buildTypes { 75 | release { 76 | minifyEnabled false 77 | } 78 | } 79 | 80 | lintOptions { 81 | disable "GradleCompatible" 82 | } 83 | 84 | compileOptions { 85 | sourceCompatibility JavaVersion.VERSION_1_8 86 | targetCompatibility JavaVersion.VERSION_1_8 87 | } 88 | 89 | sourceSets { 90 | main { 91 | if (isNewArchitectureEnabled()) { 92 | java.srcDirs += [ 93 | "src/newarch", 94 | // This is needed to build Kotlin project with NewArch enabled 95 | "${project.buildDir}/generated/source/codegen/java" 96 | ] 97 | } else { 98 | java.srcDirs += ["src/oldarch"] 99 | } 100 | } 101 | } 102 | } 103 | 104 | repositories { 105 | mavenCentral() 106 | google() 107 | } 108 | 109 | def kotlin_version = getExtOrDefault("kotlinVersion") 110 | 111 | dependencies { 112 | // For < 0.71, this will be from the local maven repo 113 | // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin 114 | //noinspection GradleDynamicVersion 115 | implementation "com.facebook.react:react-native:+" 116 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 117 | } 118 | 119 | if (isNewArchitectureEnabled()) { 120 | react { 121 | jsRootDir = file("../src/") 122 | libraryName = "AppLogs" 123 | codegenJavaPackageName = "com.applogs" 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | AppLogs_kotlinVersion=1.7.0 2 | AppLogs_minSdkVersion=21 3 | AppLogs_targetSdkVersion=31 4 | AppLogs_compileSdkVersion=31 5 | AppLogs_ndkversion=21.4.7075529 6 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifestNew.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/src/main/java/com/applogs/AppLogsModule.kt: -------------------------------------------------------------------------------- 1 | package com.applogs 2 | 3 | import com.facebook.react.bridge.ReactApplicationContext 4 | import com.facebook.react.bridge.ReactMethod 5 | import com.facebook.react.bridge.ReadableMap 6 | 7 | class AppLogsModule internal constructor(context: ReactApplicationContext) : 8 | AppLogsSpec(context) { 9 | 10 | override fun getName(): String { 11 | return NAME 12 | } 13 | 14 | @ReactMethod 15 | override fun addFilterCondition(filter: String?) { 16 | } 17 | 18 | @ReactMethod 19 | override fun removeFilterCondition(filter: String?) { 20 | } 21 | 22 | @ReactMethod 23 | override fun configure(params: ReadableMap) {} 24 | 25 | companion object { 26 | const val NAME = "AppLogs" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/src/main/java/com/applogs/AppLogsPackage.kt: -------------------------------------------------------------------------------- 1 | package com.applogs 2 | 3 | import com.facebook.react.TurboReactPackage 4 | import com.facebook.react.bridge.ReactApplicationContext 5 | import com.facebook.react.bridge.NativeModule 6 | import com.facebook.react.module.model.ReactModuleInfoProvider 7 | import com.facebook.react.module.model.ReactModuleInfo 8 | import java.util.HashMap 9 | 10 | class AppLogsPackage : TurboReactPackage() { 11 | override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { 12 | return if (name == AppLogsModule.NAME) { 13 | AppLogsModule(reactContext) 14 | } else { 15 | null 16 | } 17 | } 18 | 19 | override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { 20 | return ReactModuleInfoProvider { 21 | val moduleInfos: MutableMap = HashMap() 22 | val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 23 | moduleInfos[AppLogsModule.NAME] = ReactModuleInfo( 24 | AppLogsModule.NAME, 25 | AppLogsModule.NAME, 26 | false, // canOverrideExistingModule 27 | false, // needsEagerInit 28 | true, // hasConstants 29 | false, // isCxxModule 30 | isTurboModule // isTurboModule 31 | ) 32 | moduleInfos 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /android/src/newarch/AppLogsSpec.kt: -------------------------------------------------------------------------------- 1 | package com.applogs 2 | 3 | import com.facebook.react.bridge.ReactApplicationContext 4 | 5 | abstract class AppLogsSpec internal constructor(context: ReactApplicationContext) : 6 | NativeAppLogsSpec(context) { 7 | } 8 | -------------------------------------------------------------------------------- /android/src/oldarch/AppLogsSpec.kt: -------------------------------------------------------------------------------- 1 | package com.applogs 2 | 3 | import com.facebook.react.bridge.ReactApplicationContext 4 | import com.facebook.react.bridge.ReactContextBaseJavaModule 5 | import com.facebook.react.bridge.Promise 6 | 7 | abstract class AppLogsSpec internal constructor(context: ReactApplicationContext) : 8 | ReactContextBaseJavaModule(context) { 9 | 10 | abstract fun multiply(a: Double, b: Double, promise: Promise) 11 | } 12 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/static/img/bg-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/docs/static/img/bg-dark.png -------------------------------------------------------------------------------- /docs/static/img/bg-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/docs/static/img/bg-light.png -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper 7 | # bound in the template on Cocoapods with next React Native release. 8 | gem 'cocoapods', '>= 1.13', '< 1.15' 9 | gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' 10 | -------------------------------------------------------------------------------- /example/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.7) 5 | base64 6 | nkf 7 | rexml 8 | activesupport (7.0.8.4) 9 | concurrent-ruby (~> 1.0, >= 1.0.2) 10 | i18n (>= 1.6, < 2) 11 | minitest (>= 5.1) 12 | tzinfo (~> 2.0) 13 | addressable (2.8.7) 14 | public_suffix (>= 2.0.2, < 7.0) 15 | algoliasearch (1.27.5) 16 | httpclient (~> 2.8, >= 2.8.3) 17 | json (>= 1.5.1) 18 | atomos (0.1.3) 19 | base64 (0.2.0) 20 | claide (1.1.0) 21 | cocoapods (1.14.3) 22 | addressable (~> 2.8) 23 | claide (>= 1.0.2, < 2.0) 24 | cocoapods-core (= 1.14.3) 25 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 26 | cocoapods-downloader (>= 2.1, < 3.0) 27 | cocoapods-plugins (>= 1.0.0, < 2.0) 28 | cocoapods-search (>= 1.0.0, < 2.0) 29 | cocoapods-trunk (>= 1.6.0, < 2.0) 30 | cocoapods-try (>= 1.1.0, < 2.0) 31 | colored2 (~> 3.1) 32 | escape (~> 0.0.4) 33 | fourflusher (>= 2.3.0, < 3.0) 34 | gh_inspector (~> 1.0) 35 | molinillo (~> 0.8.0) 36 | nap (~> 1.0) 37 | ruby-macho (>= 2.3.0, < 3.0) 38 | xcodeproj (>= 1.23.0, < 2.0) 39 | cocoapods-core (1.14.3) 40 | activesupport (>= 5.0, < 8) 41 | addressable (~> 2.8) 42 | algoliasearch (~> 1.0) 43 | concurrent-ruby (~> 1.1) 44 | fuzzy_match (~> 2.0.4) 45 | nap (~> 1.0) 46 | netrc (~> 0.11) 47 | public_suffix (~> 4.0) 48 | typhoeus (~> 1.0) 49 | cocoapods-deintegrate (1.0.5) 50 | cocoapods-downloader (2.1) 51 | cocoapods-plugins (1.0.0) 52 | nap 53 | cocoapods-search (1.0.1) 54 | cocoapods-trunk (1.6.0) 55 | nap (>= 0.8, < 2.0) 56 | netrc (~> 0.11) 57 | cocoapods-try (1.2.0) 58 | colored2 (3.1.2) 59 | concurrent-ruby (1.3.3) 60 | escape (0.0.4) 61 | ethon (0.16.0) 62 | ffi (>= 1.15.0) 63 | ffi (1.17.0) 64 | fourflusher (2.3.1) 65 | fuzzy_match (2.0.4) 66 | gh_inspector (1.1.3) 67 | httpclient (2.8.3) 68 | i18n (1.14.5) 69 | concurrent-ruby (~> 1.0) 70 | json (2.7.2) 71 | minitest (5.24.1) 72 | molinillo (0.8.0) 73 | nanaimo (0.3.0) 74 | nap (1.1.0) 75 | netrc (0.11.0) 76 | nkf (0.2.0) 77 | public_suffix (4.0.7) 78 | rexml (3.2.9) 79 | strscan 80 | ruby-macho (2.5.1) 81 | strscan (3.1.0) 82 | typhoeus (1.4.1) 83 | ethon (>= 0.9.0) 84 | tzinfo (2.0.6) 85 | concurrent-ruby (~> 1.0) 86 | xcodeproj (1.24.0) 87 | CFPropertyList (>= 2.3.3, < 4.0) 88 | atomos (~> 0.1.3) 89 | claide (>= 1.0.2, < 2.0) 90 | colored2 (~> 3.1) 91 | nanaimo (~> 0.3.0) 92 | rexml (~> 3.2.4) 93 | 94 | PLATFORMS 95 | ruby 96 | 97 | DEPENDENCIES 98 | activesupport (>= 6.1.7.5, < 7.1.0) 99 | cocoapods (>= 1.13, < 1.15) 100 | 101 | RUBY VERSION 102 | ruby 2.7.6p219 103 | 104 | BUNDLED WITH 105 | 2.4.19 106 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). 2 | 3 | # Getting Started 4 | 5 | >**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. 6 | 7 | ## Step 1: Start the Metro Server 8 | 9 | First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native. 10 | 11 | To start Metro, run the following command from the _root_ of your React Native project: 12 | 13 | ```bash 14 | # using npm 15 | npm start 16 | 17 | # OR using Yarn 18 | yarn start 19 | ``` 20 | 21 | ## Step 2: Start your Application 22 | 23 | Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app: 24 | 25 | ### For Android 26 | 27 | ```bash 28 | # using npm 29 | npm run android 30 | 31 | # OR using Yarn 32 | yarn android 33 | ``` 34 | 35 | ### For iOS 36 | 37 | ```bash 38 | # using npm 39 | npm run ios 40 | 41 | # OR using Yarn 42 | yarn ios 43 | ``` 44 | 45 | If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly. 46 | 47 | This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively. 48 | 49 | ## Step 3: Modifying your App 50 | 51 | Now that you have successfully run the app, let's modify it. 52 | 53 | 1. Open `App.tsx` in your text editor of choice and edit some lines. 54 | 2. For **Android**: Press the R key twice or select **"Reload"** from the **Developer Menu** (Ctrl + M (on Window and Linux) or Cmd ⌘ + M (on macOS)) to see your changes! 55 | 56 | For **iOS**: Hit Cmd ⌘ + R in your iOS Simulator to reload the app and see your changes! 57 | 58 | ## Congratulations! :tada: 59 | 60 | You've successfully run and modified your React Native App. :partying_face: 61 | 62 | ### Now what? 63 | 64 | - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). 65 | - If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started). 66 | 67 | # Troubleshooting 68 | 69 | If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. 70 | 71 | # Learn More 72 | 73 | To learn more about React Native, take a look at the following resources: 74 | 75 | - [React Native Website](https://reactnative.dev) - learn more about React Native. 76 | - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. 77 | - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. 78 | - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. 79 | - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. 80 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | apply plugin: "org.jetbrains.kotlin.android" 3 | apply plugin: "com.facebook.react" 4 | 5 | /** 6 | * This is the configuration block to customize your React Native Android app. 7 | * By default you don't need to apply any configuration, just uncomment the lines you need. 8 | */ 9 | react { 10 | /* Folders */ 11 | // The root of your project, i.e. where "package.json" lives. Default is '..' 12 | // root = file("../") 13 | // The folder where the react-native NPM package is. Default is ../node_modules/react-native 14 | // reactNativeDir = file("../node_modules/react-native") 15 | // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen 16 | // codegenDir = file("../node_modules/@react-native/codegen") 17 | // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js 18 | // cliFile = file("../node_modules/react-native/cli.js") 19 | 20 | /* Variants */ 21 | // The list of variants to that are debuggable. For those we're going to 22 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'. 23 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. 24 | // debuggableVariants = ["liteDebug", "prodDebug"] 25 | 26 | /* Bundling */ 27 | // A list containing the node command and its flags. Default is just 'node'. 28 | // nodeExecutableAndArgs = ["node"] 29 | // 30 | // The command to run when bundling. By default is 'bundle' 31 | // bundleCommand = "ram-bundle" 32 | // 33 | // The path to the CLI configuration file. Default is empty. 34 | // bundleConfig = file(../rn-cli.config.js) 35 | // 36 | // The name of the generated asset file containing your JS bundle 37 | // bundleAssetName = "MyApplication.android.bundle" 38 | // 39 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' 40 | // entryFile = file("../js/MyApplication.android.js") 41 | // 42 | // A list of extra flags to pass to the 'bundle' commands. 43 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle 44 | // extraPackagerArgs = [] 45 | 46 | /* Hermes Commands */ 47 | // The hermes compiler command to run. By default it is 'hermesc' 48 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" 49 | // 50 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" 51 | // hermesFlags = ["-O", "-output-source-map"] 52 | } 53 | 54 | /** 55 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode. 56 | */ 57 | def enableProguardInReleaseBuilds = false 58 | 59 | /** 60 | * The preferred build flavor of JavaScriptCore (JSC) 61 | * 62 | * For example, to use the international variant, you can use: 63 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 64 | * 65 | * The international variant includes ICU i18n library and necessary data 66 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 67 | * give correct results when using with locales other than en-US. Note that 68 | * this variant is about 6MiB larger per architecture than default. 69 | */ 70 | def jscFlavor = 'org.webkit:android-jsc:+' 71 | 72 | android { 73 | ndkVersion rootProject.ext.ndkVersion 74 | buildToolsVersion rootProject.ext.buildToolsVersion 75 | compileSdk rootProject.ext.compileSdkVersion 76 | 77 | namespace "applogs.example" 78 | defaultConfig { 79 | applicationId "applogs.example" 80 | minSdkVersion rootProject.ext.minSdkVersion 81 | targetSdkVersion rootProject.ext.targetSdkVersion 82 | versionCode 1 83 | versionName "1.0" 84 | } 85 | signingConfigs { 86 | debug { 87 | storeFile file('debug.keystore') 88 | storePassword 'android' 89 | keyAlias 'androiddebugkey' 90 | keyPassword 'android' 91 | } 92 | } 93 | buildTypes { 94 | debug { 95 | signingConfig signingConfigs.debug 96 | } 97 | release { 98 | // Caution! In production, you need to generate your own keystore file. 99 | // see https://reactnative.dev/docs/signed-apk-android. 100 | signingConfig signingConfigs.debug 101 | minifyEnabled enableProguardInReleaseBuilds 102 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 103 | } 104 | } 105 | } 106 | 107 | dependencies { 108 | // The version of react-native is set by the React Native Gradle Plugin 109 | implementation("com.facebook.react:react-android") 110 | 111 | if (hermesEnabled.toBoolean()) { 112 | implementation("com.facebook.react:hermes-android") 113 | } else { 114 | implementation jscFlavor 115 | } 116 | } 117 | 118 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 119 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/applogs/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package applogs.example 2 | 3 | import com.facebook.react.ReactActivity 4 | import com.facebook.react.ReactActivityDelegate 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate 7 | 8 | class MainActivity : ReactActivity() { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | override fun getMainComponentName(): String = "AppLogsExample" 15 | 16 | /** 17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 19 | */ 20 | override fun createReactActivityDelegate(): ReactActivityDelegate = 21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 22 | } 23 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/applogs/example/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package applogs.example 2 | 3 | import android.app.Application 4 | import com.facebook.react.PackageList 5 | import com.facebook.react.ReactApplication 6 | import com.facebook.react.ReactHost 7 | import com.facebook.react.ReactNativeHost 8 | import com.facebook.react.ReactPackage 9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load 10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost 11 | import com.facebook.react.defaults.DefaultReactNativeHost 12 | import com.facebook.soloader.SoLoader 13 | 14 | class MainApplication : Application(), ReactApplication { 15 | 16 | override val reactNativeHost: ReactNativeHost = 17 | object : DefaultReactNativeHost(this) { 18 | override fun getPackages(): List = 19 | PackageList(this).packages.apply { 20 | // Packages that cannot be autolinked yet can be added manually here, for example: 21 | // add(MyReactNativePackage()) 22 | } 23 | 24 | override fun getJSMainModuleName(): String = "index" 25 | 26 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG 27 | 28 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 29 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED 30 | } 31 | 32 | override val reactHost: ReactHost 33 | get() = getDefaultReactHost(applicationContext, reactNativeHost) 34 | 35 | override fun onCreate() { 36 | super.onCreate() 37 | SoLoader.init(this, false) 38 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 39 | // If you opted-in for the New Architecture, we load the native entry point for this app. 40 | load() 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AppLogsExample 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "34.0.0" 4 | minSdkVersion = 23 5 | compileSdkVersion = 34 6 | targetSdkVersion = 34 7 | ndkVersion = "26.1.10909125" 8 | kotlinVersion = "1.9.22" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | apply plugin: "com.facebook.react.rootproject" 22 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=false 26 | 27 | # Use this property to specify which architecture you want to build. 28 | # You can also override it from the CLI using 29 | # ./gradlew -PreactNativeArchitectures=x86_64 30 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 31 | 32 | # Use this property to enable support to the new architecture. 33 | # This will allow you to use TurboModules and the Fabric render in 34 | # your application. You should enable this flag either if you want 35 | # to write custom TurboModules/Fabric components OR use libraries that 36 | # are providing them. 37 | newArchEnabled=true 38 | 39 | # Use this property to enable or disable the Hermes JS engine. 40 | # If set to false, you will be using JSC instead. 41 | hermesEnabled=true 42 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/margelo/react-native-app-logs/59931f8f7d5ed63159f339fa3d2a02237506a795/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'applogs.example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/@react-native/gradle-plugin') 5 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AppLogsExample", 3 | "displayName": "AppLogsExample" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../package.json'); 3 | 4 | module.exports = { 5 | presets: ['module:@react-native/babel-preset'], 6 | plugins: [ 7 | [ 8 | 'module-resolver', 9 | { 10 | extensions: ['.tsx', '.ts', '.js', '.json'], 11 | alias: { 12 | [pak.name]: path.join(__dirname, '..', pak.source), 13 | }, 14 | }, 15 | ], 16 | ], 17 | }; 18 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './src/App'; 3 | import { name as appName } from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /example/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* AppLogsExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* AppLogsExampleTests.m */; }; 11 | 089C327E2C46CC58001A9D40 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089C327D2C46CC58001A9D40 /* NotificationService.swift */; }; 12 | 089C32822C46CC58001A9D40 /* NotificationService.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 089C327B2C46CC58001A9D40 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 13 | 089C32882C46CCFD001A9D40 /* ExampleTestLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089C32872C46CCFD001A9D40 /* ExampleTestLog.swift */; }; 14 | 0C80B921A6F3F58F76C31292 /* libPods-AppLogsExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-AppLogsExample.a */; }; 15 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 16 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 17 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 18 | 31A500AE4EA1DF948ECEA3F9 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D9B1E6E150BB838959CF9B29 /* PrivacyInfo.xcprivacy */; }; 19 | 7699B88040F8A987B510C191 /* libPods-AppLogsExample-AppLogsExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-AppLogsExample-AppLogsExampleTests.a */; }; 20 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 21 | CB59A520B1AB58FEDB264C1B /* libPods-NotificationService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7814D878CE301985E76FC772 /* libPods-NotificationService.a */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 30 | remoteInfo = AppLogsExample; 31 | }; 32 | 089C32802C46CC58001A9D40 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 089C327A2C46CC58001A9D40; 37 | remoteInfo = NotificationService; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXCopyFilesBuildPhase section */ 42 | 089C32862C46CC58001A9D40 /* Embed Foundation Extensions */ = { 43 | isa = PBXCopyFilesBuildPhase; 44 | buildActionMask = 2147483647; 45 | dstPath = ""; 46 | dstSubfolderSpec = 13; 47 | files = ( 48 | 089C32822C46CC58001A9D40 /* NotificationService.appex in Embed Foundation Extensions */, 49 | ); 50 | name = "Embed Foundation Extensions"; 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXCopyFilesBuildPhase section */ 54 | 55 | /* Begin PBXFileReference section */ 56 | 00E356EE1AD99517003FC87E /* AppLogsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppLogsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 00E356F21AD99517003FC87E /* AppLogsExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppLogsExampleTests.m; sourceTree = ""; }; 59 | 089C327B2C46CC58001A9D40 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 089C327D2C46CC58001A9D40 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; 61 | 089C327F2C46CC58001A9D40 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | 089C32872C46CCFD001A9D40 /* ExampleTestLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleTestLog.swift; sourceTree = ""; }; 63 | 08B96D0A2C46D1C200A9B21B /* AppLogsExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = AppLogsExample.entitlements; path = AppLogsExample/AppLogsExample.entitlements; sourceTree = ""; }; 64 | 08B96D0B2C47DFC800A9B21B /* NotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NotificationService.entitlements; sourceTree = ""; }; 65 | 13B07F961A680F5B00A75B9A /* AppLogsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppLogsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = AppLogsExample/AppDelegate.h; sourceTree = ""; }; 67 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = AppLogsExample/AppDelegate.mm; sourceTree = ""; }; 68 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = AppLogsExample/Images.xcassets; sourceTree = ""; }; 69 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = AppLogsExample/Info.plist; sourceTree = ""; }; 70 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = AppLogsExample/main.m; sourceTree = ""; }; 71 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = AppLogsExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; 72 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-AppLogsExample-AppLogsExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AppLogsExample-AppLogsExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | 3B4392A12AC88292D35C810B /* Pods-AppLogsExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppLogsExample.debug.xcconfig"; path = "Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample.debug.xcconfig"; sourceTree = ""; }; 74 | 5709B34CF0A7D63546082F79 /* Pods-AppLogsExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppLogsExample.release.xcconfig"; path = "Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample.release.xcconfig"; sourceTree = ""; }; 75 | 5B7EB9410499542E8C5724F5 /* Pods-AppLogsExample-AppLogsExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppLogsExample-AppLogsExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests.debug.xcconfig"; sourceTree = ""; }; 76 | 5DCACB8F33CDC322A6C60F78 /* libPods-AppLogsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AppLogsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 77 | 7814D878CE301985E76FC772 /* libPods-NotificationService.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NotificationService.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = AppLogsExample/LaunchScreen.storyboard; sourceTree = ""; }; 79 | 89C6BE57DB24E9ADA2F236DE /* Pods-AppLogsExample-AppLogsExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppLogsExample-AppLogsExampleTests.release.xcconfig"; path = "Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests.release.xcconfig"; sourceTree = ""; }; 80 | 98BBBF52D7CB9890B3105C94 /* Pods-AppLogsExample-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppLogsExample-NotificationService.release.xcconfig"; path = "Target Support Files/Pods-AppLogsExample-NotificationService/Pods-AppLogsExample-NotificationService.release.xcconfig"; sourceTree = ""; }; 81 | C09A12A30C8C24AFE963A457 /* Pods-AppLogsExample-NotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppLogsExample-NotificationService.debug.xcconfig"; path = "Target Support Files/Pods-AppLogsExample-NotificationService/Pods-AppLogsExample-NotificationService.debug.xcconfig"; sourceTree = ""; }; 82 | D17D151A61E491823600EEBC /* Pods-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.release.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.release.xcconfig"; sourceTree = ""; }; 83 | D2321F2159342F4544A7630C /* Pods-NotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.debug.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.debug.xcconfig"; sourceTree = ""; }; 84 | D9B1E6E150BB838959CF9B29 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = AppLogsExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; 85 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 86 | /* End PBXFileReference section */ 87 | 88 | /* Begin PBXFrameworksBuildPhase section */ 89 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 90 | isa = PBXFrameworksBuildPhase; 91 | buildActionMask = 2147483647; 92 | files = ( 93 | 7699B88040F8A987B510C191 /* libPods-AppLogsExample-AppLogsExampleTests.a in Frameworks */, 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | 089C32782C46CC58001A9D40 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | CB59A520B1AB58FEDB264C1B /* libPods-NotificationService.a in Frameworks */, 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 106 | isa = PBXFrameworksBuildPhase; 107 | buildActionMask = 2147483647; 108 | files = ( 109 | 0C80B921A6F3F58F76C31292 /* libPods-AppLogsExample.a in Frameworks */, 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | 00E356EF1AD99517003FC87E /* AppLogsExampleTests */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 00E356F21AD99517003FC87E /* AppLogsExampleTests.m */, 120 | 00E356F01AD99517003FC87E /* Supporting Files */, 121 | ); 122 | path = AppLogsExampleTests; 123 | sourceTree = ""; 124 | }; 125 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 00E356F11AD99517003FC87E /* Info.plist */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | 089C327C2C46CC58001A9D40 /* NotificationService */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 08B96D0B2C47DFC800A9B21B /* NotificationService.entitlements */, 137 | 089C327D2C46CC58001A9D40 /* NotificationService.swift */, 138 | 089C327F2C46CC58001A9D40 /* Info.plist */, 139 | ); 140 | path = NotificationService; 141 | sourceTree = ""; 142 | }; 143 | 13B07FAE1A68108700A75B9A /* AppLogsExample */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 08B96D0A2C46D1C200A9B21B /* AppLogsExample.entitlements */, 147 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 148 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 149 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 150 | 13B07FB61A68108700A75B9A /* Info.plist */, 151 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 152 | 13B07FB71A68108700A75B9A /* main.m */, 153 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, 154 | D9B1E6E150BB838959CF9B29 /* PrivacyInfo.xcprivacy */, 155 | ); 156 | name = AppLogsExample; 157 | sourceTree = ""; 158 | }; 159 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 163 | 5DCACB8F33CDC322A6C60F78 /* libPods-AppLogsExample.a */, 164 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-AppLogsExample-AppLogsExampleTests.a */, 165 | 7814D878CE301985E76FC772 /* libPods-NotificationService.a */, 166 | ); 167 | name = Frameworks; 168 | sourceTree = ""; 169 | }; 170 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | ); 174 | name = Libraries; 175 | sourceTree = ""; 176 | }; 177 | 83CBB9F61A601CBA00E9B192 = { 178 | isa = PBXGroup; 179 | children = ( 180 | 089C32872C46CCFD001A9D40 /* ExampleTestLog.swift */, 181 | 13B07FAE1A68108700A75B9A /* AppLogsExample */, 182 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 183 | 00E356EF1AD99517003FC87E /* AppLogsExampleTests */, 184 | 089C327C2C46CC58001A9D40 /* NotificationService */, 185 | 83CBBA001A601CBA00E9B192 /* Products */, 186 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 187 | BBD78D7AC51CEA395F1C20DB /* Pods */, 188 | ); 189 | indentWidth = 2; 190 | sourceTree = ""; 191 | tabWidth = 2; 192 | usesTabs = 0; 193 | }; 194 | 83CBBA001A601CBA00E9B192 /* Products */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 13B07F961A680F5B00A75B9A /* AppLogsExample.app */, 198 | 00E356EE1AD99517003FC87E /* AppLogsExampleTests.xctest */, 199 | 089C327B2C46CC58001A9D40 /* NotificationService.appex */, 200 | ); 201 | name = Products; 202 | sourceTree = ""; 203 | }; 204 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 3B4392A12AC88292D35C810B /* Pods-AppLogsExample.debug.xcconfig */, 208 | 5709B34CF0A7D63546082F79 /* Pods-AppLogsExample.release.xcconfig */, 209 | 5B7EB9410499542E8C5724F5 /* Pods-AppLogsExample-AppLogsExampleTests.debug.xcconfig */, 210 | 89C6BE57DB24E9ADA2F236DE /* Pods-AppLogsExample-AppLogsExampleTests.release.xcconfig */, 211 | C09A12A30C8C24AFE963A457 /* Pods-AppLogsExample-NotificationService.debug.xcconfig */, 212 | 98BBBF52D7CB9890B3105C94 /* Pods-AppLogsExample-NotificationService.release.xcconfig */, 213 | D2321F2159342F4544A7630C /* Pods-NotificationService.debug.xcconfig */, 214 | D17D151A61E491823600EEBC /* Pods-NotificationService.release.xcconfig */, 215 | ); 216 | path = Pods; 217 | sourceTree = ""; 218 | }; 219 | /* End PBXGroup section */ 220 | 221 | /* Begin PBXNativeTarget section */ 222 | 00E356ED1AD99517003FC87E /* AppLogsExampleTests */ = { 223 | isa = PBXNativeTarget; 224 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AppLogsExampleTests" */; 225 | buildPhases = ( 226 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, 227 | 00E356EA1AD99517003FC87E /* Sources */, 228 | 00E356EB1AD99517003FC87E /* Frameworks */, 229 | 00E356EC1AD99517003FC87E /* Resources */, 230 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, 231 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, 232 | ); 233 | buildRules = ( 234 | ); 235 | dependencies = ( 236 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 237 | ); 238 | name = AppLogsExampleTests; 239 | productName = AppLogsExampleTests; 240 | productReference = 00E356EE1AD99517003FC87E /* AppLogsExampleTests.xctest */; 241 | productType = "com.apple.product-type.bundle.unit-test"; 242 | }; 243 | 089C327A2C46CC58001A9D40 /* NotificationService */ = { 244 | isa = PBXNativeTarget; 245 | buildConfigurationList = 089C32832C46CC58001A9D40 /* Build configuration list for PBXNativeTarget "NotificationService" */; 246 | buildPhases = ( 247 | A5A4F1405BB1DE232BF14708 /* [CP] Check Pods Manifest.lock */, 248 | 089C32772C46CC58001A9D40 /* Sources */, 249 | 089C32782C46CC58001A9D40 /* Frameworks */, 250 | 089C32792C46CC58001A9D40 /* Resources */, 251 | ); 252 | buildRules = ( 253 | ); 254 | dependencies = ( 255 | ); 256 | name = NotificationService; 257 | productName = NotificationService; 258 | productReference = 089C327B2C46CC58001A9D40 /* NotificationService.appex */; 259 | productType = "com.apple.product-type.app-extension"; 260 | }; 261 | 13B07F861A680F5B00A75B9A /* AppLogsExample */ = { 262 | isa = PBXNativeTarget; 263 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "AppLogsExample" */; 264 | buildPhases = ( 265 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 266 | 13B07F871A680F5B00A75B9A /* Sources */, 267 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 268 | 13B07F8E1A680F5B00A75B9A /* Resources */, 269 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 270 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, 271 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 272 | 089C32862C46CC58001A9D40 /* Embed Foundation Extensions */, 273 | ); 274 | buildRules = ( 275 | ); 276 | dependencies = ( 277 | 089C32812C46CC58001A9D40 /* PBXTargetDependency */, 278 | ); 279 | name = AppLogsExample; 280 | productName = AppLogsExample; 281 | productReference = 13B07F961A680F5B00A75B9A /* AppLogsExample.app */; 282 | productType = "com.apple.product-type.application"; 283 | }; 284 | /* End PBXNativeTarget section */ 285 | 286 | /* Begin PBXProject section */ 287 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 288 | isa = PBXProject; 289 | attributes = { 290 | LastSwiftUpdateCheck = 1540; 291 | LastUpgradeCheck = 1210; 292 | TargetAttributes = { 293 | 00E356ED1AD99517003FC87E = { 294 | CreatedOnToolsVersion = 6.2; 295 | TestTargetID = 13B07F861A680F5B00A75B9A; 296 | }; 297 | 089C327A2C46CC58001A9D40 = { 298 | CreatedOnToolsVersion = 15.4; 299 | }; 300 | 13B07F861A680F5B00A75B9A = { 301 | LastSwiftMigration = 1540; 302 | }; 303 | }; 304 | }; 305 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AppLogsExample" */; 306 | compatibilityVersion = "Xcode 12.0"; 307 | developmentRegion = en; 308 | hasScannedForEncodings = 0; 309 | knownRegions = ( 310 | en, 311 | Base, 312 | ); 313 | mainGroup = 83CBB9F61A601CBA00E9B192; 314 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 315 | projectDirPath = ""; 316 | projectRoot = ""; 317 | targets = ( 318 | 13B07F861A680F5B00A75B9A /* AppLogsExample */, 319 | 00E356ED1AD99517003FC87E /* AppLogsExampleTests */, 320 | 089C327A2C46CC58001A9D40 /* NotificationService */, 321 | ); 322 | }; 323 | /* End PBXProject section */ 324 | 325 | /* Begin PBXResourcesBuildPhase section */ 326 | 00E356EC1AD99517003FC87E /* Resources */ = { 327 | isa = PBXResourcesBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | 089C32792C46CC58001A9D40 /* Resources */ = { 334 | isa = PBXResourcesBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | ); 338 | runOnlyForDeploymentPostprocessing = 0; 339 | }; 340 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 341 | isa = PBXResourcesBuildPhase; 342 | buildActionMask = 2147483647; 343 | files = ( 344 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 345 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 346 | 31A500AE4EA1DF948ECEA3F9 /* PrivacyInfo.xcprivacy in Resources */, 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | /* End PBXResourcesBuildPhase section */ 351 | 352 | /* Begin PBXShellScriptBuildPhase section */ 353 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 354 | isa = PBXShellScriptBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | ); 358 | inputPaths = ( 359 | "$(SRCROOT)/.xcode.env.local", 360 | "$(SRCROOT)/.xcode.env", 361 | ); 362 | name = "Bundle React Native code and images"; 363 | outputPaths = ( 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | shellPath = /bin/sh; 367 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; 368 | }; 369 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { 370 | isa = PBXShellScriptBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | ); 374 | inputFileListPaths = ( 375 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", 376 | ); 377 | name = "[CP] Embed Pods Frameworks"; 378 | outputFileListPaths = ( 379 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", 380 | ); 381 | runOnlyForDeploymentPostprocessing = 0; 382 | shellPath = /bin/sh; 383 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample-frameworks.sh\"\n"; 384 | showEnvVarsInLog = 0; 385 | }; 386 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { 387 | isa = PBXShellScriptBuildPhase; 388 | buildActionMask = 2147483647; 389 | files = ( 390 | ); 391 | inputFileListPaths = ( 392 | ); 393 | inputPaths = ( 394 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 395 | "${PODS_ROOT}/Manifest.lock", 396 | ); 397 | name = "[CP] Check Pods Manifest.lock"; 398 | outputFileListPaths = ( 399 | ); 400 | outputPaths = ( 401 | "$(DERIVED_FILE_DIR)/Pods-AppLogsExample-AppLogsExampleTests-checkManifestLockResult.txt", 402 | ); 403 | runOnlyForDeploymentPostprocessing = 0; 404 | shellPath = /bin/sh; 405 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 406 | showEnvVarsInLog = 0; 407 | }; 408 | A5A4F1405BB1DE232BF14708 /* [CP] Check Pods Manifest.lock */ = { 409 | isa = PBXShellScriptBuildPhase; 410 | buildActionMask = 2147483647; 411 | files = ( 412 | ); 413 | inputFileListPaths = ( 414 | ); 415 | inputPaths = ( 416 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 417 | "${PODS_ROOT}/Manifest.lock", 418 | ); 419 | name = "[CP] Check Pods Manifest.lock"; 420 | outputFileListPaths = ( 421 | ); 422 | outputPaths = ( 423 | "$(DERIVED_FILE_DIR)/Pods-NotificationService-checkManifestLockResult.txt", 424 | ); 425 | runOnlyForDeploymentPostprocessing = 0; 426 | shellPath = /bin/sh; 427 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 428 | showEnvVarsInLog = 0; 429 | }; 430 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 431 | isa = PBXShellScriptBuildPhase; 432 | buildActionMask = 2147483647; 433 | files = ( 434 | ); 435 | inputFileListPaths = ( 436 | ); 437 | inputPaths = ( 438 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 439 | "${PODS_ROOT}/Manifest.lock", 440 | ); 441 | name = "[CP] Check Pods Manifest.lock"; 442 | outputFileListPaths = ( 443 | ); 444 | outputPaths = ( 445 | "$(DERIVED_FILE_DIR)/Pods-AppLogsExample-checkManifestLockResult.txt", 446 | ); 447 | runOnlyForDeploymentPostprocessing = 0; 448 | shellPath = /bin/sh; 449 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 450 | showEnvVarsInLog = 0; 451 | }; 452 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { 453 | isa = PBXShellScriptBuildPhase; 454 | buildActionMask = 2147483647; 455 | files = ( 456 | ); 457 | inputFileListPaths = ( 458 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 459 | ); 460 | name = "[CP] Embed Pods Frameworks"; 461 | outputFileListPaths = ( 462 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 463 | ); 464 | runOnlyForDeploymentPostprocessing = 0; 465 | shellPath = /bin/sh; 466 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests-frameworks.sh\"\n"; 467 | showEnvVarsInLog = 0; 468 | }; 469 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 470 | isa = PBXShellScriptBuildPhase; 471 | buildActionMask = 2147483647; 472 | files = ( 473 | ); 474 | inputFileListPaths = ( 475 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample-resources-${CONFIGURATION}-input-files.xcfilelist", 476 | ); 477 | name = "[CP] Copy Pods Resources"; 478 | outputFileListPaths = ( 479 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample-resources-${CONFIGURATION}-output-files.xcfilelist", 480 | ); 481 | runOnlyForDeploymentPostprocessing = 0; 482 | shellPath = /bin/sh; 483 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppLogsExample/Pods-AppLogsExample-resources.sh\"\n"; 484 | showEnvVarsInLog = 0; 485 | }; 486 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { 487 | isa = PBXShellScriptBuildPhase; 488 | buildActionMask = 2147483647; 489 | files = ( 490 | ); 491 | inputFileListPaths = ( 492 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", 493 | ); 494 | name = "[CP] Copy Pods Resources"; 495 | outputFileListPaths = ( 496 | "${PODS_ROOT}/Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", 497 | ); 498 | runOnlyForDeploymentPostprocessing = 0; 499 | shellPath = /bin/sh; 500 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppLogsExample-AppLogsExampleTests/Pods-AppLogsExample-AppLogsExampleTests-resources.sh\"\n"; 501 | showEnvVarsInLog = 0; 502 | }; 503 | /* End PBXShellScriptBuildPhase section */ 504 | 505 | /* Begin PBXSourcesBuildPhase section */ 506 | 00E356EA1AD99517003FC87E /* Sources */ = { 507 | isa = PBXSourcesBuildPhase; 508 | buildActionMask = 2147483647; 509 | files = ( 510 | 00E356F31AD99517003FC87E /* AppLogsExampleTests.m in Sources */, 511 | ); 512 | runOnlyForDeploymentPostprocessing = 0; 513 | }; 514 | 089C32772C46CC58001A9D40 /* Sources */ = { 515 | isa = PBXSourcesBuildPhase; 516 | buildActionMask = 2147483647; 517 | files = ( 518 | 089C327E2C46CC58001A9D40 /* NotificationService.swift in Sources */, 519 | ); 520 | runOnlyForDeploymentPostprocessing = 0; 521 | }; 522 | 13B07F871A680F5B00A75B9A /* Sources */ = { 523 | isa = PBXSourcesBuildPhase; 524 | buildActionMask = 2147483647; 525 | files = ( 526 | 089C32882C46CCFD001A9D40 /* ExampleTestLog.swift in Sources */, 527 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 528 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 529 | ); 530 | runOnlyForDeploymentPostprocessing = 0; 531 | }; 532 | /* End PBXSourcesBuildPhase section */ 533 | 534 | /* Begin PBXTargetDependency section */ 535 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 536 | isa = PBXTargetDependency; 537 | target = 13B07F861A680F5B00A75B9A /* AppLogsExample */; 538 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 539 | }; 540 | 089C32812C46CC58001A9D40 /* PBXTargetDependency */ = { 541 | isa = PBXTargetDependency; 542 | target = 089C327A2C46CC58001A9D40 /* NotificationService */; 543 | targetProxy = 089C32802C46CC58001A9D40 /* PBXContainerItemProxy */; 544 | }; 545 | /* End PBXTargetDependency section */ 546 | 547 | /* Begin XCBuildConfiguration section */ 548 | 00E356F61AD99517003FC87E /* Debug */ = { 549 | isa = XCBuildConfiguration; 550 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-AppLogsExample-AppLogsExampleTests.debug.xcconfig */; 551 | buildSettings = { 552 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 553 | BUNDLE_LOADER = "$(TEST_HOST)"; 554 | GCC_PREPROCESSOR_DEFINITIONS = ( 555 | "DEBUG=1", 556 | "$(inherited)", 557 | ); 558 | INFOPLIST_FILE = AppLogsExampleTests/Info.plist; 559 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; 560 | LD_RUNPATH_SEARCH_PATHS = ( 561 | "$(inherited)", 562 | "@executable_path/Frameworks", 563 | "@loader_path/Frameworks", 564 | ); 565 | OTHER_LDFLAGS = ( 566 | "-ObjC", 567 | "-lc++", 568 | "$(inherited)", 569 | ); 570 | PRODUCT_BUNDLE_IDENTIFIER = applogs.example; 571 | PRODUCT_NAME = "$(TARGET_NAME)"; 572 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AppLogsExample.app/AppLogsExample"; 573 | }; 574 | name = Debug; 575 | }; 576 | 00E356F71AD99517003FC87E /* Release */ = { 577 | isa = XCBuildConfiguration; 578 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-AppLogsExample-AppLogsExampleTests.release.xcconfig */; 579 | buildSettings = { 580 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 581 | BUNDLE_LOADER = "$(TEST_HOST)"; 582 | COPY_PHASE_STRIP = NO; 583 | INFOPLIST_FILE = AppLogsExampleTests/Info.plist; 584 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; 585 | LD_RUNPATH_SEARCH_PATHS = ( 586 | "$(inherited)", 587 | "@executable_path/Frameworks", 588 | "@loader_path/Frameworks", 589 | ); 590 | OTHER_LDFLAGS = ( 591 | "-ObjC", 592 | "-lc++", 593 | "$(inherited)", 594 | ); 595 | PRODUCT_BUNDLE_IDENTIFIER = applogs.example; 596 | PRODUCT_NAME = "$(TARGET_NAME)"; 597 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AppLogsExample.app/AppLogsExample"; 598 | }; 599 | name = Release; 600 | }; 601 | 089C32842C46CC58001A9D40 /* Debug */ = { 602 | isa = XCBuildConfiguration; 603 | baseConfigurationReference = D2321F2159342F4544A7630C /* Pods-NotificationService.debug.xcconfig */; 604 | buildSettings = { 605 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 606 | CLANG_ANALYZER_NONNULL = YES; 607 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 608 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 609 | CLANG_ENABLE_OBJC_WEAK = YES; 610 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 611 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 612 | CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; 613 | CODE_SIGN_IDENTITY = "Apple Development"; 614 | CODE_SIGN_STYLE = Automatic; 615 | CURRENT_PROJECT_VERSION = 1; 616 | DEBUG_INFORMATION_FORMAT = dwarf; 617 | DEVELOPMENT_TEAM = 7JPW5W7JHV; 618 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 619 | GCC_C_LANGUAGE_STANDARD = gnu17; 620 | GENERATE_INFOPLIST_FILE = YES; 621 | INFOPLIST_FILE = NotificationService/Info.plist; 622 | INFOPLIST_KEY_CFBundleDisplayName = NotificationService; 623 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 624 | IPHONEOS_DEPLOYMENT_TARGET = 17.5; 625 | LD_RUNPATH_SEARCH_PATHS = ( 626 | "$(inherited)", 627 | "@executable_path/Frameworks", 628 | "@executable_path/../../Frameworks", 629 | ); 630 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 631 | MARKETING_VERSION = 1.0; 632 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 633 | MTL_FAST_MATH = YES; 634 | PRODUCT_BUNDLE_IDENTIFIER = applogs.example.NotificationService2; 635 | PRODUCT_NAME = "$(TARGET_NAME)"; 636 | PROVISIONING_PROFILE_SPECIFIER = ""; 637 | SKIP_INSTALL = YES; 638 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 639 | SWIFT_EMIT_LOC_STRINGS = YES; 640 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 641 | SWIFT_VERSION = 5.0; 642 | TARGETED_DEVICE_FAMILY = "1,2"; 643 | }; 644 | name = Debug; 645 | }; 646 | 089C32852C46CC58001A9D40 /* Release */ = { 647 | isa = XCBuildConfiguration; 648 | baseConfigurationReference = D17D151A61E491823600EEBC /* Pods-NotificationService.release.xcconfig */; 649 | buildSettings = { 650 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 651 | CLANG_ANALYZER_NONNULL = YES; 652 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 653 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 654 | CLANG_ENABLE_OBJC_WEAK = YES; 655 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 656 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 657 | CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; 658 | CODE_SIGN_IDENTITY = "Apple Development"; 659 | CODE_SIGN_STYLE = Automatic; 660 | COPY_PHASE_STRIP = NO; 661 | CURRENT_PROJECT_VERSION = 1; 662 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 663 | DEVELOPMENT_TEAM = 7JPW5W7JHV; 664 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 665 | GCC_C_LANGUAGE_STANDARD = gnu17; 666 | GENERATE_INFOPLIST_FILE = YES; 667 | INFOPLIST_FILE = NotificationService/Info.plist; 668 | INFOPLIST_KEY_CFBundleDisplayName = NotificationService; 669 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 670 | IPHONEOS_DEPLOYMENT_TARGET = 17.5; 671 | LD_RUNPATH_SEARCH_PATHS = ( 672 | "$(inherited)", 673 | "@executable_path/Frameworks", 674 | "@executable_path/../../Frameworks", 675 | ); 676 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 677 | MARKETING_VERSION = 1.0; 678 | MTL_FAST_MATH = YES; 679 | PRODUCT_BUNDLE_IDENTIFIER = applogs.example.NotificationService2; 680 | PRODUCT_NAME = "$(TARGET_NAME)"; 681 | PROVISIONING_PROFILE_SPECIFIER = ""; 682 | SKIP_INSTALL = YES; 683 | SWIFT_COMPILATION_MODE = wholemodule; 684 | SWIFT_EMIT_LOC_STRINGS = YES; 685 | SWIFT_VERSION = 5.0; 686 | TARGETED_DEVICE_FAMILY = "1,2"; 687 | }; 688 | name = Release; 689 | }; 690 | 13B07F941A680F5B00A75B9A /* Debug */ = { 691 | isa = XCBuildConfiguration; 692 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-AppLogsExample.debug.xcconfig */; 693 | buildSettings = { 694 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 695 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 696 | CLANG_ENABLE_MODULES = YES; 697 | CODE_SIGN_ENTITLEMENTS = AppLogsExample/AppLogsExample.entitlements; 698 | CODE_SIGN_IDENTITY = "Apple Development"; 699 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 700 | CODE_SIGN_STYLE = Manual; 701 | CURRENT_PROJECT_VERSION = 1; 702 | DEVELOPMENT_TEAM = ""; 703 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7JPW5W7JHV; 704 | ENABLE_BITCODE = NO; 705 | INFOPLIST_FILE = AppLogsExample/Info.plist; 706 | LD_RUNPATH_SEARCH_PATHS = ( 707 | "$(inherited)", 708 | "@executable_path/Frameworks", 709 | ); 710 | MARKETING_VERSION = 1.0; 711 | OTHER_LDFLAGS = ( 712 | "$(inherited)", 713 | "-ObjC", 714 | "-lc++", 715 | ); 716 | PRODUCT_BUNDLE_IDENTIFIER = applogs.example; 717 | PRODUCT_NAME = AppLogsExample; 718 | PROVISIONING_PROFILE_SPECIFIER = ""; 719 | "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = AppLogs; 720 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 721 | SWIFT_VERSION = 5.0; 722 | VERSIONING_SYSTEM = "apple-generic"; 723 | }; 724 | name = Debug; 725 | }; 726 | 13B07F951A680F5B00A75B9A /* Release */ = { 727 | isa = XCBuildConfiguration; 728 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-AppLogsExample.release.xcconfig */; 729 | buildSettings = { 730 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 731 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 732 | CLANG_ENABLE_MODULES = YES; 733 | CODE_SIGN_ENTITLEMENTS = AppLogsExample/AppLogsExample.entitlements; 734 | CODE_SIGN_IDENTITY = "Apple Development"; 735 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 736 | CODE_SIGN_STYLE = Manual; 737 | CURRENT_PROJECT_VERSION = 1; 738 | DEVELOPMENT_TEAM = ""; 739 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7JPW5W7JHV; 740 | INFOPLIST_FILE = AppLogsExample/Info.plist; 741 | LD_RUNPATH_SEARCH_PATHS = ( 742 | "$(inherited)", 743 | "@executable_path/Frameworks", 744 | ); 745 | MARKETING_VERSION = 1.0; 746 | OTHER_LDFLAGS = ( 747 | "$(inherited)", 748 | "-ObjC", 749 | "-lc++", 750 | ); 751 | PRODUCT_BUNDLE_IDENTIFIER = applogs.example; 752 | PRODUCT_NAME = AppLogsExample; 753 | PROVISIONING_PROFILE_SPECIFIER = ""; 754 | "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = AppLogs; 755 | SWIFT_VERSION = 5.0; 756 | VERSIONING_SYSTEM = "apple-generic"; 757 | }; 758 | name = Release; 759 | }; 760 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 761 | isa = XCBuildConfiguration; 762 | buildSettings = { 763 | ALWAYS_SEARCH_USER_PATHS = NO; 764 | CC = ""; 765 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 766 | CLANG_CXX_LANGUAGE_STANDARD = "c++20"; 767 | CLANG_CXX_LIBRARY = "libc++"; 768 | CLANG_ENABLE_MODULES = YES; 769 | CLANG_ENABLE_OBJC_ARC = YES; 770 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 771 | CLANG_WARN_BOOL_CONVERSION = YES; 772 | CLANG_WARN_COMMA = YES; 773 | CLANG_WARN_CONSTANT_CONVERSION = YES; 774 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 775 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 776 | CLANG_WARN_EMPTY_BODY = YES; 777 | CLANG_WARN_ENUM_CONVERSION = YES; 778 | CLANG_WARN_INFINITE_RECURSION = YES; 779 | CLANG_WARN_INT_CONVERSION = YES; 780 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 781 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 782 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 783 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 784 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 785 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 786 | CLANG_WARN_STRICT_PROTOTYPES = YES; 787 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 788 | CLANG_WARN_UNREACHABLE_CODE = YES; 789 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 790 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 791 | COPY_PHASE_STRIP = NO; 792 | CXX = ""; 793 | ENABLE_STRICT_OBJC_MSGSEND = YES; 794 | ENABLE_TESTABILITY = YES; 795 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 796 | GCC_C_LANGUAGE_STANDARD = gnu99; 797 | GCC_DYNAMIC_NO_PIC = NO; 798 | GCC_NO_COMMON_BLOCKS = YES; 799 | GCC_OPTIMIZATION_LEVEL = 0; 800 | GCC_PREPROCESSOR_DEFINITIONS = ( 801 | "DEBUG=1", 802 | "$(inherited)", 803 | ); 804 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 805 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 806 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 807 | GCC_WARN_UNDECLARED_SELECTOR = YES; 808 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 809 | GCC_WARN_UNUSED_FUNCTION = YES; 810 | GCC_WARN_UNUSED_VARIABLE = YES; 811 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; 812 | LD = ""; 813 | LDPLUSPLUS = ""; 814 | LD_RUNPATH_SEARCH_PATHS = ( 815 | /usr/lib/swift, 816 | "$(inherited)", 817 | ); 818 | LIBRARY_SEARCH_PATHS = ( 819 | "\"$(SDKROOT)/usr/lib/swift\"", 820 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 821 | "\"$(inherited)\"", 822 | ); 823 | MTL_ENABLE_DEBUG_INFO = YES; 824 | ONLY_ACTIVE_ARCH = YES; 825 | OTHER_CPLUSPLUSFLAGS = ( 826 | "$(OTHER_CFLAGS)", 827 | "-DFOLLY_NO_CONFIG", 828 | "-DFOLLY_MOBILE=1", 829 | "-DFOLLY_USE_LIBCPP=1", 830 | "-DFOLLY_CFG_NO_COROUTINES=1", 831 | "-DFOLLY_HAVE_CLOCK_GETTIME=1", 832 | ); 833 | OTHER_LDFLAGS = ( 834 | "$(inherited)", 835 | " ", 836 | ); 837 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 838 | SDKROOT = iphoneos; 839 | USE_HERMES = true; 840 | }; 841 | name = Debug; 842 | }; 843 | 83CBBA211A601CBA00E9B192 /* Release */ = { 844 | isa = XCBuildConfiguration; 845 | buildSettings = { 846 | ALWAYS_SEARCH_USER_PATHS = NO; 847 | CC = ""; 848 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 849 | CLANG_CXX_LANGUAGE_STANDARD = "c++20"; 850 | CLANG_CXX_LIBRARY = "libc++"; 851 | CLANG_ENABLE_MODULES = YES; 852 | CLANG_ENABLE_OBJC_ARC = YES; 853 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 854 | CLANG_WARN_BOOL_CONVERSION = YES; 855 | CLANG_WARN_COMMA = YES; 856 | CLANG_WARN_CONSTANT_CONVERSION = YES; 857 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 858 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 859 | CLANG_WARN_EMPTY_BODY = YES; 860 | CLANG_WARN_ENUM_CONVERSION = YES; 861 | CLANG_WARN_INFINITE_RECURSION = YES; 862 | CLANG_WARN_INT_CONVERSION = YES; 863 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 864 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 865 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 866 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 867 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 868 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 869 | CLANG_WARN_STRICT_PROTOTYPES = YES; 870 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 871 | CLANG_WARN_UNREACHABLE_CODE = YES; 872 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 873 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 874 | COPY_PHASE_STRIP = YES; 875 | CXX = ""; 876 | ENABLE_NS_ASSERTIONS = NO; 877 | ENABLE_STRICT_OBJC_MSGSEND = YES; 878 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 879 | GCC_C_LANGUAGE_STANDARD = gnu99; 880 | GCC_NO_COMMON_BLOCKS = YES; 881 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 882 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 883 | GCC_WARN_UNDECLARED_SELECTOR = YES; 884 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 885 | GCC_WARN_UNUSED_FUNCTION = YES; 886 | GCC_WARN_UNUSED_VARIABLE = YES; 887 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; 888 | LD = ""; 889 | LDPLUSPLUS = ""; 890 | LD_RUNPATH_SEARCH_PATHS = ( 891 | /usr/lib/swift, 892 | "$(inherited)", 893 | ); 894 | LIBRARY_SEARCH_PATHS = ( 895 | "\"$(SDKROOT)/usr/lib/swift\"", 896 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 897 | "\"$(inherited)\"", 898 | ); 899 | MTL_ENABLE_DEBUG_INFO = NO; 900 | OTHER_CPLUSPLUSFLAGS = ( 901 | "$(OTHER_CFLAGS)", 902 | "-DFOLLY_NO_CONFIG", 903 | "-DFOLLY_MOBILE=1", 904 | "-DFOLLY_USE_LIBCPP=1", 905 | "-DFOLLY_CFG_NO_COROUTINES=1", 906 | "-DFOLLY_HAVE_CLOCK_GETTIME=1", 907 | ); 908 | OTHER_LDFLAGS = ( 909 | "$(inherited)", 910 | " ", 911 | ); 912 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 913 | SDKROOT = iphoneos; 914 | USE_HERMES = true; 915 | VALIDATE_PRODUCT = YES; 916 | }; 917 | name = Release; 918 | }; 919 | /* End XCBuildConfiguration section */ 920 | 921 | /* Begin XCConfigurationList section */ 922 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AppLogsExampleTests" */ = { 923 | isa = XCConfigurationList; 924 | buildConfigurations = ( 925 | 00E356F61AD99517003FC87E /* Debug */, 926 | 00E356F71AD99517003FC87E /* Release */, 927 | ); 928 | defaultConfigurationIsVisible = 0; 929 | defaultConfigurationName = Release; 930 | }; 931 | 089C32832C46CC58001A9D40 /* Build configuration list for PBXNativeTarget "NotificationService" */ = { 932 | isa = XCConfigurationList; 933 | buildConfigurations = ( 934 | 089C32842C46CC58001A9D40 /* Debug */, 935 | 089C32852C46CC58001A9D40 /* Release */, 936 | ); 937 | defaultConfigurationIsVisible = 0; 938 | defaultConfigurationName = Release; 939 | }; 940 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "AppLogsExample" */ = { 941 | isa = XCConfigurationList; 942 | buildConfigurations = ( 943 | 13B07F941A680F5B00A75B9A /* Debug */, 944 | 13B07F951A680F5B00A75B9A /* Release */, 945 | ); 946 | defaultConfigurationIsVisible = 0; 947 | defaultConfigurationName = Release; 948 | }; 949 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AppLogsExample" */ = { 950 | isa = XCConfigurationList; 951 | buildConfigurations = ( 952 | 83CBBA201A601CBA00E9B192 /* Debug */, 953 | 83CBBA211A601CBA00E9B192 /* Release */, 954 | ); 955 | defaultConfigurationIsVisible = 0; 956 | defaultConfigurationName = Release; 957 | }; 958 | /* End XCConfigurationList section */ 959 | }; 960 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 961 | } 962 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample.xcodeproj/xcshareddata/xcschemes/AppLogsExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : RCTAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "AppLogsExample-Swift.h" 3 | 4 | #import 5 | 6 | @implementation AppDelegate 7 | 8 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 9 | { 10 | self.moduleName = @"AppLogsExample"; 11 | // You can add your custom initial props in the dictionary below. 12 | // They will be passed down to the ViewController used by React Native. 13 | self.initialProps = @{}; 14 | 15 | 16 | // Create a test log from swift 17 | ExampleTestLog *testModule = [[ExampleTestLog alloc] init]; 18 | [testModule testLog]; 19 | [testModule requestNotificationPermission]; 20 | 21 | NSLog(@"[AppName] NSLog from AppDelegate"); 22 | 23 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 24 | } 25 | 26 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 27 | { 28 | return [self bundleURL]; 29 | } 30 | 31 | - (NSURL *)bundleURL 32 | { 33 | #if DEBUG 34 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 35 | #else 36 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 37 | #endif 38 | } 39 | 40 | // Push notification 41 | 42 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 43 | NSString *token = [self stringWithDeviceToken:deviceToken]; 44 | NSLog(@"Device Token: %@", token); 45 | } 46 | 47 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { 48 | NSLog(@"Failed to register for remote notifications: %@", error); 49 | } 50 | 51 | - (NSString *)stringWithDeviceToken:(NSData *)deviceToken { 52 | const unsigned char *tokenBytes = (const unsigned char *)[deviceToken bytes]; 53 | NSMutableString *tokenString = [NSMutableString string]; 54 | 55 | for (NSUInteger i = 0; i < [deviceToken length]; i++) { 56 | [tokenString appendFormat:@"%02x", tokenBytes[i]]; 57 | } 58 | 59 | return [tokenString copy]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/AppLogsExample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.security.application-groups 8 | 9 | group.applogs.example 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | AppLogsExample 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | 30 | NSAllowsArbitraryLoads 31 | 32 | NSAllowsLocalNetworking 33 | 34 | 35 | NSLocationWhenInUseUsageDescription 36 | 37 | UILaunchStoryboardName 38 | LaunchScreen 39 | UIRequiredDeviceCapabilities 40 | 41 | arm64 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/AppLogsExample/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/ios/AppLogsExampleTests/AppLogsExampleTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface AppLogsExampleTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation AppLogsExampleTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /example/ios/AppLogsExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/ExampleTestLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleTestLog.swift 3 | // AppLogsExample 4 | // 5 | // Created by Hanno Gödecke on 16.07.24. 6 | // 7 | 8 | import Foundation 9 | import os.log 10 | import UIKit 11 | import UserNotifications 12 | 13 | @objc 14 | public class ExampleTestLog: NSObject { 15 | let log = OSLog(subsystem: Bundle.main.bundleIdentifier ?? "applogs.example", category: "App") 16 | 17 | @objc 18 | public func testLog() { 19 | os_log("[AppName] sending test log from another swift file", log: log) 20 | } 21 | 22 | @objc 23 | public func requestNotificationPermission() { 24 | UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in 25 | if granted { 26 | os_log("[AppName] Notification permission granted", log: self.log) 27 | self.getNotificationSettings() 28 | } else { 29 | os_log("[AppName] Notification permission denied", log: self.log) 30 | } 31 | } 32 | } 33 | 34 | @objc 35 | func getNotificationSettings() { 36 | UNUserNotificationCenter.current().getNotificationSettings { settings in 37 | print("[AppName] Notification settings: \(settings)") 38 | DispatchQueue.main.async { 39 | UIApplication.shared.registerForRemoteNotifications() 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /example/ios/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // AppLogsExample 4 | // 5 | 6 | import Foundation 7 | -------------------------------------------------------------------------------- /example/ios/NotificationService/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSExtension 6 | 7 | NSExtensionPointIdentifier 8 | com.apple.usernotifications.service 9 | NSExtensionPrincipalClass 10 | $(PRODUCT_MODULE_NAME).NotificationService 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/ios/NotificationService/NotificationService.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | group.applogs.example 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/NotificationService/NotificationService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationService.swift 3 | // NotificationService 4 | // 5 | // Created by Hanno Gödecke on 16.07.24. 6 | // 7 | 8 | import AppLogs 9 | import Intents 10 | import os.log 11 | import UserNotifications 12 | 13 | class NotificationService: UNNotificationServiceExtension { 14 | let log = OSLog(subsystem: Bundle.main.bundleIdentifier ?? "applogs.example.hanno", category: "App") 15 | 16 | var contentHandler: ((UNNotificationContent) -> Void)? 17 | var bestAttemptContent: UNMutableNotificationContent? 18 | var logStoreHelper: AppLogs = .init() 19 | 20 | override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { 21 | os_log("[AppName] [NotificationService] didReceive() - received notification", log: log) 22 | 23 | self.contentHandler = contentHandler 24 | bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) 25 | 26 | if let bestAttemptContent = bestAttemptContent { 27 | // Modify the notification content here... 28 | bestAttemptContent.title = "\(bestAttemptContent.title) [modified]" 29 | 30 | contentHandler(bestAttemptContent) 31 | } 32 | } 33 | 34 | override func serviceExtensionTimeWillExpire() { 35 | os_log("[AppName] [NotificationService] serviceExtensionTimeWillExpire", log: log) 36 | // Called just before the extension will be terminated by the system. 37 | // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. 38 | if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { 39 | contentHandler(bestAttemptContent) 40 | } 41 | } 42 | 43 | deinit { 44 | logStoreHelper.forwardLogsTo(appGroup: "group.applogs.example") 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Resolve react_native_pods.rb with node to allow for hoisting 2 | require Pod::Executable.execute_command('node', ['-p', 3 | 'require.resolve( 4 | "react-native/scripts/react_native_pods.rb", 5 | {paths: [process.argv[1]]}, 6 | )', __dir__]).strip 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | linkage = ENV['USE_FRAMEWORKS'] 12 | if linkage != nil 13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 14 | use_frameworks! :linkage => linkage.to_sym 15 | end 16 | 17 | target 'NotificationService' do 18 | pod 'AppLogs', :path => '../../AppLogsPod/' 19 | end 20 | 21 | target 'AppLogsExample' do 22 | config = use_native_modules! 23 | 24 | use_react_native!( 25 | :path => config[:reactNativePath], 26 | # An absolute path to your application root. 27 | :app_path => "#{Pod::Config.instance.installation_root}/.." 28 | ) 29 | 30 | target 'AppLogsExampleTests' do 31 | inherit! :complete 32 | # Pods for testing 33 | end 34 | 35 | post_install do |installer| 36 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 37 | react_native_post_install( 38 | installer, 39 | config[:reactNativePath], 40 | :mac_catalyst_enabled => false, 41 | # :ccache_enabled => true 42 | ) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /example/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | }; 4 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); 2 | const path = require('path'); 3 | const escape = require('escape-string-regexp'); 4 | const exclusionList = require('metro-config/src/defaults/exclusionList'); 5 | const pak = require('../package.json'); 6 | 7 | const root = path.resolve(__dirname, '..'); 8 | const modules = Object.keys({ ...pak.peerDependencies }); 9 | 10 | /** 11 | * Metro configuration 12 | * https://facebook.github.io/metro/docs/configuration 13 | * 14 | * @type {import('metro-config').MetroConfig} 15 | */ 16 | const config = { 17 | watchFolders: [root], 18 | 19 | // We need to make sure that only one version is loaded for peerDependencies 20 | // So we block them at the root, and alias them to the versions in example's node_modules 21 | resolver: { 22 | blacklistRE: exclusionList( 23 | modules.map( 24 | (m) => 25 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`) 26 | ) 27 | ), 28 | 29 | extraNodeModules: modules.reduce((acc, name) => { 30 | acc[name] = path.join(__dirname, 'node_modules', name); 31 | return acc; 32 | }, {}), 33 | }, 34 | 35 | transformer: { 36 | getTransformOptions: async () => ({ 37 | transform: { 38 | experimentalImportSupport: false, 39 | inlineRequires: true, 40 | }, 41 | }), 42 | }, 43 | }; 44 | 45 | module.exports = mergeConfig(getDefaultConfig(__dirname), config); 46 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-app-logs-example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "pods": "bundle install && cd ios && bundle exec pod install && cd ..", 7 | "android": "react-native run-android", 8 | "ios": "react-native run-ios", 9 | "start": "react-native start", 10 | "build:android": "react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"", 11 | "build:ios": "react-native build-ios --scheme AppLogsExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\"" 12 | }, 13 | "dependencies": { 14 | "react": "18.2.0", 15 | "react-native": "0.74.3" 16 | }, 17 | "devDependencies": { 18 | "@babel/core": "^7.20.0", 19 | "@babel/preset-env": "^7.20.0", 20 | "@babel/runtime": "^7.20.0", 21 | "@react-native/babel-preset": "0.74.85", 22 | "@react-native/metro-config": "0.74.85", 23 | "@react-native/typescript-config": "0.74.85", 24 | "babel-plugin-module-resolver": "^5.0.0" 25 | }, 26 | "engines": { 27 | "node": ">=18" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/react-native.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../package.json'); 3 | 4 | module.exports = { 5 | project: { 6 | ios: { 7 | automaticPodsInstallation: true, 8 | }, 9 | }, 10 | dependencies: { 11 | [pak.name]: { 12 | root: path.join(__dirname, '..'), 13 | }, 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react'; 2 | import { 3 | Alert, 4 | SafeAreaView, 5 | ScrollView, 6 | StyleSheet, 7 | Text, 8 | } from 'react-native'; 9 | import AppLogs, { type NativeLog } from 'react-native-app-logs'; 10 | 11 | AppLogs.configure({ 12 | appGroupName: 'group.applogs.example', 13 | interval: 5, 14 | }); 15 | 16 | AppLogs.registerHandler({ 17 | filter: '[AppName]', 18 | handler: ({ logs }) => { 19 | if (logs.length !== 0) { 20 | Alert.alert(logs.map((log) => log.message).join('\n')); 21 | } 22 | }, 23 | }); 24 | 25 | export default function App() { 26 | const [history, setHistory] = useState([]); 27 | 28 | useEffect(() => { 29 | const listener = AppLogs.registerHandler({ 30 | filter: '[AppName]', 31 | handler: ({ logs }) => { 32 | if (logs.length !== 0) { 33 | setHistory((prev) => [...prev, ...logs]); 34 | } 35 | }, 36 | }); 37 | 38 | return () => { 39 | listener.remove(); 40 | }; 41 | }, []); 42 | 43 | return ( 44 | 45 | 46 | {history.map((log, i) => ( 47 | 48 | {i}. {log.timestamp} {log.pid}-{log.tid}::{log.process}|{log.level}| 49 | {' -> '} 50 | {log.message} 51 | 52 | ))} 53 | 54 | 55 | ); 56 | } 57 | 58 | const styles = StyleSheet.create({ 59 | container: { 60 | flex: 1, 61 | backgroundColor: '#fff', 62 | }, 63 | }); 64 | -------------------------------------------------------------------------------- /ios/AppLogs.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef RCT_NEW_ARCH_ENABLED 3 | #import "RNAppLogsSpec.h" 4 | #endif 5 | 6 | #import 7 | 8 | @interface AppLogs : RCTEventEmitter 9 | - (void)sendEvent:(NSString *)name body:(id)body; 10 | @end 11 | -------------------------------------------------------------------------------- /ios/AppLogs.mm: -------------------------------------------------------------------------------- 1 | #import "AppLogs.h" 2 | 3 | #if __has_include("react_native_app_logs-Swift.h") 4 | #import "react_native_app_logs-Swift.h" 5 | #else 6 | #import 7 | #endif 8 | 9 | @implementation AppLogs { 10 | bool hasListeners; 11 | OSLogStoreHelper *logStoreHelper; 12 | NSTimer *logCheckTimer; 13 | NSDate *lastLogCheckTime; 14 | NSMutableDictionary *filters; 15 | } 16 | 17 | RCT_EXPORT_MODULE() 18 | 19 | - (instancetype)init 20 | { 21 | self = [super init]; 22 | 23 | filters = [[NSMutableDictionary alloc] init]; 24 | logStoreHelper = [[OSLogStoreHelper alloc] initOnNewLogs: ^(NSArray *logs) { 25 | for (NSString *filter in self->filters) { 26 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"message CONTAINS[c] %@", filter]; 27 | NSArray *filteredLogs = [logs filteredArrayUsingPredicate:predicate]; 28 | [self sendEvent:@"newLogAvailable" body:@{ @"filter": filter, @"logs": filteredLogs }]; 29 | } 30 | }]; 31 | 32 | lastLogCheckTime = [NSDate dateWithTimeIntervalSince1970:0]; // Start from the epoch time 33 | 34 | return self; 35 | } 36 | 37 | - (void)checkForNewLogs { 38 | [logStoreHelper getNewLogsSince:lastLogCheckTime]; 39 | lastLogCheckTime = [NSDate date]; 40 | } 41 | 42 | - (void)startObserving 43 | { 44 | hasListeners = YES; 45 | } 46 | 47 | - (void)stopObserving 48 | { 49 | hasListeners = NO; 50 | } 51 | 52 | - (void)sendEvent:(NSString *)name body:(id)body 53 | { 54 | if (hasListeners) { 55 | [self sendEventWithName:name body:body]; 56 | } 57 | } 58 | 59 | - (NSArray *)supportedEvents 60 | { 61 | return @[ 62 | @"newLogAvailable", 63 | ]; 64 | } 65 | 66 | RCT_EXPORT_METHOD(addFilterCondition:(NSString *)filter 67 | resolve:(RCTPromiseResolveBlock)resolve 68 | reject:(RCTPromiseRejectBlock)reject) 69 | { 70 | NSNumber *count = [filters objectForKey:filter]; 71 | if (count) { 72 | [filters setObject:@([count integerValue] + 1) forKey:filter]; 73 | } else { 74 | [filters setObject:@1 forKey:filter]; 75 | } 76 | 77 | resolve(filter); 78 | } 79 | 80 | RCT_EXPORT_METHOD(removeFilterCondition:(NSString *)filter 81 | resolve:(RCTPromiseResolveBlock)resolve 82 | reject:(RCTPromiseRejectBlock)reject) 83 | { 84 | NSNumber *count = [filters objectForKey:filter]; 85 | if (count) { 86 | NSInteger newCount = [count integerValue] - 1; 87 | if (newCount > 0) { 88 | [filters setObject:@(newCount) forKey:filter]; 89 | } else { 90 | [filters removeObjectForKey:filter]; 91 | } 92 | } 93 | 94 | resolve(filter); 95 | } 96 | 97 | RCT_EXPORT_METHOD(configure:(NSDictionary *)params 98 | resolve:(RCTPromiseResolveBlock)resolve 99 | reject:(RCTPromiseRejectBlock)reject) 100 | { 101 | NSString *appGroupName = params[@"appGroupName"]; 102 | if (appGroupName != nil) { 103 | [logStoreHelper setAppGroupName: params[@"appGroupName"]]; 104 | } 105 | NSNumber *interval = params[@"interval"]; 106 | 107 | if ([interval compare:@-1] != NSOrderedSame) { 108 | // Set up a timer to check for new logs periodically 109 | dispatch_async(dispatch_get_main_queue(), ^{ 110 | [NSTimer scheduledTimerWithTimeInterval:[interval doubleValue] 111 | target:self 112 | selector:@selector(checkForNewLogs) 113 | userInfo:nil 114 | repeats:YES]; 115 | }); 116 | } 117 | 118 | resolve(appGroupName); 119 | } 120 | 121 | // Don't compile this code when we build for the old architecture. 122 | #ifdef RCT_NEW_ARCH_ENABLED 123 | - (std::shared_ptr)getTurboModule: 124 | (const facebook::react::ObjCTurboModule::InitParams &)params 125 | { 126 | return std::make_shared(params); 127 | } 128 | #endif 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /ios/OSLogStoreHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OSLogStoreHelper.swift 3 | // react-native-app-logs 4 | // 5 | // Created by Kiryl Ziusko on 09/07/2024. 6 | // 7 | 8 | import Foundation 9 | import OSLog 10 | 11 | extension DateFormatter { 12 | func apply(closure: (DateFormatter) -> Void) -> DateFormatter { 13 | closure(self) 14 | return self 15 | } 16 | } 17 | 18 | @available(iOS 15.0, *) 19 | extension OSLogEntryLog.Level: CustomStringConvertible { 20 | public var description: String { 21 | switch self { 22 | case .undefined: 23 | return "undefined" 24 | case .debug: 25 | return "debug" 26 | case .info: 27 | return "info" 28 | case .notice: 29 | return "notice" 30 | case .error: 31 | return "error" 32 | case .fault: 33 | return "fault" 34 | default: 35 | return "unknown" 36 | } 37 | } 38 | } 39 | 40 | @available(iOS 15.0, *) 41 | @objc 42 | public class OSLogStoreHelper: NSObject { 43 | private static var appGroupName: String? 44 | private var logStore: OSLogStore? 45 | private static var onNewLogs: (([NSDictionary]) -> Void)? = nil 46 | private let formatter = DateFormatter().apply { 47 | $0.timeZone = TimeZone(abbreviation: "UTC") 48 | $0.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'" 49 | } 50 | 51 | @objc public init(onNewLogs: @escaping ([NSDictionary]) -> Void) { 52 | do { 53 | logStore = try OSLogStore(scope: .currentProcessIdentifier) 54 | } catch { 55 | print("Failed to create OSLogStore: \(error)") 56 | } 57 | OSLogStoreHelper.onNewLogs = onNewLogs 58 | 59 | super.init() 60 | 61 | // Register for Darwin notifications 62 | let notificationName = "io.margelo.newLogsAvailable" 63 | let center = CFNotificationCenterGetDarwinNotifyCenter() 64 | let observer = UnsafeRawPointer(Unmanaged.passUnretained(self).toOpaque()) 65 | 66 | CFNotificationCenterAddObserver(center, 67 | observer, 68 | { _, _, _, _, _ in 69 | OSLogStoreHelper.handleNewData() 70 | }, 71 | notificationName as CFString, 72 | nil, 73 | .deliverImmediately) 74 | } 75 | 76 | static func handleNewData() { 77 | let userDefaults = UserDefaults(suiteName: appGroupName) 78 | if let passedStrings = userDefaults?.array(forKey: "logs") as? [NSDictionary] { 79 | print("Received strings: \(passedStrings)") 80 | OSLogStoreHelper.onNewLogs?(passedStrings) 81 | // remove temporary data 82 | userDefaults?.set([], forKey: "logs") 83 | userDefaults?.synchronize() 84 | } 85 | } 86 | 87 | deinit { 88 | // Unregister the observer when the module is deallocated 89 | let center = CFNotificationCenterGetDarwinNotifyCenter() 90 | let observer = UnsafeRawPointer(Unmanaged.passUnretained(self).toOpaque()) 91 | CFNotificationCenterRemoveObserver(center, observer, nil, nil) 92 | } 93 | 94 | @objc public func setAppGroupName(_ appGroupName: String) { 95 | OSLogStoreHelper.appGroupName = appGroupName 96 | } 97 | 98 | @objc public func getNewLogs(since startTime: Date) { 99 | guard let logStore = logStore else { 100 | OSLogStoreHelper.onNewLogs?([]) 101 | return 102 | } 103 | 104 | DispatchQueue.global().async { 105 | let start = CFAbsoluteTimeGetCurrent() 106 | let now = Date() 107 | let predicate = NSPredicate(format: "date >= %@ AND date <= %@", startTime as NSDate, now as NSDate) 108 | var entries: [NSDictionary] = [] 109 | 110 | do { 111 | let allEntries = try logStore.getEntries(matching: predicate) 112 | 113 | for entry in allEntries { 114 | if let logEntry = entry as? OSLogEntryLog { 115 | entries.append([ 116 | "message": logEntry.composedMessage, 117 | "timestamp": self.formatter.string(from: logEntry.date), 118 | "process": logEntry.process, 119 | "pid": logEntry.processIdentifier, 120 | "tid": logEntry.threadIdentifier, 121 | "level": logEntry.level.description, 122 | ]) 123 | } 124 | } 125 | } catch { 126 | print("Failed to get log entries: \(error)") 127 | } 128 | 129 | let diff = CFAbsoluteTimeGetCurrent() - start 130 | print("Took \(diff) seconds Logs: \(entries.count)") 131 | 132 | OSLogStoreHelper.onNewLogs?(entries) 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /jest/index.js: -------------------------------------------------------------------------------- 1 | const NOOP = () => {}; 2 | const AppLogsEvents = { 3 | registerHandler: () => ({ remove: NOOP }), 4 | configure: NOOP, 5 | }; 6 | 7 | export default AppLogsEvents; 8 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: true 3 | commands: 4 | lint: 5 | glob: "*.{js,ts,jsx,tsx}" 6 | run: npx eslint {staged_files} 7 | types: 8 | glob: "*.{js,ts, jsx, tsx}" 9 | run: npx tsc --noEmit 10 | commit-msg: 11 | parallel: true 12 | commands: 13 | commitlint: 14 | run: npx commitlint --edit 15 | -------------------------------------------------------------------------------- /lib/commonjs/NativeAppLogs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | var _reactNative = require("react-native"); 8 | var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('AppLogs'); 9 | //# sourceMappingURL=NativeAppLogs.js.map -------------------------------------------------------------------------------- /lib/commonjs/NativeAppLogs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeAppLogs.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAcpCC,gCAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/commonjs/bindings.ios.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | var _reactNative = require("react-native"); 8 | const LINKING_ERROR = `The package 'react-native-app-logs' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({ 9 | ios: "- You have run 'pod install'\n", 10 | default: '' 11 | }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; 12 | 13 | // @ts-expect-error 14 | const isTurboModuleEnabled = global.__turboModuleProxy != null; 15 | const AppLogsModule = isTurboModuleEnabled ? require('./NativeAppLogs').default : _reactNative.NativeModules.AppLogs; 16 | const AppLogs = AppLogsModule ? AppLogsModule : new Proxy({}, { 17 | get() { 18 | throw new Error(LINKING_ERROR); 19 | } 20 | }); 21 | const eventEmitter = new _reactNative.NativeEventEmitter(AppLogs); 22 | const AppLogsEvents = { 23 | registerHandler: ({ 24 | handler, 25 | filter = '' 26 | }) => { 27 | AppLogs.addFilterCondition(filter); 28 | const subscription = eventEmitter.addListener('newLogAvailable', handler); 29 | return { 30 | remove: () => { 31 | AppLogs.removeFilterCondition(filter); 32 | subscription.remove(); 33 | } 34 | }; 35 | }, 36 | configure: AppLogs.configure 37 | }; 38 | var _default = exports.default = AppLogsEvents; 39 | //# sourceMappingURL=bindings.ios.js.map -------------------------------------------------------------------------------- /lib/commonjs/bindings.ios.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","AppLogsModule","NativeModules","AppLogs","Proxy","get","Error","eventEmitter","NativeEventEmitter","AppLogsEvents","registerHandler","handler","filter","addFilterCondition","subscription","addListener","remove","removeFilterCondition","configure","_default","exports"],"sourceRoot":"../../src","sources":["bindings.ios.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAMC,aAAa,GACjB,gFAAgF,GAChFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,aAAa,GAAGH,oBAAoB,GACtCN,OAAO,CAAC,iBAAiB,CAAC,CAACK,OAAO,GAClCK,0BAAa,CAACC,OAAO;AAEzB,MAAMA,OAAO,GAAGF,aAAa,GACzBA,aAAa,GACb,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACb,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMc,YAAY,GAAG,IAAIC,+BAAkB,CAACL,OAAO,CAAC;AAEpD,MAAMM,aAAa,GAAG;EACpBC,eAAe,EAAEA,CAAC;IAChBC,OAAO;IACPC,MAAM,GAAG;EAIX,CAAC,KAAK;IACJT,OAAO,CAACU,kBAAkB,CAACD,MAAM,CAAC;IAClC,MAAME,YAAY,GAAGP,YAAY,CAACQ,WAAW,CAAC,iBAAiB,EAAEJ,OAAO,CAAC;IAEzE,OAAO;MACLK,MAAM,EAAEA,CAAA,KAAM;QACZb,OAAO,CAACc,qBAAqB,CAACL,MAAM,CAAC;QACrCE,YAAY,CAACE,MAAM,CAAC,CAAC;MACvB;IACF,CAAC;EACH,CAAC;EACDE,SAAS,EAAEf,OAAO,CAACe;AACrB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEaY,aAAa","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/commonjs/bindings.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.default = void 0; 7 | const AppLogsEvents = { 8 | registerHandler: _fn => { 9 | // no-op 10 | return { 11 | remove: () => {} 12 | }; 13 | }, 14 | configure: _params => { 15 | // no-op 16 | } 17 | }; 18 | var _default = exports.default = AppLogsEvents; 19 | //# sourceMappingURL=bindings.js.map -------------------------------------------------------------------------------- /lib/commonjs/bindings.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["AppLogsEvents","registerHandler","_fn","remove","configure","_params","_default","exports","default"],"sourceRoot":"../../src","sources":["bindings.ts"],"mappings":";;;;;;AAEA,MAAMA,aAAa,GAAG;EACpBC,eAAe,EAAGC,GAGjB,IAAK;IACJ;IACA,OAAO;MAAEC,MAAM,EAAEA,CAAA,KAAM,CAAC;IAAE,CAAC;EAC7B,CAAC;EACDC,SAAS,EAAGC,OAAwB,IAAK;IACvC;EAAA;AAEJ,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaR,aAAa","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/commonjs/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | var _exportNames = {}; 7 | Object.defineProperty(exports, "default", { 8 | enumerable: true, 9 | get: function () { 10 | return _bindings.default; 11 | } 12 | }); 13 | var _bindings = _interopRequireDefault(require("./bindings")); 14 | var _types = require("./types.js"); 15 | Object.keys(_types).forEach(function (key) { 16 | if (key === "default" || key === "__esModule") return; 17 | if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; 18 | if (key in exports && exports[key] === _types[key]) return; 19 | Object.defineProperty(exports, key, { 20 | enumerable: true, 21 | get: function () { 22 | return _types[key]; 23 | } 24 | }); 25 | }); 26 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } 27 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/commonjs/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["_bindings","_interopRequireDefault","require","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAAwB,SAAAN,uBAAAe,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/commonjs/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=types.js.map -------------------------------------------------------------------------------- /lib/commonjs/types.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/module/NativeAppLogs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import { TurboModuleRegistry } from 'react-native'; 4 | export default TurboModuleRegistry.getEnforcing('AppLogs'); 5 | //# sourceMappingURL=NativeAppLogs.js.map -------------------------------------------------------------------------------- /lib/module/NativeAppLogs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeAppLogs.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAclD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/module/bindings.ios.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import { NativeEventEmitter, NativeModules, Platform } from 'react-native'; 4 | const LINKING_ERROR = `The package 'react-native-app-logs' doesn't seem to be linked. Make sure: \n\n` + Platform.select({ 5 | ios: "- You have run 'pod install'\n", 6 | default: '' 7 | }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; 8 | 9 | // @ts-expect-error 10 | const isTurboModuleEnabled = global.__turboModuleProxy != null; 11 | const AppLogsModule = isTurboModuleEnabled ? require('./NativeAppLogs').default : NativeModules.AppLogs; 12 | const AppLogs = AppLogsModule ? AppLogsModule : new Proxy({}, { 13 | get() { 14 | throw new Error(LINKING_ERROR); 15 | } 16 | }); 17 | const eventEmitter = new NativeEventEmitter(AppLogs); 18 | const AppLogsEvents = { 19 | registerHandler: ({ 20 | handler, 21 | filter = '' 22 | }) => { 23 | AppLogs.addFilterCondition(filter); 24 | const subscription = eventEmitter.addListener('newLogAvailable', handler); 25 | return { 26 | remove: () => { 27 | AppLogs.removeFilterCondition(filter); 28 | subscription.remove(); 29 | } 30 | }; 31 | }, 32 | configure: AppLogs.configure 33 | }; 34 | export default AppLogsEvents; 35 | //# sourceMappingURL=bindings.ios.js.map -------------------------------------------------------------------------------- /lib/module/bindings.ios.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","AppLogsModule","require","AppLogs","Proxy","get","Error","eventEmitter","AppLogsEvents","registerHandler","handler","filter","addFilterCondition","subscription","addListener","remove","removeFilterCondition","configure"],"sourceRoot":"../../src","sources":["bindings.ios.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAG1E,MAAMC,aAAa,GACjB,gFAAgF,GAChFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,aAAa,GAAGH,oBAAoB,GACtCI,OAAO,CAAC,iBAAiB,CAAC,CAACL,OAAO,GAClCL,aAAa,CAACW,OAAO;AAEzB,MAAMA,OAAO,GAAGF,aAAa,GACzBA,aAAa,GACb,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACZ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMa,YAAY,GAAG,IAAIhB,kBAAkB,CAACY,OAAO,CAAC;AAEpD,MAAMK,aAAa,GAAG;EACpBC,eAAe,EAAEA,CAAC;IAChBC,OAAO;IACPC,MAAM,GAAG;EAIX,CAAC,KAAK;IACJR,OAAO,CAACS,kBAAkB,CAACD,MAAM,CAAC;IAClC,MAAME,YAAY,GAAGN,YAAY,CAACO,WAAW,CAAC,iBAAiB,EAAEJ,OAAO,CAAC;IAEzE,OAAO;MACLK,MAAM,EAAEA,CAAA,KAAM;QACZZ,OAAO,CAACa,qBAAqB,CAACL,MAAM,CAAC;QACrCE,YAAY,CAACE,MAAM,CAAC,CAAC;MACvB;IACF,CAAC;EACH,CAAC;EACDE,SAAS,EAAEd,OAAO,CAACc;AACrB,CAAC;AAED,eAAeT,aAAa","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/module/bindings.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const AppLogsEvents = { 4 | registerHandler: _fn => { 5 | // no-op 6 | return { 7 | remove: () => {} 8 | }; 9 | }, 10 | configure: _params => { 11 | // no-op 12 | } 13 | }; 14 | export default AppLogsEvents; 15 | //# sourceMappingURL=bindings.js.map -------------------------------------------------------------------------------- /lib/module/bindings.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["AppLogsEvents","registerHandler","_fn","remove","configure","_params"],"sourceRoot":"../../src","sources":["bindings.ts"],"mappings":";;AAEA,MAAMA,aAAa,GAAG;EACpBC,eAAe,EAAGC,GAGjB,IAAK;IACJ;IACA,OAAO;MAAEC,MAAM,EAAEA,CAAA,KAAM,CAAC;IAAE,CAAC;EAC7B,CAAC;EACDC,SAAS,EAAGC,OAAwB,IAAK;IACvC;EAAA;AAEJ,CAAC;AAED,eAAeL,aAAa","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/module/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | export { default } from './bindings'; 4 | export * from "./types.js"; 5 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/module/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":["default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,cAAc,YAAS","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/module/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | //# sourceMappingURL=types.js.map -------------------------------------------------------------------------------- /lib/module/types.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]} 2 | -------------------------------------------------------------------------------- /lib/typescript/src/NativeAppLogs.d.ts: -------------------------------------------------------------------------------- 1 | import type { TurboModule } from 'react-native'; 2 | import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; 3 | type ConfigureParams = Readonly<{ 4 | appGroupName: string | undefined; 5 | interval: Int32; 6 | }>; 7 | export interface Spec extends TurboModule { 8 | addFilterCondition(filter: string): void; 9 | removeFilterCondition(filter: string): void; 10 | configure(params: ConfigureParams): void; 11 | } 12 | declare const _default: Spec; 13 | export default _default; 14 | //# sourceMappingURL=NativeAppLogs.d.ts.map -------------------------------------------------------------------------------- /lib/typescript/src/NativeAppLogs.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"NativeAppLogs.d.ts","sourceRoot":"","sources":["../../../src/NativeAppLogs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAEvE,KAAK,eAAe,GAAG,QAAQ,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,KAAK,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CAC1C;;AAED,wBAAiE"} -------------------------------------------------------------------------------- /lib/typescript/src/__tests__/index.test.d.ts: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=index.test.d.ts.map -------------------------------------------------------------------------------- /lib/typescript/src/__tests__/index.test.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/index.test.tsx"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /lib/typescript/src/bindings.d.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigureParams, NativeLog } from './types'; 2 | declare const AppLogsEvents: { 3 | registerHandler: (_fn: { 4 | handler: (params: { 5 | logs: NativeLog[]; 6 | filter: string; 7 | }) => void; 8 | filter?: string; 9 | }) => { 10 | remove: () => void; 11 | }; 12 | configure: (_params: ConfigureParams) => void; 13 | }; 14 | export default AppLogsEvents; 15 | //# sourceMappingURL=bindings.d.ts.map -------------------------------------------------------------------------------- /lib/typescript/src/bindings.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../src/bindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1D,QAAA,MAAM,aAAa;2BACM;QACrB,OAAO,EAAE,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,SAAS,EAAE,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,KAAK,IAAI,CAAC;QACjE,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;;;yBAIoB,eAAe;CAGrC,CAAC;AAEF,eAAe,aAAa,CAAC"} -------------------------------------------------------------------------------- /lib/typescript/src/bindings.ios.d.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigureParams, NativeLog } from './types'; 2 | declare const AppLogsEvents: { 3 | registerHandler: ({ handler, filter, }: { 4 | handler: (params: { 5 | logs: NativeLog[]; 6 | filter: string; 7 | }) => void; 8 | filter?: string; 9 | }) => { 10 | remove: () => void; 11 | }; 12 | configure: (params: ConfigureParams) => void; 13 | }; 14 | export default AppLogsEvents; 15 | //# sourceMappingURL=bindings.ios.d.ts.map -------------------------------------------------------------------------------- /lib/typescript/src/bindings.ios.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bindings.ios.d.ts","sourceRoot":"","sources":["../../../src/bindings.ios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA4B1D,QAAA,MAAM,aAAa;4CAId;QACD,OAAO,EAAE,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,SAAS,EAAE,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,KAAK,IAAI,CAAC;QACjE,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;;;eAW+B,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI;CAClE,CAAC;AAEF,eAAe,aAAa,CAAC"} -------------------------------------------------------------------------------- /lib/typescript/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default } from './bindings'; 2 | export * from './types'; 3 | //# sourceMappingURL=index.d.ts.map -------------------------------------------------------------------------------- /lib/typescript/src/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,cAAc,SAAS,CAAC"} -------------------------------------------------------------------------------- /lib/typescript/src/types.d.ts: -------------------------------------------------------------------------------- 1 | export type NativeLog = { 2 | message: string; 3 | timestamp: string; 4 | process: string; 5 | /** Process ID */ 6 | pid: number; 7 | /** Thread ID */ 8 | tid: number; 9 | level: string; 10 | }; 11 | export type ConfigureParams = { 12 | /** common `appGroupName` shared between targets (iOS only) */ 13 | appGroupName?: string; 14 | /** interval (in seconds) to fetch logs (iOS only). Specify `-1` if you don't want to run periodic checks */ 15 | interval: number; 16 | }; 17 | //# sourceMappingURL=types.d.ts.map -------------------------------------------------------------------------------- /lib/typescript/src/types.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,eAAe,GAAG;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-app-logs", 3 | "version": "0.3.2", 4 | "description": "Access native logs from JS code", 5 | "source": "./src/index", 6 | "main": "./lib/commonjs/index", 7 | "module": "./lib/module/index", 8 | "types": "./lib/typescript/src/index.d.ts", 9 | "react-native": "./src/index", 10 | "files": [ 11 | "src", 12 | "lib", 13 | "android", 14 | "ios", 15 | "cpp", 16 | "jest", 17 | "AppLogsPod", 18 | "*.podspec", 19 | "!ios/build", 20 | "!android/build", 21 | "!android/gradle", 22 | "!android/gradlew", 23 | "!android/gradlew.bat", 24 | "!android/local.properties", 25 | "!**/__tests__", 26 | "!**/__fixtures__", 27 | "!**/__mocks__", 28 | "!**/.*" 29 | ], 30 | "scripts": { 31 | "example": "yarn workspace react-native-app-logs-example", 32 | "test": "jest", 33 | "typecheck": "tsc --noEmit", 34 | "lint": "eslint \"**/*.{js,ts,tsx}\"", 35 | "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", 36 | "prepare": "bob build", 37 | "release": "release-it" 38 | }, 39 | "keywords": [ 40 | "react-native", 41 | "ios", 42 | "android" 43 | ], 44 | "repository": { 45 | "type": "git", 46 | "url": "git+https://github.com/margelo/react-native-app-logs.git" 47 | }, 48 | "author": "Kiryl Ziusko (https://github.com/kirillzyusko)", 49 | "license": "MIT", 50 | "bugs": { 51 | "url": "https://github.com/margelo/react-native-app-logs/issues" 52 | }, 53 | "homepage": "https://github.com/margelo/react-native-app-logs#readme", 54 | "publishConfig": { 55 | "registry": "https://registry.npmjs.org/" 56 | }, 57 | "devDependencies": { 58 | "@commitlint/config-conventional": "^17.0.2", 59 | "@evilmartians/lefthook": "^1.5.0", 60 | "@react-native/eslint-config": "^0.73.1", 61 | "@release-it/conventional-changelog": "^5.0.0", 62 | "@types/jest": "^29.5.5", 63 | "@types/react": "^18.2.44", 64 | "commitlint": "^17.0.2", 65 | "del-cli": "^5.1.0", 66 | "eslint": "^8.51.0", 67 | "eslint-config-prettier": "^9.0.0", 68 | "eslint-plugin-prettier": "^5.0.1", 69 | "jest": "^29.7.0", 70 | "prettier": "^3.0.3", 71 | "react": "18.2.0", 72 | "react-native": "0.74.3", 73 | "react-native-builder-bob": "0.30.2", 74 | "release-it": "^15.0.0", 75 | "turbo": "^1.10.7", 76 | "typescript": "^5.2.2" 77 | }, 78 | "resolutions": { 79 | "@types/react": "^18.2.44" 80 | }, 81 | "peerDependencies": { 82 | "react": "*", 83 | "react-native": "*" 84 | }, 85 | "workspaces": [ 86 | "example" 87 | ], 88 | "packageManager": "yarn@3.6.1", 89 | "jest": { 90 | "preset": "react-native", 91 | "modulePathIgnorePatterns": [ 92 | "/example/node_modules", 93 | "/lib/" 94 | ] 95 | }, 96 | "commitlint": { 97 | "extends": [ 98 | "@commitlint/config-conventional" 99 | ] 100 | }, 101 | "release-it": { 102 | "git": { 103 | "commitMessage": "chore: release ${version}", 104 | "tagName": "v${version}" 105 | }, 106 | "npm": { 107 | "publish": true 108 | }, 109 | "github": { 110 | "release": true 111 | }, 112 | "plugins": { 113 | "@release-it/conventional-changelog": { 114 | "preset": "angular" 115 | } 116 | } 117 | }, 118 | "eslintConfig": { 119 | "root": true, 120 | "extends": [ 121 | "@react-native", 122 | "prettier" 123 | ], 124 | "rules": { 125 | "react/react-in-jsx-scope": "off", 126 | "prettier/prettier": [ 127 | "error", 128 | { 129 | "quoteProps": "consistent", 130 | "singleQuote": true, 131 | "tabWidth": 2, 132 | "trailingComma": "es5", 133 | "useTabs": false 134 | } 135 | ] 136 | } 137 | }, 138 | "eslintIgnore": [ 139 | "node_modules/", 140 | "lib/" 141 | ], 142 | "prettier": { 143 | "quoteProps": "consistent", 144 | "singleQuote": true, 145 | "tabWidth": 2, 146 | "trailingComma": "es5", 147 | "useTabs": false 148 | }, 149 | "react-native-builder-bob": { 150 | "source": "src", 151 | "output": "lib", 152 | "targets": [ 153 | [ 154 | "commonjs", 155 | { 156 | "esm": true 157 | } 158 | ], 159 | [ 160 | "module", 161 | { 162 | "esm": true 163 | } 164 | ], 165 | [ 166 | "typescript", 167 | { 168 | "project": "tsconfig.build.json" 169 | } 170 | ] 171 | ] 172 | }, 173 | "codegenConfig": { 174 | "name": "RNAppLogsSpec", 175 | "type": "modules", 176 | "jsSrcsDir": "src" 177 | }, 178 | "create-react-native-library": { 179 | "type": "module-mixed", 180 | "languages": "kotlin-objc", 181 | "version": "0.38.1" 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /react-native-app-logs.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' 5 | 6 | Pod::Spec.new do |s| 7 | s.name = "react-native-app-logs" 8 | s.version = package["version"] 9 | s.summary = package["description"] 10 | s.homepage = package["homepage"] 11 | s.license = package["license"] 12 | s.authors = package["author"] 13 | 14 | s.platforms = { :ios => min_ios_version_supported } 15 | s.source = { :git => "https://github.com/kirillzyusko/react-native-app-logs.git", :tag => "#{s.version}" } 16 | 17 | s.source_files = "ios/**/*.{h,m,mm,swift}" 18 | s.public_header_files = "ios/**/*.h" 19 | 20 | # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. 21 | # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. 22 | if respond_to?(:install_modules_dependencies, true) 23 | install_modules_dependencies(s) 24 | else 25 | s.dependency "React-Core" 26 | 27 | # Don't install the dependencies when we run `pod install` in the old architecture. 28 | if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then 29 | s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" 30 | s.pod_target_xcconfig = { 31 | "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", 32 | "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1", 33 | "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" 34 | } 35 | s.dependency "React-Codegen" 36 | s.dependency "RCT-Folly" 37 | s.dependency "RCTRequired" 38 | s.dependency "RCTTypeSafety" 39 | s.dependency "ReactCommon/turbomodule/core" 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/NativeAppLogs.ts: -------------------------------------------------------------------------------- 1 | import type { TurboModule } from 'react-native'; 2 | import { TurboModuleRegistry } from 'react-native'; 3 | import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes'; 4 | 5 | type ConfigureParams = Readonly<{ 6 | appGroupName: string | undefined; 7 | interval: Int32; 8 | }>; 9 | 10 | export interface Spec extends TurboModule { 11 | addFilterCondition(filter: string): void; 12 | removeFilterCondition(filter: string): void; 13 | configure(params: ConfigureParams): void; 14 | } 15 | 16 | export default TurboModuleRegistry.getEnforcing('AppLogs'); 17 | -------------------------------------------------------------------------------- /src/__tests__/index.test.tsx: -------------------------------------------------------------------------------- 1 | it.todo('write a test'); 2 | -------------------------------------------------------------------------------- /src/bindings.ios.ts: -------------------------------------------------------------------------------- 1 | import { NativeEventEmitter, NativeModules, Platform } from 'react-native'; 2 | import type { ConfigureParams, NativeLog } from './types'; 3 | 4 | const LINKING_ERROR = 5 | `The package 'react-native-app-logs' doesn't seem to be linked. Make sure: \n\n` + 6 | Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + 7 | '- You rebuilt the app after installing the package\n' + 8 | '- You are not using Expo Go\n'; 9 | 10 | // @ts-expect-error 11 | const isTurboModuleEnabled = global.__turboModuleProxy != null; 12 | 13 | const AppLogsModule = isTurboModuleEnabled 14 | ? require('./NativeAppLogs').default 15 | : NativeModules.AppLogs; 16 | 17 | const AppLogs = AppLogsModule 18 | ? AppLogsModule 19 | : new Proxy( 20 | {}, 21 | { 22 | get() { 23 | throw new Error(LINKING_ERROR); 24 | }, 25 | } 26 | ); 27 | 28 | const eventEmitter = new NativeEventEmitter(AppLogs); 29 | 30 | const AppLogsEvents = { 31 | registerHandler: ({ 32 | handler, 33 | filter = '', 34 | }: { 35 | handler: (params: { logs: NativeLog[]; filter: string }) => void; 36 | filter?: string; 37 | }) => { 38 | AppLogs.addFilterCondition(filter); 39 | const subscription = eventEmitter.addListener('newLogAvailable', handler); 40 | 41 | return { 42 | remove: () => { 43 | AppLogs.removeFilterCondition(filter); 44 | subscription.remove(); 45 | }, 46 | }; 47 | }, 48 | configure: AppLogs.configure as (params: ConfigureParams) => void, 49 | }; 50 | 51 | export default AppLogsEvents; 52 | -------------------------------------------------------------------------------- /src/bindings.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigureParams, NativeLog } from './types'; 2 | 3 | const AppLogsEvents = { 4 | registerHandler: (_fn: { 5 | handler: (params: { logs: NativeLog[]; filter: string }) => void; 6 | filter?: string; 7 | }) => { 8 | // no-op 9 | return { remove: () => {} }; 10 | }, 11 | configure: (_params: ConfigureParams) => { 12 | // no-op 13 | }, 14 | }; 15 | 16 | export default AppLogsEvents; 17 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | export { default } from './bindings'; 2 | export * from './types'; 3 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | export type NativeLog = { 2 | message: string; 3 | timestamp: string; 4 | process: string; 5 | /** Process ID */ 6 | pid: number; 7 | /** Thread ID */ 8 | tid: number; 9 | level: string; 10 | }; 11 | export type ConfigureParams = { 12 | /** common `appGroupName` shared between targets (iOS only) */ 13 | appGroupName?: string; 14 | /** interval (in seconds) to fetch logs (iOS only). Specify `-1` if you don't want to run periodic checks */ 15 | interval: number; 16 | }; 17 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "exclude": ["example"] 4 | } 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": ".", 4 | "paths": { 5 | "react-native-app-logs": ["./src/index"] 6 | }, 7 | "allowUnreachableCode": false, 8 | "allowUnusedLabels": false, 9 | "esModuleInterop": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "jsx": "react-jsx", 12 | "lib": ["ESNext"], 13 | "module": "ESNext", 14 | "moduleResolution": "Bundler", 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitReturns": true, 17 | "noImplicitUseStrict": false, 18 | "noStrictGenericChecks": false, 19 | "noUncheckedIndexedAccess": true, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "resolveJsonModule": true, 23 | "skipLibCheck": true, 24 | "strict": true, 25 | "target": "ESNext", 26 | "verbatimModuleSyntax": true 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "pipeline": { 4 | "build:android": { 5 | "inputs": [ 6 | "package.json", 7 | "android", 8 | "!android/build", 9 | "src/*.ts", 10 | "src/*.tsx", 11 | "example/package.json", 12 | "example/android", 13 | "!example/android/.gradle", 14 | "!example/android/build", 15 | "!example/android/app/build" 16 | ], 17 | "outputs": [] 18 | }, 19 | "build:ios": { 20 | "inputs": [ 21 | "package.json", 22 | "*.podspec", 23 | "ios", 24 | "src/*.ts", 25 | "src/*.tsx", 26 | "example/package.json", 27 | "example/ios", 28 | "!example/ios/build", 29 | "!example/ios/Pods" 30 | ], 31 | "outputs": [] 32 | } 33 | } 34 | } 35 | --------------------------------------------------------------------------------