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
59 changes: 14 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ defaults: &defaults

macos: &macos
macos:
xcode: "12.5.0"
xcode: "12.5.0"
resource_class: large

bash-env: &bash-env
BASH_ENV: "~/.nvm/nvm.sh"
Expand Down Expand Up @@ -143,15 +144,6 @@ commands:
fi
working_directory: android/app

- run:
name: Config variables
command: |
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
echo -e "export default { BUGSNAG_API_KEY: '$BUGSNAG_KEY_OFFICIAL' };" > ./config.js
else
echo -e "export default { BUGSNAG_API_KEY: '$BUGSNAG_KEY' };" > ./config.js
fi

- run:
name: Build App
command: |
Expand All @@ -170,22 +162,20 @@ commands:
name: Upload sourcemaps to Bugsnag
command: |
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
yarn generate-source-maps-android upload \
npx bugsnag-source-maps upload-react-native \
--api-key=$BUGSNAG_KEY_OFFICIAL \
--app-version=$CIRCLE_BUILD_NUM \
--minifiedFile=android/app/build/generated/assets/react/officialPlay/release/app.bundle \
--app-version-code=$CIRCLE_BUILD_NUM \
--platform android \
--source-map=android/app/build/generated/sourcemaps/react/officialPlay/release/app.bundle.map \
--minified-url=app.bundle \
--upload-sources
--bundle android/app/build/generated/assets/react/officialPlay/release/app.bundle
fi
if [[ $CIRCLE_JOB == "android-build-experimental" ]]; then
yarn generate-source-maps-android upload \
npx bugsnag-source-maps upload-react-native \
--api-key=$BUGSNAG_KEY \
--app-version=$CIRCLE_BUILD_NUM \
--minifiedFile=android/app/build/generated/assets/react/experimentalPlay/release/app.bundle \
--app-version-code=$CIRCLE_BUILD_NUM \
--platform android \
--source-map=android/app/build/generated/sourcemaps/react/experimentalPlay/release/app.bundle.map \
--minified-url=app.bundle \
--upload-sources
--bundle android/app/build/generated/assets/react/experimentalPlay/release/app.bundle
fi

- store_artifacts:
Expand Down Expand Up @@ -216,41 +206,20 @@ commands:
echo $GOOGLE_SERVICES_IOS | base64 --decode > GoogleService-Info.plist
fi
working_directory: ios
- run:
name: Upload sourcemaps to Bugsnag
command: |
if [[ $CIRCLE_JOB == "ios-build-official" ]]; then
yarn generate-source-maps-ios
curl https://upload.bugsnag.com/react-native-source-map \
-F apiKey=$BUGSNAG_KEY_OFFICIAL \
-F appBundleVersion=$CIRCLE_BUILD_NUM \
-F dev=false \
-F platform=ios \
-F sourceMap=@ios-release.bundle.map \
-F bundle=@ios-release.bundle
fi
if [[ $CIRCLE_JOB == "ios-build-experimental" ]]; then
yarn generate-source-maps-ios
curl https://upload.bugsnag.com/react-native-source-map \
-F apiKey=$BUGSNAG_KEY \
-F appBundleVersion=$CIRCLE_BUILD_NUM \
-F dev=false \
-F platform=ios \
-F sourceMap=@ios-release.bundle.map \
-F bundle=@ios-release.bundle
fi
- run:
name: Fastlane Build
no_output_timeout: 40m
command: |
agvtool new-version -all $CIRCLE_BUILD_NUM
if [[ $CIRCLE_JOB == "ios-build-official" ]]; then
/usr/libexec/PlistBuddy -c "Set BugsnagAPIKey $BUGSNAG_KEY_OFFICIAL" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY_OFFICIAL" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY_OFFICIAL" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./NotificationService/Info.plist
else
/usr/libexec/PlistBuddy -c "Set BugsnagAPIKey $BUGSNAG_KEY" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./RocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./ShareRocketChatRN/Info.plist
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./NotificationService/Info.plist
Expand Down
5 changes: 5 additions & 0 deletions __mocks__/@bugsnag/react-native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
start: () => '',
leaveBreadcrumb: () => '',
notify: () => ''
};
8 changes: 0 additions & 8 deletions __mocks__/bugsnag-react-native.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
import com.wix.reactnativenotifications.core.JsIOHelper;
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
import com.wix.reactnativenotifications.core.notification.IPushNotification;
import com.bugsnag.android.Bugsnag;

public class MainPlayApplication extends MainApplication implements INotificationsApplication {
@Override
public void onCreate() {
super.onCreate();
Bugsnag.start(this);
}

@Override
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
return new CustomPushNotification(
Expand Down
18 changes: 6 additions & 12 deletions app/utils/log/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import firebaseAnalytics from '@react-native-firebase/analytics';
import { isFDroidBuild } from '../../constants/environment';
import config from '../../../config';
import events from './events';

const analytics = firebaseAnalytics || '';
let bugsnag = '';
let crashlytics;

if (!isFDroidBuild) {
const { Client } = require('bugsnag-react-native');
bugsnag = require('@bugsnag/react-native').default;
bugsnag.start();
crashlytics = require('@react-native-firebase/crashlytics').default;
bugsnag = new Client(config.BUGSNAG_API_KEY);
}

export { analytics };
export const loggerConfig = bugsnag.config;
export const { leaveBreadcrumb } = bugsnag;
export { events };

let metadata = {};
Expand All @@ -30,7 +28,7 @@ export const logEvent = (eventName, payload) => {
try {
if (!isFDroidBuild) {
analytics().logEvent(eventName, payload);
leaveBreadcrumb(eventName, payload);
bugsnag.leaveBreadcrumb(eventName, payload);
}
} catch {
// Do nothing
Expand All @@ -40,18 +38,14 @@ export const logEvent = (eventName, payload) => {
export const setCurrentScreen = (currentScreen) => {
if (!isFDroidBuild) {
analytics().setCurrentScreen(currentScreen);
leaveBreadcrumb(currentScreen, { type: 'navigation' });
bugsnag.leaveBreadcrumb(currentScreen, { type: 'navigation' });
}
};

export default (e) => {
if (e instanceof Error && bugsnag && e.message !== 'Aborted' && !__DEV__) {
bugsnag.notify(e, (report) => {
report.metadata = {
details: {
...metadata
}
};
bugsnag.notify(e, (event) => {
event.addMetadata('details', { ...metadata });
});
if (!isFDroidBuild) {
crashlytics().recordError(e);
Expand Down
3 changes: 0 additions & 3 deletions config.js

This file was deleted.

8 changes: 8 additions & 0 deletions ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-bugsnag (2.1.0)
git
xml-simple
ffi (1.15.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
git (1.9.1)
rchardet (~> 1.8)
google-apis-androidpublisher_v3 (0.8.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.0)
Expand Down Expand Up @@ -212,6 +217,7 @@ GEM
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.6)
rchardet (1.8.0)
representable (3.1.1)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand Down Expand Up @@ -262,13 +268,15 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
xml-simple (1.1.8)

PLATFORMS
ruby

DEPENDENCIES
cocoapods
fastlane
fastlane-plugin-bugsnag

BUNDLED WITH
2.1.4
4 changes: 2 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ target 'ShareRocketChatRN' do
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
pod 'RNCMaskedView', :path => '../node_modules/@react-native-community/masked-view'
pod 'RNFastImage', :path => '../node_modules/@rocket.chat/react-native-fast-image'
pod 'BugsnagReactNative', :path => '../node_modules/bugsnag-react-native'
pod 'BugsnagReactNative', :path => '../node_modules/@bugsnag/react-native'
pod 'react-native-appearance', :path => '../node_modules/react-native-appearance'
pod 'RNConfigReader', :path => '../node_modules/react-native-config-reader'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
Expand Down Expand Up @@ -74,4 +74,4 @@ post_install do |installer|
end
end
react_native_post_install(installer)
end
end
15 changes: 6 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
PODS:
- boost-for-react-native (1.63.0)
- BugsnagReactNative (2.23.10):
- BugsnagReactNative/Core (= 2.23.10)
- React
- BugsnagReactNative/Core (2.23.10):
- React
- BugsnagReactNative (7.10.5):
- React-Core
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- EXAppleAuthentication (2.2.1):
Expand Down Expand Up @@ -581,7 +578,7 @@ PODS:
- Yoga (~> 1.14)

DEPENDENCIES:
- BugsnagReactNative (from `../node_modules/bugsnag-react-native`)
- "BugsnagReactNative (from `../node_modules/@bugsnag/react-native`)"
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- EXAppleAuthentication (from `../node_modules/expo-apple-authentication/ios`)
- EXAV (from `../node_modules/expo-av/ios`)
Expand Down Expand Up @@ -735,7 +732,7 @@ SPEC REPOS:

EXTERNAL SOURCES:
BugsnagReactNative:
:path: "../node_modules/bugsnag-react-native"
:path: "../node_modules/@bugsnag/react-native"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
EXAppleAuthentication:
Expand Down Expand Up @@ -928,7 +925,7 @@ CHECKOUT OPTIONS:

SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
BugsnagReactNative: 98fb350df4bb0c94cce903023531a1a5cc11fa51
BugsnagReactNative: a97b3132c1854fd7bf92350fabd505e3ebdd7829
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
EXAppleAuthentication: 5b3da71bada29e2423d8ea27e5538ef0d75aba62
Expand Down Expand Up @@ -1052,6 +1049,6 @@ SPEC CHECKSUMS:
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 784270f077e63099481c48111a86847b85a91b32
PODFILE CHECKSUM: 70acbdf88ff07173b5e52fdbfd3825f5b6a07b83

COCOAPODS: 1.10.1
15 changes: 6 additions & 9 deletions ios/Pods/Manifest.lock

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

Loading