Skip to content

Commit

Permalink
Merge pull request #582 from ephemeraHQ/cv/fix-share-android-log-file
Browse files Browse the repository at this point in the history
fix: sharing files from debug screen fixed so it works on iOS and Android
  • Loading branch information
cameronvoell authored Aug 28, 2024
2 parents 2368faa + 667bb5c commit 815cf3c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 22 deletions.
12 changes: 8 additions & 4 deletions components/DebugButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import Constants from "expo-constants";
import { Image } from "expo-image";
import * as Updates from "expo-updates";
import { forwardRef, useImperativeHandle } from "react";
import { Platform, Alert, Share } from "react-native";
import { Platform, Alert } from "react-native";
import Share from "react-native-share";

import { showActionSheetWithOptions } from "./StateHandlers/ActionSheetStateHandler";
import config from "../config";
Expand Down Expand Up @@ -46,26 +47,29 @@ const DebugButton = forwardRef((props, ref) => {
showDebugMenu() {
const methods: any = {
"Share current session logs": async () => {
Share.share({
Share.open({
title: "Converse Log Session",
url: `file://${loggingFilePath}`,
type: "text/plain",
});
},
"Share native logs": async () => {
const nativeLogFilePath = await getNativeLogFile();
Share.share({
Share.open({
title: "LibXMTP Logs",
url: `file://${nativeLogFilePath}`,
type: "text/plain",
});
},
"Share previous session logs": async () => {
const previousLoggingFile = await getPreviousSessionLoggingFile();
if (!previousLoggingFile) {
return Alert.alert("No previous session logging file found");
}
Share.share({
Share.open({
title: "Converse Log Session",
url: `file://${previousLoggingFile}`,
type: "text/plain",
});
},
"New log session": rotateLoggingFile,
Expand Down
42 changes: 24 additions & 18 deletions ios/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
claide (1.1.0)
cocoapods (1.12.1)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.12.1)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
Expand All @@ -32,8 +35,8 @@ GEM
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.12.1)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -44,7 +47,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-pod-linkage (0.0.1)
Expand All @@ -55,31 +58,34 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
ffi (1.17.0-arm64-darwin)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.19.0)
json (2.7.1)
minitest (5.20.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.6)
rexml (3.2.9)
strscan
ruby-macho (2.5.1)
typhoeus (1.4.0)
strscan (1.0.3)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.22.0)
xcodeproj (1.24.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -88,12 +94,12 @@ GEM
rexml (~> 3.2.4)

PLATFORMS
ruby
arm64-darwin-23

DEPENDENCIES
activesupport (>= 6.1.7.3, < 7.1.0)
cocoapods
cocoapods-pod-linkage

BUNDLED WITH
2.1.4
2.4.10
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,8 @@ PODS:
- React-Core
- React-hermes
- Sentry/HybridSDK (= 8.29.1)
- RNShare (10.2.1):
- React-Core
- RNSVG (15.2.0):
- React-Core
- SDWebImage (5.19.7):
Expand Down Expand Up @@ -1933,6 +1935,7 @@ DEPENDENCIES:
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- "RNSentry (from `../node_modules/@sentry/react-native`)"
- RNShare (from `../node_modules/react-native-share`)
- RNSVG (from `../node_modules/react-native-svg`)
- Sentry/HybridSDK (= 8.29.1)
- SQLite.swift
Expand Down Expand Up @@ -2221,6 +2224,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-screens"
RNSentry:
:path: "../node_modules/@sentry/react-native"
RNShare:
:path: "../node_modules/react-native-share"
RNSVG:
:path: "../node_modules/react-native-svg"
UMAppLoader:
Expand Down Expand Up @@ -2372,6 +2377,7 @@ SPEC CHECKSUMS:
RNReanimated: d51431fd3597a8f8320319dce8e42cee82a5445f
RNScreens: 30249f9331c3b00ae7cb7922e11f58b3ed369c07
RNSentry: e9aa15bb2f3e18c822c002eea13bbd3b222ab493
RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c
RNSVG: 43b64ed39c14ce830d840903774154ca0c1f27ec
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
SDWebImageAVIFCoder: 00310d246aab3232ce77f1d8f0076f8c4b021d90
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-sfsymbols": "^1.2.1",
"react-native-share": "^10.2.1",
"react-native-shared-group-preferences": "^1.1.23",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "15.2.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21157,6 +21157,11 @@ react-native-sfsymbols@^1.2.1:
resolved "https://registry.yarnpkg.com/react-native-sfsymbols/-/react-native-sfsymbols-1.2.1.tgz#53422d432dca1e028cfd95a283d69a590d3e3f84"
integrity sha512-G8TLcTJwUsVhDQV/yatoltWF+BWrEyb5Grmrhzdrc0gH9TgXnjfoJ9QxaWwC/3D6QVuaugosnbmlL69EurgM/w==

react-native-share@^10.2.1:
version "10.2.1"
resolved "https://registry.npmjs.org/react-native-share/-/react-native-share-10.2.1.tgz#baf94848c2acee6e52f6b28e05c47fa5fa9402be"
integrity sha512-Z2LWGYWH7raM4H6Oauttv1tEhaB43XSWJAN8iS6oaSG9CnyrUBeYFF4QpU1AH5RgNeylXQdN8CtbizCHHt6coQ==

react-native-shared-group-preferences@^1.1.23:
version "1.1.23"
resolved "https://registry.npmjs.org/react-native-shared-group-preferences/-/react-native-shared-group-preferences-1.1.23.tgz"
Expand Down

0 comments on commit 815cf3c

Please sign in to comment.