Skip to content

Commit

Permalink
Merge tag 'Ent_TestFlight_8.6.2142'
Browse files Browse the repository at this point in the history
  • Loading branch information
FrPellissier committed May 27, 2023
2 parents 5c96a1c + c5611fd commit 4ee94b1
Show file tree
Hide file tree
Showing 30 changed files with 390 additions and 86 deletions.
1 change: 1 addition & 0 deletions entourage/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {

guard let incomingURL = userActivity.webpageURL else { return false }
print("eho incoming url " , incomingURL)
guard let components = URLComponents(url: incomingURL, resolvingAgainstBaseURL: false) else { return false }
UniversalLinkManager.handleUniversalLink(components:components)
return true
Expand Down
1 change: 1 addition & 0 deletions entourage/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SimpleKeychain
struct AppState {

static func checkNotifcationsAndGoMainScreen() {
print("eho")
let center = UNUserNotificationCenter.current()
center.getNotificationSettings { settings in
var status = settings.authorizationStatus
Expand Down
15 changes: 15 additions & 0 deletions entourage/Assets/Actions.xcassets/ic_share.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "attention Copy 24.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
11 changes: 11 additions & 0 deletions entourage/Assets/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@
"report_user_message_success" = "Utilisateur signalé";
"parameter_publication" = "Paramètres de la publication";
"parameter_message" = "Paramètres du message";
"parameter_action" = "Signaler un problème";
"parameter_comment" = "Paramètres du commentaire";
"supress_button_title" = "Supprimer";
"supress_alert_title_publi" = "Supprimer la publication";
Expand All @@ -559,6 +560,7 @@
"report_post_cell_title" = "Signaler";
"suppress_post_cell_title" = "Supprimer ma publication";
"report_post_cell_subtitle" = "Signaler cette publication à l'équipe Entourage";
"report_action_cell_subtitle" = "Signaler cette entraide à l'équipe Entourage";

"report_comment_cell_title" = "Signaler";
"suppress_comment_cell_title" = "Supprimer mon commentaire";
Expand Down Expand Up @@ -836,6 +838,14 @@
"event_top_cell_organised_by" = "Organisé par ";
"event_top_cell_asso" = "Événement %@" ;


//SHARE
"share_solicitation" = "Cette demande pourrait vous intéresser." ;
"share_contribution" = "Cette contribution pourrait vous intéresser." ;
"share_event" = "Cet événement Entourage pourrait vous intéresser." ;



//Create

"eventCreatePopCloseBackTitle" = "Attention";
Expand Down Expand Up @@ -900,6 +910,7 @@
"event_create_phase4_title" = "Sélectionnez la ou les catégories qui décrivent le mieux le sujet de l’événement. - obligatoire";

"event_create_phase5_title" = "Partager l'événement dans vos groupes\n- obligatoire";
"event_share_option" = "Partager l'événement";
"event_create_phase5_desc" = "Vous ne pouvez partager l’événement seulement aux groupes dont vous êtes membre. Votre événement sera alors visible dans le(s) groupe(s) sélectionné(s) et tous les membres d'un groupe pourront y participer.";
"createEventNotShare" = "Ne partager dans aucun groupe";
"createEventShare" = "Partager dans un ou plusieurs groupes";
Expand Down
7 changes: 7 additions & 0 deletions entourage/MainTabbarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class MainTabbarViewController: UITabBarController {
Logger.print("***** My group : \(groupVC.topViewController)")
}



@objc func showDiscoverEvents() {
if let vc = eventsVC.topViewController as? EventMainHomeViewController {
vc.setDiscoverFirst()
Expand All @@ -83,6 +85,7 @@ class MainTabbarViewController: UITabBarController {
if let vc = eventsVC.topViewController as? EventMainHomeViewController {
vc.setMyFirst()
}
print("eho")
self.selectedIndex = 4
self.boldSelectedItem()
Logger.print("***** My Events ")
Expand All @@ -95,6 +98,10 @@ class MainTabbarViewController: UITabBarController {
self.selectedIndex = 1
self.boldSelectedItem()
}
@objc func showHome() {
self.selectedIndex = 0
self.boldSelectedItem()
}

@objc func showActionsSolicitations() {
if let vc = actionsVC.topViewController as? ActionsMainHomeViewController {
Expand Down
14 changes: 11 additions & 3 deletions entourage/Managers/DeeplinkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,23 +273,31 @@ struct DeepLinkManager {
}
}

static func showHomeUniversalLink() {
if let vc = AppState.getTopViewController() {
if let _tabbar = vc.tabBarController as? MainTabbarViewController {
_tabbar.showHome()
}
}
}

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

static func showOutingListUniversalLink() {
if let vc = AppState.getTopViewController() as? HomeMainViewController{
if let vc = AppState.getTopViewController(){
if let _tabbar = vc.tabBarController as? MainTabbarViewController {
_tabbar.showMyEvents()
}
Expand Down
31 changes: 22 additions & 9 deletions entourage/Managers/UniversalLinkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,48 @@ import Foundation

struct UniversalLinkManager {
static let prodURL = "app.entourage.social"
static let prodURL2 = "www.entourage.social"
static let stagingURL = "entourage-webapp-preprod.herokuapp.com"


static func handleUniversalLink(components:URLComponents){
let pathComponents = components.path.components(separatedBy: "/")

//print("eho pathComponent " , pathComponents)
// check if the incoming URL matches any of the URLs you want to handle
if components.host == stagingURL || components.host == prodURL {
if components.host == stagingURL || components.host == prodURL || components.host == prodURL2 {

if pathComponents[0] == "" && pathComponents[1] == "" {
DeepLinkManager.showHomeUniversalLink()
}
if pathComponents.count == 2 && pathComponents[1] == "app"{
DeepLinkManager.showHomeUniversalLink()
}

var iterator = 0
if components.host != stagingURL {
iterator = 1
}

if pathComponents.contains("outings") && pathComponents.contains("chat_messages"){
if pathComponents.count > 3 , let _eventhashId = pathComponents[2] as? String, let _posthashId = pathComponents[3] as? String {
if pathComponents.count > 3 + iterator , let _eventhashId = pathComponents[2+iterator] as? String, let _posthashId = pathComponents[3+iterator] as? String {
DeepLinkManager.showEventDetailMessageUniversalLink(instanceId: _eventhashId, postId: _posthashId)
}
}else if pathComponents.contains("neighborhoods") && pathComponents.contains("chat_messages"){
if pathComponents.count > 3 , let _grouphashId = pathComponents[2] as? String, let _posthashId = pathComponents[3] as? String {
if pathComponents.count > 3+iterator , let _grouphashId = pathComponents[2+iterator] as? String, let _posthashId = pathComponents[3+iterator] as? String {
DeepLinkManager.showNeighborhoodDetailMessageUniversalLink(instanceId: _grouphashId, postId: _posthashId)
}

}else if pathComponents.contains("conversations") && pathComponents.contains("chat_messages"){
DeepLinkManager.showConversationUniversalLink(conversationId: "AAAAA")

}else if pathComponents.contains("outings") {
if pathComponents.count > 2 , let _hashId = pathComponents[2] as? String{
if pathComponents.count > 2+iterator , let _hashId = pathComponents[2+iterator] as? String{
DeepLinkManager.showOutingUniversalLink(id: _hashId)
}else{
DeepLinkManager.showOutingListUniversalLink()
}
}else if pathComponents.contains("neighborhoods") || pathComponents.contains("groups") {
if pathComponents.count > 2 , let _hashId = pathComponents[2] as? String{
if pathComponents.count > 2+iterator , let _hashId = pathComponents[2+iterator] as? String{
DeepLinkManager.showNeighborhoodDetailUniversalLink(id: _hashId)
}else{
DeepLinkManager.showNeiborhoodListUniversalLink()
Expand All @@ -49,7 +62,7 @@ struct UniversalLinkManager {
}else if pathComponents.contains("solicitations") {
if pathComponents.contains("new"){
DeepLinkManager.showActionNewUniversalLink(isContrib: false)
}else if pathComponents.count > 2 , let _hashId = pathComponents[2] as? String{
}else if pathComponents.count > 2+iterator , let _hashId = pathComponents[2+iterator] as? String{
DeepLinkManager.showActionUniversalLink(id: _hashId, isContrib: false)
}else{
DeepLinkManager.showSolicitationListUniversalLink()
Expand All @@ -58,14 +71,14 @@ struct UniversalLinkManager {
}else if pathComponents.contains("contributions") {
if pathComponents.contains("new"){
DeepLinkManager.showActionNewUniversalLink(isContrib: true)
}else if pathComponents.count > 2 , let _hashId = pathComponents[2] as? String{
}else if pathComponents.count > 2+iterator , let _hashId = pathComponents[2+iterator] as? String{
DeepLinkManager.showActionUniversalLink(id: _hashId, isContrib: true)
}else{
DeepLinkManager.showContribListUniversalLink()
}

}else if pathComponents.contains("resources") {
if pathComponents.count > 2 , let _hashId = pathComponents[2] as? String{
if pathComponents.count > 2+iterator , let _hashId = pathComponents[2+iterator] as? String{
DeepLinkManager.showResourceUniversalLink(id: _hashId)
}else{
DeepLinkManager.showRessourceListUniversalLink()
Expand Down
2 changes: 2 additions & 0 deletions entourage/Models/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Foundation
struct Action:Codable {
var id:Int = 0
var uuid:String = ""
var uuid_v2:String = ""
var status:String = ""

var title:String? = nil
Expand Down Expand Up @@ -64,6 +65,7 @@ struct Action:Codable {
enum CodingKeys: String, CodingKey {
case id = "id"
case uuid
case uuid_v2
case status
case title
case description
Expand Down
2 changes: 2 additions & 0 deletions entourage/Models/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
struct Event:Codable {
var uid:Int = 0
var uuid:String = ""
var uuid_v2:String = ""
var title:String = ""
var descriptionEvent:String? = nil

Expand Down Expand Up @@ -186,6 +187,7 @@ struct Event:Codable {
enum CodingKeys: String, CodingKey {
case uid = "id"
case uuid
case uuid_v2
case title
case descriptionEvent = "description"
case shareUrl = "share_url"
Expand Down
4 changes: 4 additions & 0 deletions entourage/Models/NotificationPushData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ struct NotificationPushData {
var instanceId:Int = 0
var instanceType:InstanceType = .none
var postId:Int? = nil
var welcome: Bool? = false
//value = h1, j2, j8, j11
var stage: String? = nil
var url: String? = nil


init(instanceName:String, instanceId:Int, postId:Int?) {
Expand Down
Loading

0 comments on commit 4ee94b1

Please sign in to comment.