-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arnaud AMBROSELLI
committed
Jul 30, 2024
1 parent
0791fd4
commit aa93538
Showing
9 changed files
with
73 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const PLAYSTORE_URL = "https://play.google.com/store/apps/details?id=com.addicto"; | ||
export const APPSTORE_URL = "https://apps.apple.com/us/app/oz-ensemble/id1498190343?ls=1"; | ||
export const OZ_LANDING_PAGE = "https://ozensemble.fabrique.social.gouv.fr/"; | ||
export const PRIVACY_POLICY_URL = "https://ozensemble.fabrique.social.gouv.fr/files/privacy_policy_app.html"; | ||
export const CGUS_URL = "https://ozensemble.fabrique.social.gouv.fr/files/CGU_app.html"; | ||
export const GERALDINE_URL = "https://www.linkedin.com/in/geraldine-talbot-13989b263"; | ||
export const DOCTOLIB_URL = | ||
"https://www.doctolib.fr/addictologue/montreuil/ensemble-oz?utm_campaign=website-button&utm_source=ensemble-oz-website-button&utm_medium=referral&utm_content=option-1&utm_term=ensemble-oz"; | ||
export const CAPASSCITE = "https://www.capasscite.fr/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,53 @@ | ||
import { Share, Platform } from 'react-native'; | ||
import { logEvent } from './logEventsWithMatomo'; | ||
import { capture } from './sentry'; | ||
import API from './api'; | ||
import { storage } from './storage'; | ||
import { Share, Platform } from "react-native"; | ||
import { logEvent } from "./logEventsWithMatomo"; | ||
import { capture } from "./sentry"; | ||
import API from "./api"; | ||
import { storage } from "./storage"; | ||
import { OZ_LANDING_PAGE } from "../reference/urls"; | ||
|
||
export const shareApp = async () => { | ||
const url = 'https://ozensemble.fabrique.social.gouv.fr/'; | ||
const url = OZ_LANDING_PAGE; | ||
try { | ||
logEvent({ | ||
category: 'SHARE_APP', | ||
action: 'PRESSED', | ||
category: "SHARE_APP", | ||
action: "PRESSED", | ||
}); | ||
const result = await Share.share({ | ||
message: | ||
"Bonjour, je te recommande l'application gratuite et totalement anonyme Oz Ensemble qui aide à maitriser sa consommation d'alcool. Bonne découverte !" + | ||
(Platform.OS === 'android' ? '\n' + url : ''), | ||
url: Platform.OS === 'ios' && url, | ||
(Platform.OS === "android" ? "\n" + url : ""), | ||
url: Platform.OS === "ios" && url, | ||
}); | ||
if (result?.action === Share.sharedAction) { | ||
API.post({ | ||
path: '/badge/shares', | ||
path: "/badge/shares", | ||
body: { | ||
matomoId: storage.getString('@UserIdv2'), | ||
matomoId: storage.getString("@UserIdv2"), | ||
}, | ||
}); | ||
if (result?.activityType) { | ||
logEvent({ | ||
category: 'SHARE_APP', | ||
action: 'SHARED', | ||
category: "SHARE_APP", | ||
action: "SHARED", | ||
name: result?.activityType, | ||
}); | ||
} else { | ||
logEvent({ | ||
category: 'SHARE_APP', | ||
action: 'SHARED', | ||
category: "SHARE_APP", | ||
action: "SHARED", | ||
}); | ||
} | ||
} else if (result.action === Share.dismissedAction) { | ||
logEvent({ | ||
category: 'SHARE_APP', | ||
action: 'DISMISSED', | ||
category: "SHARE_APP", | ||
action: "DISMISSED", | ||
}); | ||
} | ||
} catch (error) { | ||
capture('share app failure ' + error); | ||
capture("share app failure " + error); | ||
logEvent({ | ||
category: 'SHARE_APP', | ||
action: 'ERROR', | ||
category: "SHARE_APP", | ||
action: "ERROR", | ||
}); | ||
} | ||
}; |