Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, synchronize]

env:
DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_12.3.app/Contents/Developer

jobs:
test:
Expand Down
336 changes: 173 additions & 163 deletions ios/ExpensifyCash.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

42 changes: 0 additions & 42 deletions ios/ExpensifyCash/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#import <Firebase.h>

#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
Expand Down Expand Up @@ -58,47 +57,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

//Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}

// Required to register for notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
[RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
}
// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// IOS 10+ Required for localNotification event
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
completionHandler();
}
// IOS 4-10 Required for the localNotification event.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
[RNCPushNotificationIOS didReceiveLocalNotification:notification];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down
4 changes: 4 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ target 'ExpensifyCash' do
use_flipper!
post_install do |installer|
flipper_post_install(installer)

installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
38 changes: 16 additions & 22 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PODS:
- Airship (14.0.1):
- Airship/Automation (= 14.0.1)
- Airship/Core (= 14.0.1)
- Airship/ExtendedActions (= 14.0.1)
- Airship/MessageCenter (= 14.0.1)
- Airship/Automation (14.0.1):
- Airship (14.2.0):
- Airship/Automation (= 14.2.0)
- Airship/Core (= 14.2.0)
- Airship/ExtendedActions (= 14.2.0)
- Airship/MessageCenter (= 14.2.0)
- Airship/Automation (14.2.0):
- Airship/Core
- Airship/Core (14.0.1)
- Airship/ExtendedActions (14.0.1):
- Airship/Core (14.2.0)
- Airship/ExtendedActions (14.2.0):
- Airship/Core
- Airship/MessageCenter (14.0.1):
- Airship/MessageCenter (14.2.0):
- Airship/Core
- boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.4)
- CocoaAsyncSocket (7.6.5)
- CocoaLibEvent (1.0.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.63.3)
Expand Down Expand Up @@ -404,8 +404,6 @@ PODS:
- React-Core
- RNCAsyncStorage (1.12.1):
- React-Core
- RNCPushNotificationIOS (1.6.1):
- React-Core
- RNFBAnalytics (7.6.8):
- Firebase/Analytics (~> 6.34.0)
- React-Core
Expand All @@ -417,9 +415,9 @@ PODS:
- Firebase/Crashlytics (~> 6.34.0)
- React-Core
- RNFBApp
- urbanairship-react-native (9.0.1):
- Airship (= 14.0.1)
- React
- urbanairship-react-native (10.0.0):
- Airship (= 14.2.0)
- React-Core
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
Expand Down Expand Up @@ -482,7 +480,6 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCPushNotificationIOS (from `../node_modules/@react-native-community/push-notification-ios`)"
- "RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`)"
- "RNFBApp (from `../node_modules/@react-native-firebase/app`)"
- "RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics`)"
Expand Down Expand Up @@ -589,8 +586,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/rn-fetch-blob"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
RNCPushNotificationIOS:
:path: "../node_modules/@react-native-community/push-notification-ios"
RNFBAnalytics:
:path: "../node_modules/@react-native-firebase/analytics"
RNFBApp:
Expand All @@ -603,9 +598,9 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Airship: 842b4f28face4db0042a8a929703df33753ac033
Airship: 02ad73780f9eed21870e36b0aaab327acda6a102
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 878b59e31113e289e275165efbe4b54fa614d43d
Expand Down Expand Up @@ -662,11 +657,10 @@ SPEC CHECKSUMS:
ReactCommon: 4167844018c9ed375cc01a843e9ee564399e53c3
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNCAsyncStorage: cb9a623793918c6699586281f0b51cbc38f046f9
RNCPushNotificationIOS: cfc6e1821f1af1874741d9b7055b75c0f8fa8a7d
RNFBAnalytics: 2dc4dd9e2445faffca041b10447a23a71dcdabf8
RNFBApp: 7eacc7da7ab19f96c05e434017d44a9f09410da8
RNFBCrashlytics: 4870c14cf8833053b6b5648911abefe1923854d2
urbanairship-react-native: b948f8d55fff0013e595ebbe84804e46d18c745b
urbanairship-react-native: dfb6dc22b2f41ccaadd636b73d51b448cd1b2bbc
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
14 changes: 3 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@react-native-community/netinfo": "^5.9.6",
"@react-native-community/progress-bar-android": "^1.0.4",
"@react-native-community/progress-view": "^1.2.3",
"@react-native-community/push-notification-ios": "^1.5.0",
"@react-native-firebase/analytics": "^7.6.7",
"@react-native-firebase/app": "^8.4.5",
"@react-native-firebase/crashlytics": "^8.4.9",
Expand Down Expand Up @@ -64,8 +63,8 @@
"react-native-keyboard-spacer": "^0.4.1",
"react-native-modal": "^11.5.6",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#783806e7a3d82d78025bb9025767f42c3964eff9",
"react-native-render-html": "^6.0.0-alpha.10",
"react-native-pdf": "^6.2.2",
"react-native-render-html": "^6.0.0-alpha.10",
"react-native-safe-area-context": "^3.1.4",
"react-native-web": "^0.14.0",
"react-native-web-webview": "^1.0.2",
Expand All @@ -76,7 +75,7 @@
"rn-fetch-blob": "^0.12.0",
"save": "^2.4.0",
"underscore": "^1.10.2",
"urbanairship-react-native": "^9.0.1"
"urbanairship-react-native": "^10.0.0"
},
"devDependencies": {
"@babel/core": "^7.11.1",
Expand Down
4 changes: 1 addition & 3 deletions src/libs/Notification/PushNotification/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ function pushNotificationEventCallback(eventType, notification) {
// we'll assume pusher is connected so we'll ignore is and not fetch the same data twice.
// However, we will allow NotificationResponse events through, so that tapping on a foreground notification
// will take you to the relevant report.
// Note: We hope to prevent foreground notifications from appearing in the near future,
// so when that happens we can go back to ignoring all push notification callbacks when the app is in the foreground
if (AppState.currentState === 'active' && eventType === EventType.PushReceived) {
if (AppState.currentState === 'active') {
console.debug('[PUSH_NOTIFICATION] Push received while app is in foreground, not executing any callback.');
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/libs/UnreadIndicatorUpdater/updateUnread/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import {UrbanAirship} from 'urbanairship-react-native';

/**
* Set the App Icon badge with the number of
Expand All @@ -7,7 +7,7 @@ import PushNotificationIOS from '@react-native-community/push-notification-ios';
* @param {Number} totalCount
*/
function updateUnread(totalCount) {
PushNotificationIOS.setApplicationIconBadgeNumber(totalCount);
UrbanAirship.setBadgeNumber(totalCount);
}

export default updateUnread;
2 changes: 0 additions & 2 deletions tests/unit/loginTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jest.mock('../../node_modules/@react-native-community/async-storage',
() => require('./mocks/@react-native-community/async-storage'));
jest.mock('../../node_modules/@react-native-community/netinfo',
() => require('./mocks/@react-native-community/netinfo'));
jest.mock('../../node_modules/@react-native-community/push-notification-ios',
() => require('./mocks/@react-native-community/push-notification-ios'));
jest.mock('../../node_modules/react-native-config',
() => require('./mocks/react-native-config'));
jest.mock('../../node_modules/react-native-image-picker',
Expand Down