Files
workavia-mail-front/web/worker_service/worker_service.js
T
stanig2106 3fda5649c3
Build Docker images with Sentry / Build release image with Sentry (push) Failing after 1m59s
Release / Release (android, ubuntu-latest) (push) Failing after 38m31s
Release / Release (ios, macos-14) (push) Has been cancelled
Integration tests / Run integration tests for mobile apps (push) Failing after 15s
Build dev binaries / Build app (ios, macos-14) (push) Waiting to run
Build dev binaries / Build app (android, ubuntu-latest) (push) Failing after 34m13s
rebrand: Workavia Mail (tier 1+2+3+4)
Tier 1+2 - web/UI user-facing:
- Replace all visible "Twake Mail" / "Linagora" with "Workavia Mail"
- Swap 3 logo SVGs (icon kept, wordmark replaced via SVG <text>)
- Splash: replace icon_twp.png with HTML <div>Workavia</div>
- Remove power_by_linagora.svg, replace with AGPL SourceLinkWidget
- Patch web/index.html, manifest.json, login/logout-callback HTMLs
- Patch all 16 ARB locales + scribe ARB + app_localizations.dart
- Patch 4 web/i18n/*.json (FR/EN/DE/VI smart banner titles)
- App grid reduced to "Mail" + "Calendar"
- User-Agent: Twake-Mail -> Workavia-Mail

Tier 3+4 - mobile native:
- Bundle ID: com.linagora.{android,ios}.teammail -> com.workavia.mail
- URL schemes consolidated: teammail.mobile/twakemail.mobile -> workaviamail.mobile
- Android: applicationId, namespace, AndroidManifest, strings.xml
- Android: move Kotlin sources com.linagora.android.tmail -> com.workavia.mail
- Android: empty branding.xml + android12branding.xml (vector text not patchable)
- iOS: Info.plist (CFBundleDisplayName/Name, schemes), Runner.entitlements
- iOS: TwakeMailNSE + TeamMailShareExtension entitlements + Info.plist
- iOS: Runner.xcodeproj (12x PRODUCT_BUNDLE_IDENTIFIER, 9x APP_GROUP_ID)
- iOS: TokenRefreshManager.swift redirect URLs
- iOS: fastlane Appfile + Matchfile
- Dart: oidc_constant, app_config keychain, notification MethodChannel

Known follow-ups (require user action):
- Apple Team ID KUT463DS29 (still Linagora) -> needs Workavia team for App Store
- Android branding.xml emptied: need PNG/path-converted wordmark for splash
- iOS sub-bundle paths (TwakeMailNSE/, TeamMailShareExtension/) on disk unchanged
- iOS App Store URL emptied; Play Store ID points to com.workavia.mail
2026-04-29 18:12:55 +02:00

117 lines
3.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const androidStore = 'https://play.google.com/store/apps/details?id=com.workavia.mail';
const iosStore = '';
const openAppDeepLink = 'workaviamail.mobile://openapp';
const iosPlatform = 'iOS';
const androidPlatform = 'android';
const otherPlatform = 'other';
function getPlatform() {
const ua = navigator.userAgent || navigator.vendor || window.opera;
console.info('[VMail] getPlatform():', ua);
if (/iPhone|iPad|iPod/i.test(ua)) return iosPlatform;
if (/Android/i.test(ua)) return androidPlatform;
return otherPlatform;
}
function openWorkaviaMailApp() {
const os = getPlatform();
console.info('[VMail] handleOpenWorkaviaMailApp() - OS:', os);
let fallbackTimer;
let hiddenAt = null;
const clearFallback = (reason) => {
if (fallbackTimer) clearTimeout(fallbackTimer);
console.info(`[VMail] Cancel store redirect: ${reason}`);
window.removeEventListener('blur', onBlur);
document.removeEventListener('visibilitychange', onVisibility);
window.removeEventListener('pagehide', onPageHide);
};
const onVisibility = () => {
if (document.hidden) {
hiddenAt = Date.now();
clearFallback('document hidden (user left browser)');
}
};
const onBlur = () => {
hiddenAt = Date.now();
clearFallback('window blurred (likely app opened)');
};
const onPageHide = () => clearFallback('page hidden');
document.addEventListener('visibilitychange', onVisibility);
window.addEventListener('blur', onBlur);
window.addEventListener('pagehide', onPageHide);
const tryOpen = (deeplink, storeUrl) => {
const start = Date.now();
window.location.href = deeplink;
// fallback only if still visible after 1500 ms AND page wasnt hidden recently
fallbackTimer = setTimeout(() => {
if (!document.hidden && (!hiddenAt || Date.now() - hiddenAt > 800)) {
console.info('[VMail] Deep link failed — redirecting to store.');
window.location.href = storeUrl;
} else {
console.info('[VMail] App likely opened — skip store redirect.');
}
}, 1500);
};
if (os === androidPlatform) {
tryOpen(openAppDeepLink, androidStore);
} else if (os === iosPlatform) {
tryOpen(openAppDeepLink, iosStore);
} else {
console.info('[VMail] Unsupported platform. No app open.');
}
closeSmartBanner();
}
function initialTmailApp() {
const os = getPlatform();
const originInUrl = window.location;
console.info('[VMail] initialTmailApp(): OriginInUrl:', originInUrl);
// Skip displaying the banner on desktop browsers
if (os === otherPlatform || typeof window === 'undefined') {
console.info('[VMail] Skipping smart-banner on desktop.');
return;
}
// By default, show the banner on mobile
showSmartBanner();
// Ensure the banner stays on top after Flutter re-renders
const observer = new MutationObserver(() => {
const banner = document.querySelector('.smart-banner');
if (banner) banner.style.zIndex = '9999999';
});
observer.observe(document.body, { childList: true, subtree: true });
}
function showSmartBanner() {
console.info('[VMail] showSmartBanner(): Displaying the smart banner.');
const smartBanner = document.querySelector('.smart-banner');
if (!smartBanner) return;
smartBanner.style.display = "block";
smartBanner.style.zIndex = '9999999';
smartBanner.style.top = "16px";
document.body.style.overflow = "hidden";
}
function closeSmartBanner() {
console.info('[VMail] closeSmartBanner(): Closing the smart banner.');
const smartBanner = document.querySelector('.smart-banner');
if (!smartBanner) return;
smartBanner.style.display = "none";
smartBanner.style.top = 0;
document.body.style.overflow = "auto";
}