mattermost-mobile/scripts/postinstall.sh
Christopher Poile 92bdb2847b
[MM-57486] [MM-58008] Calls: Mobile ringing for incoming calls (#7984)
* notification ringing, settings screen, native code patch, ringing mp3s

* i18n

* play preview on first press

* prevent playing from background (only affects Android) to match iOS beh

* stop ringing/vibration on entering background

* ring when coming back from background and new incoming call is present

* no push notification sound when it's a call; improve ringing

* move sounds to asset folder; copy on postinstall for android bundling

* make Ringtone type a string enum

* make Android ring async + await ring and stop; changes from PR comments

* missing fields after merge

* release lock on an exception

* cancel sample ringing when turning notifications off

* copy sound files for android build

* typo

* update snapshots

* testing if the problem is copying the mp3 files

* fix android mp3 assets when building for non-release

* add sounds to .gitignore

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2024-07-03 10:22:46 -04:00

46 lines
1,009 B
Bash
Executable file

#!/usr/bin/env bash
function installPods() {
echo "Getting Cocoapods dependencies"
npm run pod-install
}
function installPodsM1() {
echo "Getting Cocoapods dependencies"
npm run pod-install-m1
}
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ $(uname -p) == 'arm' ]]; then
installPodsM1
else
installPods
fi
fi
COMPASS_ICONS="node_modules/@mattermost/compass-icons/font/compass-icons.ttf"
if [ -z "$COMPASS_ICONS" ]; then
echo "Compass Icons font not found"
exit 1
else
echo "Configuring Compass Icons font"
cp "$COMPASS_ICONS" "assets/fonts/"
cp "$COMPASS_ICONS" "android/app/src/main/assets/fonts"
fi
ASSETS=$(node scripts/generate-assets.js)
if [ -z "$ASSETS" ]; then
echo "Error Generating app assets"
exit 1
else
echo "Generating app assets"
fi
SOUNDS="assets/sounds"
if [ -z "$SOUNDS" ]; then
echo "Sound assets not found"
exit 1
else
echo "Copying sound assets for bundling"
cp $SOUNDS/* "android/app/src/main/res/raw/"
fi