Skip to content

Commit

Permalink
Merge tag 'Ent_TestFlight_8.5.2132'
Browse files Browse the repository at this point in the history
  • Loading branch information
FrPellissier committed May 27, 2023
2 parents dd2ed34 + 95e8fb7 commit 5c96a1c
Show file tree
Hide file tree
Showing 44 changed files with 555 additions and 171 deletions.
4 changes: 4 additions & 0 deletions entourage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
264C1AF829AD22AB0083F83E /* ReportChooseViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 264C1AF729AD22AB0083F83E /* ReportChooseViewCell.xib */; };
264C1AFA29AF52820083F83E /* HeaderReportView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 264C1AF929AF52820083F83E /* HeaderReportView.xib */; };
264C1AFC29AF5BED0083F83E /* HeaderReportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 264C1AFB29AF5BED0083F83E /* HeaderReportView.swift */; };
2684542C29DAC63700C944EA /* UniversalLinkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2684542B29DAC63700C944EA /* UniversalLinkManager.swift */; };
268FCA2A2967281100159C34 /* MJAlertWithImageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 268FCA292967281100159C34 /* MJAlertWithImageController.swift */; };
268FCA2C2967288100159C34 /* MJAlertWithImageController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 268FCA2B2967288100159C34 /* MJAlertWithImageController.xib */; };
26BC119929C88CD700F204BB /* NeighborhoodPostDeletedCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 26BC119829C88CD700F204BB /* NeighborhoodPostDeletedCell.xib */; };
Expand Down Expand Up @@ -764,6 +765,7 @@
264C1AF729AD22AB0083F83E /* ReportChooseViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReportChooseViewCell.xib; sourceTree = "<group>"; };
264C1AF929AF52820083F83E /* HeaderReportView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HeaderReportView.xib; sourceTree = "<group>"; };
264C1AFB29AF5BED0083F83E /* HeaderReportView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderReportView.swift; sourceTree = "<group>"; };
2684542B29DAC63700C944EA /* UniversalLinkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UniversalLinkManager.swift; sourceTree = "<group>"; };
268FCA292967281100159C34 /* MJAlertWithImageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MJAlertWithImageController.swift; sourceTree = "<group>"; };
268FCA2B2967288100159C34 /* MJAlertWithImageController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MJAlertWithImageController.xib; sourceTree = "<group>"; };
26BC119829C88CD700F204BB /* NeighborhoodPostDeletedCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NeighborhoodPostDeletedCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -905,6 +907,7 @@
021F084E2798113D00F32A34 /* LocationManager.swift */,
02E0098827E33DD200BB23CA /* WebLinkManager.swift */,
022DC3EC284790B000868760 /* AnalyticsLoggerManager.swift */,
2684542B29DAC63700C944EA /* UniversalLinkManager.swift */,
);
path = Managers;
sourceTree = "<group>";
Expand Down Expand Up @@ -2040,6 +2043,7 @@
02CCE68A27D7B51E00D6976C /* CloseButton.swift in Sources */,
02E2192528355086002A1FCB /* NeighborhoodPostAddPhotoViewController.swift in Sources */,
02F578D1289AD4180040685C /* ActionSolicitationDetailHomeCell.swift in Sources */,
2684542C29DAC63700C944EA /* UniversalLinkManager.swift in Sources */,
0224597427FF323600944DE4 /* NeighborhoodCreateNameCell.swift in Sources */,
02F5278527999B8F00929431 /* SolidarityGuideCell.swift in Sources */,
02DD1E9328086E6B00538EF4 /* NeighborhoodEditHeaderCell.swift in Sources */,
Expand Down
39 changes: 2 additions & 37 deletions entourage/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,42 +98,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {

guard let incomingURL = userActivity.webpageURL else { return false }
guard let components = URLComponents(url: incomingURL, resolvingAgainstBaseURL: true) else { return false }

// extract the path components from the incoming URL
let pathComponents = components.path.components(separatedBy: "/")

// check if the incoming URL matches any of the URLs you want to handle
if components.host == "entourage-webapp-preprod.herokuapp.com" {
print("eho pathComponents " , pathComponents)
if pathComponents.contains("outings") && pathComponents.contains("chat_messages"){
}
if pathComponents.contains("neighborhoods") && pathComponents.contains("chat_messages"){

}
if pathComponents.contains("conversations") && pathComponents.contains("chat_messages"){

}
if pathComponents.contains("outings") {

}
if pathComponents.contains("neighborhoods") {

}
if pathComponents.contains("conversations") {

}
if pathComponents.contains("solicitations") {

}
if pathComponents.contains("contributions") {

}
if pathComponents.contains("resources") {

}

}
guard let components = URLComponents(url: incomingURL, resolvingAgainstBaseURL: false) else { return false }
UniversalLinkManager.handleUniversalLink(components:components)
return true
}

Expand All @@ -144,7 +110,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

private func handleDeepLink(url: URL) {
print("eho opened deeplink")
guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true),
let pathComponents = components.path?.split(separator: "/") else { return }

Expand Down
1 change: 1 addition & 0 deletions entourage/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct AppState {
appDelegate.window?.makeKeyAndVisible()
}


static func getTopViewController() -> UIViewController? {
return UIApplication.shared.topFrontViewController
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "iconFilaireNotifsOn.pdf",
"filename" : "notif-active (1).pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconFilaireNotifsOn.pdf 13-40-02-881.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
4 changes: 4 additions & 0 deletions entourage/Assets/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
"params_about_privacy" = "Politique de Confidentialité";
"params_about_email" = "Contacter Entourage";
"params_about_licences" = "Licence open-source";
"params_about_partner" = "Nos mécènes et partenaires";
"params_about_title" = "Aide et à propos";

//Settings Notifs
Expand All @@ -518,6 +519,9 @@
"param_notifs_switch_actions" = "Notifications dons & service";
"param_notifs_validate" = "Appliquer les modifications";

//NOTIF
"notif_contrib_title" = "Un voisin propose une nouvelle entraide. Peut-être que cela pourrait vous intéresser ?";
"notif_solicitation_title" = "Un voisin recherche un équipement. Peut-être que vous pourriez l’aider ?";
//Detail user profile
"detail_user_send_message" = "Écrire un message";
"detail_user_his_activity" = "Son activité";
Expand Down
136 changes: 131 additions & 5 deletions entourage/Managers/DeeplinkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ struct DeepLinkManager {
case .resources:
return "placeholder_user"
case .contributions:
return "placeholder_user"
return "ic_notif_placeholder"
case .solicitations:
return "placeholder_user"
return "ic_notif_placeholder"
case .neighborhood_post:
return "placeholder_user"
case .outing_post:
Expand Down Expand Up @@ -143,12 +143,15 @@ struct DeepLinkManager {
}
}



static func showResource(id:Int) {
if let vc = UIStoryboard.init(name: StoryboardName.main, bundle: nil).instantiateViewController(withIdentifier: "pedagoDetailVC") as? PedagogicDetailViewController {
vc.resourceId = id
AppState.getTopViewController()?.present(vc, animated: true)
}
}


static func showPartner(partnerId:Int) {
if let navVc = UIStoryboard.init(name:StoryboardName.partnerDetails, bundle: nil).instantiateInitialViewController() as? UINavigationController, let vc = navVc.topViewController as? PartnerDetailViewController {
Expand All @@ -168,6 +171,7 @@ struct DeepLinkManager {
AppState.getTopViewController()?.present(navVC, animated: true)
}
}


static func showOuting(id:Int) {
if let navVc = UIStoryboard.init(name: StoryboardName.event, bundle: nil).instantiateViewController(withIdentifier: "eventDetailNav") as? UINavigationController, let vc = navVc.topViewController as? EventDetailFeedViewController {
Expand All @@ -178,6 +182,7 @@ struct DeepLinkManager {
AppState.getTopViewController()?.present(navVc, animated: true)
}
}


static func showAction(id:Int,isContrib:Bool) {
let sb = UIStoryboard.init(name: StoryboardName.actions, bundle: nil)
Expand All @@ -188,7 +193,7 @@ struct DeepLinkManager {
AppState.getTopViewController()?.present(navVc, animated: true)
}
}


//TODO : display message from group
static func showNeighborhoodDetailMessage(instanceId:Int, postId:Int) {
Expand All @@ -203,8 +208,6 @@ struct DeepLinkManager {
}
}



static func showEventDetailMessage(instanceId:Int, postId:Int) {
let sb = UIStoryboard.init(name: StoryboardName.eventMessage, bundle: nil)
if let vc = sb.instantiateViewController(withIdentifier: "detailMessagesVC") as? EventDetailMessagesViewController {
Expand All @@ -216,6 +219,129 @@ struct DeepLinkManager {
}
}



//MARK: UNIVERSAL LINK REDIRECTION


static func showEventDetailMessageUniversalLink(instanceId:String, postId:String) {
let sb = UIStoryboard.init(name: StoryboardName.eventMessage, bundle: nil)
if let vc = sb.instantiateViewController(withIdentifier: "detailMessagesVC") as? EventDetailMessagesViewController {
vc.hashedEventId = postId
vc.hashedEventId = instanceId
vc.isStartEditing = false
vc.isGroupMember = true
AppState.getTopViewController()?.present(vc, animated: true)
}
}
static func showNeighborhoodDetailMessageUniversalLink(instanceId:String, postId:String) {
let sb = UIStoryboard.init(name: StoryboardName.neighborhoodMessage, bundle: nil)
if let vc = sb.instantiateViewController(withIdentifier: "detailMessagesVC") as? NeighborhoodDetailMessagesViewController {
vc.hashedParentCommentId = postId
vc.hashedNeighborhoodId = instanceId
vc.isStartEditing = false
vc.isGroupMember = true
AppState.getTopViewController()?.present(vc, animated: true)

}
}

static func showActionUniversalLink(id:String,isContrib:Bool) {
let sb = UIStoryboard.init(name: StoryboardName.actions, bundle: nil)
if let navVc = sb.instantiateViewController(withIdentifier: "actionDetailFullNav") as? UINavigationController, let vc = navVc.topViewController as? ActionDetailFullViewController {
vc.hashedActionId = id
vc.action = nil
vc.isContrib = isContrib
AppState.getTopViewController()?.present(navVc, animated: true)
}
}
static func showActionNewUniversalLink(isContrib:Bool) {
let sb = UIStoryboard.init(name: StoryboardName.actionCreate, bundle: nil)
if let vc = sb.instantiateViewController(withIdentifier: "actionCreateVCMain") as? ActionCreateMainViewController {
vc.modalPresentationStyle = .fullScreen
vc.isContrib = isContrib
AppState.getTopViewController()?.present(vc, animated: true)
}
}
static func showActionListUniversalLink(id:String,isContrib:Bool) {
let sb = UIStoryboard.init(name: StoryboardName.actions, bundle: nil)
if let navVc = sb.instantiateViewController(withIdentifier: "actionDetailFullNav") as? UINavigationController, let vc = navVc.topViewController as? ActionDetailFullViewController {
vc.hashedActionId = id
vc.action = nil
vc.isContrib = isContrib
AppState.getTopViewController()?.present(navVc, animated: true)
}
}

static func showContribListUniversalLink() {
if let vc = AppState.getTopViewController() as? HomeMainViewController{
if let _tabbar = vc.tabBarController as? MainTabbarViewController {
_tabbar.showActionsContrib()
}
}
}
static func showSolicitationListUniversalLink() {
if let vc = AppState.getTopViewController() as? HomeMainViewController{
if let _tabbar = vc.tabBarController as? MainTabbarViewController {
_tabbar.showActionsSolicitations()
}
}
}

static func showOutingListUniversalLink() {
if let vc = AppState.getTopViewController() as? HomeMainViewController{
if let _tabbar = vc.tabBarController as? MainTabbarViewController {
_tabbar.showMyEvents()
}
}
}

static func showOutingUniversalLink(id:String) {
if let navVc = UIStoryboard.init(name: StoryboardName.event, bundle: nil).instantiateViewController(withIdentifier: "eventDetailNav") as? UINavigationController, let vc = navVc.topViewController as? EventDetailFeedViewController {
vc.hashedEventId = id
vc.event = nil
vc.isAfterCreation = false
vc.modalPresentationStyle = .fullScreen
AppState.getTopViewController()?.present(navVc, animated: true)
}
}
static func showNeighborhoodDetailUniversalLink(id:String) {
let sb = UIStoryboard.init(name: StoryboardName.neighborhood, bundle: nil)
if let navVC = sb.instantiateViewController(withIdentifier: "neighborhoodDetailNav") as? UINavigationController, let vc = navVC.topViewController as? NeighborhoodDetailViewController {
vc.isAfterCreation = false
vc.hashedNeighborhoodId = id
vc.isShowCreatePost = false
vc.neighborhood = nil
AppState.getTopViewController()?.present(navVC, animated: true)
}
}
static func showNeiborhoodListUniversalLink() {
if let vc = AppState.getTopViewController() as? HomeMainViewController{
if let _tabbar = vc.tabBarController as? MainTabbarViewController {
_tabbar.showMyNeighborhoods()
}
}
}

static func showResourceUniversalLink(id:String) {
if let vc = UIStoryboard.init(name: StoryboardName.main, bundle: nil).instantiateViewController(withIdentifier: "pedagoDetailVC") as? PedagogicDetailViewController {
vc.hashdResourceId = id
AppState.getTopViewController()?.present(vc, animated: true)
}
}

static func showRessourceListUniversalLink() {
let vc = UIStoryboard.init(name: StoryboardName.main, bundle: nil).instantiateViewController(withIdentifier: "listPedagoNav")
AppState.getTopViewController()?.present(vc, animated: true)
}

static func showConversationUniversalLink(conversationId:String) {
if let vc = UIStoryboard.init(name: StoryboardName.messages, bundle: nil).instantiateViewController(withIdentifier: "detailMessagesVC") as? ConversationDetailMessagesViewController {
vc.setupFromOtherVCWithHash(conversationId: conversationId, title: nil, isOneToOne: true)
AppState.getTopViewController()?.present(vc, animated: true)
}
}

}

enum RedirectionType {
Expand Down
Loading

0 comments on commit 5c96a1c

Please sign in to comment.