-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 딥링크 기능 구현 #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
feat: 딥링크 기능 구현 #147
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1956873
feat: 유니버설 링크/앱 링크 설정 추가
wonyong-park 6bbc9c6
feat: 딥링크(Deep Link) 기능 구현
wonyong-park 0a0a1a5
refactor: 라우팅 및 분석 관련 코드 분리
wonyong-park 9850268
feat: URL 유효성 검증 시 금지된 URL 확인 로직 추가
wonyong-park 30f2122
refactor: 예약어 검증 로직 ValidatorUtil로 이동 및 확장
wonyong-park 9e94828
fix: 프로필 편집 후 화면 갱신 오류 수정
wonyong-park 3e10386
fix: Feed makePath 오류 수정
wonyong-park d45959f
포맷팅 처리
wonyong-park fff419c
refactor: Future.delayed를 addPostFrameCallback으로 변경
wonyong-park File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,6 @@ | ||
| import 'package:firebase_analytics/firebase_analytics.dart'; | ||
|
|
||
| abstract final class AppAnalytics { | ||
| static final FirebaseAnalytics _analytics = FirebaseAnalytics.instance; | ||
| static final FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: _analytics); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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,9 +1,27 @@ | ||
| enum ExternalLinkType { profile, post, feed, unknown } | ||
| import 'package:grimity/app/config/app_router.dart'; | ||
|
|
||
| enum ExternalLinkType { | ||
| profile, | ||
| post, | ||
| feed, | ||
| unknown, | ||
| } | ||
|
|
||
| class ExternalLink { | ||
| const ExternalLink(this.type, {this.url, this.id}); | ||
| const ExternalLink( | ||
| this.type, { | ||
| this.url, | ||
| this.id, | ||
| }); | ||
|
|
||
| final ExternalLinkType type; | ||
| final String? url; | ||
| final String? id; | ||
|
|
||
| String get location => switch (type) { | ||
| ExternalLinkType.profile => ProfileRoute.makePath(url!), | ||
| ExternalLinkType.post => PostDetailRoute.makePath(id!), | ||
| ExternalLinkType.feed => FeedDetailRoute.makePath(id!), | ||
| ExternalLinkType.unknown => throw UnimplementedError('unknown은 location을 사용할 수 없습니다.'), | ||
| }; | ||
| } |
This file contains hidden or 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 hidden or 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,15 @@ | ||
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
|
||
| part 'initialize_app_provider.g.dart'; | ||
|
|
||
| /// 앱 초기화 여부를 확인하기 위한 Provider. | ||
| /// 딥 링크로 앱이 켜졌을 때 ColdStart/WramStart를 구분하기 위해 사용합니다. | ||
| @Riverpod(keepAlive: true) | ||
| class InitializeApp extends _$InitializeApp { | ||
| @override | ||
| bool build() => false; | ||
|
|
||
| void set(bool value) { | ||
| state = value; | ||
| } | ||
| } |
This file contains hidden or 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,19 @@ | ||
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
|
||
| part 'pending_deep_link_provider.g.dart'; | ||
|
|
||
| @Riverpod(keepAlive: true) | ||
| class PendingDeepLink extends _$PendingDeepLink { | ||
| @override | ||
| String? build() => null; | ||
|
|
||
| void setLink(String link) { | ||
| state = link; | ||
| } | ||
|
|
||
| String? consume() { | ||
| final link = state; | ||
| state = null; | ||
| return link; | ||
| } | ||
| } |
This file contains hidden or 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,21 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:go_router/go_router.dart'; | ||
| import 'package:grimity/app/linking/external_link.dart'; | ||
| import 'package:grimity/app/linking/external_link_parser.dart'; | ||
|
|
||
| abstract class UrlHandler { | ||
| // URL을 내부 라우팅으로 이동 | ||
| static void handleServerUrl(BuildContext context, String url) { | ||
| final parsed = ExternalLinkParser.parse(url); | ||
|
|
||
| switch (parsed.type) { | ||
| case ExternalLinkType.profile: | ||
| case ExternalLinkType.post: | ||
| case ExternalLinkType.feed: | ||
| context.push(parsed.location); | ||
| break; | ||
| case ExternalLinkType.unknown: | ||
| break; | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.