Skip to content

Commit

Permalink
fix: OZENSEMBLE-N0
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Aug 8, 2024
1 parent d3e8a25 commit 9a971b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion expo/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const MATOMO_IDSITE_1 = process.env.EXPO_PUBLIC_MATOMO_IDSITE_1;
const MATOMO_URL_2 = process.env.EXPO_PUBLIC_MATOMO_URL_2;
const MATOMO_IDSITE_2 = process.env.EXPO_PUBLIC_MATOMO_IDSITE_2;
const SCHEME = process.env.EXPO_PUBLIC_SCHEME;
const API_HOST = process.env.EXPO_PUBLIC_API_HOST;
// const API_HOST = process.env.EXPO_PUBLIC_API_HOST;
const API_HOST = "192.0.0.4:3615";
const APP_ENV = process.env.EXPO_PUBLIC_APP_ENV;

export { MATOMO_URL, MATOMO_IDSITE_1, MATOMO_URL_2, MATOMO_IDSITE_2, SCHEME, API_HOST, APP_ENV };
2 changes: 1 addition & 1 deletion expo/src/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ApiService {
};

const url = this.getUrl(path, query);
// console.log("url: ", url);
console.log("url: ", url);
const canFetch = await checkNetwork();
if (!canFetch) return { ok: false };

Expand Down
18 changes: 9 additions & 9 deletions expo/src/services/deepLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const deepLinkingConfig = {

// // Handle URL from expo push notifications
const response = await Notifications.getLastNotificationResponseAsync();
console.log("NotificationService getInitialURL:", JSON.stringify(response, null, 2));
return response?.notification.request.content.data.url;
},
subscribe(listener) {
Expand All @@ -74,17 +75,16 @@ export const deepLinkingConfig = {
});

// Listen to expo push notifications
const notificationsSubscription = Notifications.addNotificationResponseReceivedListener(
(response) => {
const url = response.notification.request.content.data.link;
const notificationsSubscription = Notifications.addNotificationResponseReceivedListener((response) => {
console.log("NotificationService notificationsSubscription:", JSON.stringify(response, null, 2));
const url = response.notification.request.content.data.link;

// Any custom logic to see whether the URL needs to be handled
//...
// Any custom logic to see whether the URL needs to be handled
//...

// Let React Navigation handle the URL
if (url) listener(url);
}
);
// Let React Navigation handle the URL
if (url) listener(url);
});

return () => {
// Clean up the event listeners
Expand Down

0 comments on commit 9a971b4

Please sign in to comment.