Skip to content

Commit

Permalink
build(deps): bump instagram sharing deps (#11177)
Browse files Browse the repository at this point in the history
* build(deps): bump sharing deps

* fix: remove new lines from base64 fix for crashes on ios <18
  • Loading branch information
gkartalis authored Nov 22, 2024
1 parent 8493092 commit e91bac2
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 54 deletions.
50 changes: 44 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-blob-util (0.19.9):
- react-native-blob-util (0.19.11):
- React-Core
- react-native-blurhash (1.1.11):
- React-Core
Expand Down Expand Up @@ -1566,8 +1566,27 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-view-shot (3.8.0):
- react-native-view-shot (4.0.2):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-webview (13.6.3):
- React-Core
- React-nativeconfig (0.75.4)
Expand Down Expand Up @@ -2050,8 +2069,27 @@ PODS:
- ReactCommon/turbomodule/core
- Sentry/HybridSDK (= 8.36.0)
- Yoga
- RNShare (10.0.2):
- RNShare (11.1.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNSVG (14.1.0):
- React-Core
- SDWebImage (5.19.1):
Expand Down Expand Up @@ -2720,7 +2758,7 @@ SPEC CHECKSUMS:
React-logger: 80d87daf2f98bf95ab668b79062c1e0c3f0c2f8a
React-Mapbuffer: acffb35a53a5f474ede09f082ac609b41aafab2e
React-microtasksnativemodule: 71ca9282bce93b319218d75362c0d646b376eb43
react-native-blob-util: 6560d6fc4b940ec140f9c3ebe21c8669b1df789b
react-native-blob-util: f7234c91ad0e3faeee51b3edee80b61553f74993
react-native-blurhash: 275104c6fb85e754c448854024bf7a8d4571ba8a
react-native-config: 1baea138c9641f8460d7730568daf2ff3738c4db
react-native-context-menu-view: 74fbcf8a5f842c4802d0121addda2f8ffca43604
Expand All @@ -2735,7 +2773,7 @@ SPEC CHECKSUMS:
react-native-render-html: 5afc4751f1a98621b3009432ef84c47019dcb2bd
react-native-safe-area-context: 8d2875c0b41484fda7ab7c803f40d016b8a7ca8c
react-native-shake: e225eeedd2404d68f79904051622fff0e877ec08
react-native-view-shot: d1a701eb0719c6dccbd20b4bb43b1069f304cb70
react-native-view-shot: 732355b3dd55559f53e66434638e2de5e59c14ed
react-native-webview: 508a7967877321541cc7ff68740f2c294243415c
React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794
React-NativeModulesApple: 97f606f09fd9840b3868333984d6a0e7bcc425b5
Expand Down Expand Up @@ -2782,7 +2820,7 @@ SPEC CHECKSUMS:
RNReanimated: 6398ee150e1ebeda517fdd1e1b5525833a0c0ddc
RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9
RNSentry: 8473fe16e2b05a9a6f4336369af0fa713e1eaf59
RNShare: 01c717e457489779d16293d2afef36995aadd001
RNShare: 6204e6a1987ba3e7c47071ef703e5449a0e3548a
RNSVG: 6d5ed33b6635ed6d6ecb50744dcf127580c39ed5
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
Expand Down
1 change: 1 addition & 0 deletions main.jsbundle.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"react-error-boundary": "4.0.13",
"react-fps": "1.0.6",
"react-native": "0.75.4",
"react-native-blob-util": "0.19.9",
"react-native-blob-util": "0.19.11",
"react-native-blurhash": "1.1.11",
"react-native-bootsplash": "6.1.3",
"react-native-code-push": "8.3.1",
Expand Down Expand Up @@ -186,10 +186,10 @@
"react-native-safe-area-context": "3.4.0",
"react-native-screens": "3.35.0",
"react-native-shake": "5.5.2",
"react-native-share": "10.0.2",
"react-native-share": "11.1.0",
"react-native-svg": "14.1.0",
"react-native-url-polyfill": "2.0.0",
"react-native-view-shot": "3.8.0",
"react-native-view-shot": "4.0.2",
"react-native-vimeo-iframe": "1.2.1",
"react-native-webview": "13.6.3",
"react-relay": "16.0.0",
Expand Down
16 changes: 11 additions & 5 deletions src/app/Components/ShareSheet/ShareSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,29 @@ export const ShareSheet = () => {
throw error
}

// Step 3: If isArtwork, track event share
// Step 3: Process the base64 and remove any line breaks https://github.com/react-native-share/react-native-share/issues/1506#issuecomment-2486205386
const processedBase64Image = base64Data.replace(/(\r\n|\n|\r)/gm, "")

// Step 4: If isArtwork, track event share
if (isArtwork) {
trackEvent(
share(tracks.customShare(CustomService.instagram_stories, data?.internalID, data?.slug))
)
}

// Step 4: Share single from share library
// Step 5: Share single from share library

try {
await Share.shareSingle({
appId: Config.ARTSY_FACEBOOK_APP_ID,
social: Social.InstagramStories,
backgroundImage: `data:image/png;base64,${base64Data}`,
backgroundImage: `data:image/png;base64,${processedBase64Image}`,
})
} catch (error) {
console.error("Failed to open Instagram story:", error)

Sentry.withScope((scope) => {
scope.setExtra("base64Data", base64Data)
scope.setExtra("base64Data", processedBase64Image)
scope.setExtra("error", error)
captureMessage("Opened Instagram story failure")
})
Expand Down Expand Up @@ -143,10 +146,13 @@ export const ShareSheet = () => {
base64Data = await getImageBase64(currentImageUrl)
}

// Process the base64 and remove any line breaks https://github.com/react-native-share/react-native-share/issues/1506#issuecomment-2486205386
const processedBase64Image = base64Data.replace(/(\r\n|\n|\r)/gm, "")

try {
const res = await Share.open({
...shareOptions,
...(!!base64Data && { url: base64Data }),
...(!!base64Data && { url: processedBase64Image }),
})

if (isArtwork) {
Expand Down
55 changes: 15 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13108,10 +13108,10 @@ react-nanny@^2.15.0:
resolved "https://registry.yarnpkg.com/react-nanny/-/react-nanny-2.15.0.tgz#9472984af45761263b92b209f925e773fd761653"
integrity sha512-fn6tAnJ+UEdD0pq5YytlZJb5XmjVcvXoxq3i2r1o/BavgipwRWsw7oOXNJ8bJd33iedlkNyAQMXVC6qTl0Hv4A==

[email protected].9:
version "0.19.9"
resolved "https://registry.yarnpkg.com/react-native-blob-util/-/react-native-blob-util-0.19.9.tgz#6f2c27d77cd36b9e03c967c54930491404d9d780"
integrity sha512-gIuErPqGbBIAPWf+K07x/8mRZ80Waz9DWgwMdQ8zWgms8kYfAji0GNk2gvZZ0y9MKe61jme7oOdZ7InWLRy2GA==
[email protected].11:
version "0.19.11"
resolved "https://registry.yarnpkg.com/react-native-blob-util/-/react-native-blob-util-0.19.11.tgz#20c0ca589e975fee849cba1cdba712cc6adb4f59"
integrity sha512-lxaeDzFLYffR6lbRiOce0oTYO6pE3/PyT8Sa7qiz8B+IT9oe4G85SlVCdl5F9xMJh/Zer2onBLw7u+B1AS+GFA==
dependencies:
base-64 "0.1.0"
glob "^10.3.10"
Expand Down Expand Up @@ -13332,10 +13332,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/react-native-shake/-/react-native-shake-5.5.2.tgz#1e73cfb3dcefc9980f604d08a87cdc6ba3f3a479"
integrity sha512-GWQc/2h33u3ma2bBUEFG4sEQXfSmu2azEF1bUaqu+d0TeAT3vvmxpw3u6k7Z9XiZk4uRJ+NCVifx4JTHF5n67g==

react-native-share@10.0.2:
version "10.0.2"
resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-10.0.2.tgz#ba517d20a3bf20385eeeea32d9be9b41395f4dc7"
integrity sha512-EZs4MtsyauAI1zP8xXT1hIFB/pXOZJNDCKcgCpEfTZFXgCUzz8MDVbI1ocP2hA59XHRSkqAQdbJ0BFTpjxOBlg==
react-native-share@11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-11.1.0.tgz#cd24b1f2de0bb701aa7e1a4ff81e68308f0a42b2"
integrity sha512-kcpBR90d5//xc8H84HnX6YFeOk4A34mtHz4UEpb7Twbu049KafJwsp4KVVr/SrJwy8W0/Rbe880En9Hq0REamw==

[email protected]:
version "14.1.0"
Expand All @@ -13352,10 +13352,10 @@ [email protected]:
dependencies:
whatwg-url-without-unicode "8.0.0-3"

react-native-view-shot@3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/react-native-view-shot/-/react-native-view-shot-3.8.0.tgz#1aa1905f0e79428ca32bf80c16fd4abc719c600b"
integrity sha512-4cU8SOhMn3YQIrskh+5Q8VvVRxQOu8/s1M9NAL4z5BY1Rm0HXMWkQJ4N0XsZ42+Yca+y86ISF3LC5qdLPvPuiA==
react-native-view-shot@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/react-native-view-shot/-/react-native-view-shot-4.0.2.tgz#18949ff2a3083a231d055e9f53ce705ccb9d821c"
integrity sha512-niAiQmiYe+vHtfgkcZ1WhJhTL0NzNB2REERnP6eIqro9EQcV/JqLo2rzdordn+kHJEp095/2ioLrCg3d+k3Mng==
dependencies:
html2canvas "^1.4.1"

Expand Down Expand Up @@ -14665,16 +14665,7 @@ string-natural-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -14788,7 +14779,7 @@ stringify-entities@^3.1.0:
character-entities-legacy "^1.0.0"
xtend "^4.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -14802,13 +14793,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2"
Expand Down Expand Up @@ -16219,7 +16203,7 @@ word-wrap@^1.2.3, word-wrap@~1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f"
integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -16237,15 +16221,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit e91bac2

Please sign in to comment.