Skip to content

Conversation

@eyatsenkoperpetio
Copy link
Contributor

[iOS] App navigational flow for deep links/push notifications #248

We need to implement the internal paths in the app for implementing deep links and push notifications. The Following wiki explains the implementation required.

Push Notifications And Deep Linking On Mobile

APNS Files:
edx apns.zip

How to use?
https://github.com/openedx/openedx-app-ios/assets/76485998/3e91c934-26ab-4a5f-b513-d4b8cfc38968

rnr
rnr previously approved these changes Mar 7, 2024
Copy link
Contributor

@rnr rnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
just minor code-style fixes requested

)
case .viewDeepLink:
configure(
primaryButtonTitle: "View",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String should be localised

}
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove extra vertical spaces

public func showThread(thread: UserThread, postStateSubject: CurrentValueSubject<PostState?, Never>) {}
public func showThreads(courseID: String, topics: Topics, title: String, type: ThreadType, animated: Bool) {}

public func showThread(thread: UserThread, postStateSubject: CurrentValueSubject<PostState?, Never>, animated: Bool) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix line length warning

DiscussionRouter {

DiscussionRouter
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix opening brace spacing violation

Podfile.lock Outdated
PODFILE CHECKSUM: 881176d00eabfe8f78d6022c56c277cf61aad22b

COCOAPODS: 1.15.2
COCOAPODS: 1.15.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to downgrade cocoapod version

@@ -1,4 +1,4 @@
config_directory: './default_config'
config_directory: '../edx-mobile-config'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't push changes in default config values

}
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove extra vertical space

rnr
rnr previously approved these changes Mar 11, 2024
@rnr
Copy link
Contributor

rnr commented Mar 11, 2024

@eyatsenkoperpetio please fix merge conflicts

# Conflicts:
#	Core/Core/View/Base/AlertView.swift
#	OpenEdX/View/MainScreenView.swift
Copy link
Contributor

@saeedbashir saeedbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about going to user edit profile for user profile instead of opening read only user info? Thoughts?

CoreAssets.warning.swiftUIImage.renderingMode(.template)
.foregroundColor(Theme.Colors.textPrimary)
switch type {
case .deleteVideo:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about merging this case with deleteVideo because both are using the same icon?

@@ -26,9 +31,31 @@ public protocol DeepLinkService {
public class DeepLinkManager {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to disabled warning, Type Body Length Violation: Type body should span 300 lines or less excluding comments and whitespace: currently spans 308 lines (type_body_length)

Comment on lines 109 to 111
Task {
await navigateToScreen(with: link.type, link: link)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving this into else of if UIApplication.shared.applicationState == .active {

case logOut
case leaveProfile
case deleteVideo
case viewDeepLink
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simply deepLink.

"ALERT.LEAVE" = "Leave";
"ALERT.KEEP_EDITING" = "Keep editing";
"ALERT.DELETE" = "DELETE";
"ALERT.WAITING" = "Waiting...";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've discussed this with @moiz994 and he's saying lets only show full screen loader without text waiting...

DispatchQueue.main.asyncAfter(deadline: .now() + (isCourseOpened ? 0 : 1)) {
switch link.type {
case .courseDashboard:
self.hostCourseContainerView?.rootView.viewModel.selection = CourseTab.course.rawValue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if you can use weak reference of self in block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need use weak self in this case, we don't have retain cycle

Comment on lines +35 to +37
func getNavigationController() -> UINavigationController {
navigationController
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the access modifier of navigationController to public instead of defining a method. It's a read-only property so its not possible to change it from outside. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need have public navigationController, I use only for deep link

let alert = aps?[DataKeys.alert] as? [String: Any]
title = alert?[DataKeys.title] as? String
body = alert?[DataKeys.body] as? String
let aps = dictionary[DataKeys.aps.rawValue] as? [String: Any]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of Anyhashable RawStringExtractable is not useable so please remove it from DataKeys.

@eyatsenkoperpetio eyatsenkoperpetio linked an issue Mar 14, 2024 that may be closed by this pull request
Copy link
Contributor

@volodymyr-chekyrta volodymyr-chekyrta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Please address @saeedbashir's feedback

@volodymyr-chekyrta volodymyr-chekyrta merged commit 016cf09 into openedx:develop Mar 15, 2024
@rnr rnr deleted the feat/deep-link-routing branch March 19, 2024 14:49
IvanStepanok pushed a commit to raccoongang/openedx-app-ios that referenced this pull request Sep 1, 2025
…x#329)

* chore: add router to deep link manager

* chore: add deep link router

* chore: add discussion threads

* chore: program, discovery details, user profile

* chore:  disable animation for progress and refactor

* chore: move deep link router to folder

* chore: show user profile as sheet

* chore: fix close presented screen

* chore: not open again programs or discovery content

* chore: improve deep link navigation

* chore: improve deep link navigation

* chore: improve deep link navigation

* chore: check if ids isEmpty

* chore: add open announcement

* chore: improve deep link discussion

* chore: remove empty line

* chore: generate test files

* chore: remove extra codes and add strings

* chore: resolve PR commnets

* chore: resolve PR comments

* chore:  avatar can be changed in "limited profile" mode

* chore: make dashboard as default tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants