Skip to content

Commit

Permalink
Fix android and ios build
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Oct 10, 2024
1 parent a903690 commit 2f84982
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 178 deletions.
2 changes: 1 addition & 1 deletion apps/wallet-mobile/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require File.join(File.dirname(`node --print "require.resolve('expo/package.json
require_relative '../../../node_modules/react-native/scripts/react_native_pods'
require_relative '../../../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
platform :ios, '14.0'
prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
Expand Down
19 changes: 10 additions & 9 deletions apps/wallet-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,9 @@ PODS:
- RNScreens (3.22.1):
- React-Core
- React-RCTImage
- RNSentry (5.33.1):
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- RNSentry (5.8.0):
- React-Core
- React-hermes
- Sentry/HybridSDK (= 8.36.0)
- Sentry/HybridSDK (= 8.9.3)
- RNShare (10.0.2):
- React-Core
- RNSVG (13.8.0):
Expand All @@ -544,7 +541,9 @@ PODS:
- SDWebImageWebPCoder (0.11.0):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.15)
- Sentry/HybridSDK (8.36.0)
- Sentry/HybridSDK (8.9.3):
- SentryPrivate (= 8.9.3)
- SentryPrivate (8.9.3)
- UMAppLoader (4.5.1)
- Yoga (1.14.0)
- ZXingObjC/Core (3.6.9)
Expand Down Expand Up @@ -663,6 +662,7 @@ SPEC REPOS:
- SDWebImageSVGCoder
- SDWebImageWebPCoder
- Sentry
- SentryPrivate
- ZXingObjC

EXTERNAL SOURCES:
Expand Down Expand Up @@ -942,18 +942,19 @@ SPEC CHECKSUMS:
RNPermissions: f1b49dd05fa9b83993cd05a9ee115247944d8f1a
RNReanimated: d6b4b867b6d1ee0798f5fb372708fa4bb8d66029
RNScreens: 50ffe2fa2342eabb2d0afbe19f7c1af286bc7fb3
RNSentry: 0744d3c79504bc4778190d047d1b60daf4a378cd
RNSentry: f9e637773502a61c7b455c4ce65bc7008ce22a6e
RNShare: 859ff710211285676b0bcedd156c12437ea1d564
RNSVG: c1e76b81c76cdcd34b4e1188852892dc280eb902
SDWebImage: cb032eba469c54e0000e78bcb0a13cdde0a52798
SDWebImageAVIFCoder: 8348fef6d0ec69e129c66c9fe4d74fbfbf366112
SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c
SDWebImageWebPCoder: 295a6573c512f54ad2dd58098e64e17dcf008499
Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57
Sentry: 97161cac725da1ecbe77d1445bf8a61c1e5667f1
SentryPrivate: 9a76def09fb08f9501997b8df946e8097947b94f
UMAppLoader: 79d3ee6aa2447a1fe2e8b0d07acf2de106e55b58
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5

PODFILE CHECKSUM: 6a304e8701f0da9c69d23503c6cdbbfe817acc27
PODFILE CHECKSUM: 4c2d6038a2a21dd9538daa115acf7ff866d31ee0

COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion apps/wallet-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"@react-navigation/native": "^6.1.6",
"@react-navigation/routers": "^6.1.5",
"@react-navigation/stack": "^6.3.16",
"@sentry/react-native": "^5.31.1",
"@sentry/react-native": "^5.8.0",
"@shopify/flash-list": "^1.4.1",
"@types/bip39": "^3.0.0",
"@types/pbkdf2": "^3.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {
import {useTheme} from '@yoroi/theme'
import {Notifications as NotificationTypes} from '@yoroi/types'
import * as React from 'react'
import {StyleSheet, Switch as RNSwitch, Text, View} from 'react-native'
import {StyleSheet, Switch as RNSwitch, View} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button} from '../../../components/Button/Button'
import {ScrollView} from '../../../components/ScrollView/ScrollView'
import {Text} from '../../../components/Text'
import {notificationManager} from './common/notification-manager'
import {createTransactionReceivedNotification} from './common/transaction-received-notification'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Notifications} from '@jamsinclair/react-native-notifications'
import {NotificationBackgroundFetchResult} from '@jamsinclair/react-native-notifications'
import {useEffect} from 'react'
import {PermissionsAndroid} from 'react-native'

import {notificationManager} from './notification-manager'
import {parseNotificationId} from './notifications'
Expand All @@ -11,6 +12,7 @@ let initialized = false
const init = () => {
if (initialized) return
initialized = true
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
Notifications.registerRemoteNotifications()
Notifications.events().registerNotificationReceivedForeground((_notification, completion) => {
completion({alert: true, sound: true, badge: true})
Expand All @@ -21,7 +23,8 @@ const init = () => {
})

Notifications.events().registerNotificationOpened((notification, completion) => {
const id = parseNotificationId(notification.identifier)
const payloadId = notification.identifier || notification.payload.id
const id = parseNotificationId(payloadId)
notificationManager.events.markAsRead(id)
completion()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const generateNotificationId = (): number => {
return generateRandomInteger(0, Number.MAX_SAFE_INTEGER)
}

export const parseNotificationId = (id: string): number => {
return parseInt(id, 10)
export const parseNotificationId = (id: string | number): number => {
return parseInt(String(id), 10)
}

const generateRandomInteger = (min: number, max: number): number => {
Expand All @@ -28,6 +28,7 @@ const sendNotification = (options: {title: string; body: string; id: number}) =>
title: options.title,
body: options.body,
sound: 'default',
id: options.id,
})
Notifications.postLocalNotification(notification.payload, options.id)
}
Loading

0 comments on commit 2f84982

Please sign in to comment.