푸시 알림의 딥링크
Braze SDK에 무음 푸시 알림을 설정하는 방법을 알아보세요.
필수 조건
이 기능을 사용하려면 먼저 Android Braze SDK를 통합해야 합니다.
범용 대리인 만들기
Android SDK는 콘텐츠 카드, 인앱 메시지, 푸시 알림에서 Braze가 여는 모든 딥링크를 사용자 지정 처리하도록 단일 위임 오브젝트를 설정할 수 있는 기능을 제공합니다.
위임 오브젝트는 IBrazeDeeplinkHandler 인터페이스를 구현하고 BrazeDeeplinkHandler.setBrazeDeeplinkHandler()를 사용하여 설정해야 합니다. 대부분의 경우 위임은 앱의 Application.onCreate()에서 설정해야 합니다.
다음은 YouTube URL의 커스텀 동작 및 커스텀 의도 플래그로 기본 UriAction 동작을 재정의하는 예제입니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class CustomDeeplinkHandler implements IBrazeDeeplinkHandler {
private static final String TAG = BrazeLogger.getBrazeLogTag(CustomDeeplinkHandler.class);
@Override
public void gotoUri(Context context, UriAction uriAction) {
String uri = uriAction.getUri().toString();
// Open YouTube URLs in the YouTube app and not our app
if (!StringUtils.isNullOrBlank(uri) && uri.contains("youtube.com")) {
uriAction.setUseWebView(false);
}
CustomUriAction customUriAction = new CustomUriAction(uriAction);
customUriAction.execute(context);
}
public static class CustomUriAction extends UriAction {
public CustomUriAction(@NonNull UriAction uriAction) {
super(uriAction);
}
@Override
protected void openUriWithActionView(Context context, Uri uri, Bundle extras) {
Intent intent = getActionViewIntent(context, uri, extras);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent);
} else {
BrazeLogger.w(TAG, "Could not find appropriate activity to open for deep link " + uri + ".");
}
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class CustomDeeplinkHandler : IBrazeDeeplinkHandler {
override fun gotoUri(context: Context, uriAction: UriAction) {
val uri = uriAction.uri.toString()
// Open YouTube URLs in the YouTube app and not our app
if (!StringUtils.isNullOrBlank(uri) && uri.contains("youtube.com")) {
uriAction.useWebView = false
}
val customUriAction = CustomUriAction(uriAction)
customUriAction.execute(context)
}
class CustomUriAction(uriAction: UriAction) : UriAction(uriAction) {
override fun openUriWithActionView(context: Context, uri: Uri, extras: Bundle) {
val intent = getActionViewIntent(context, uri, extras)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
if (intent.resolveActivity(context.packageManager) != null) {
context.startActivity(intent)
} else {
BrazeLogger.w(TAG, "Could not find appropriate activity to open for deep link $uri.")
}
}
}
companion object {
private val TAG = BrazeLogger.getBrazeLogTag(CustomDeeplinkHandler::class.java)
}
}
앱 설정에 대한 딥링킹
딥링크에서 앱 설정을 바로 열 수 있도록 하려면 커스텀 BrazeDeeplinkHandler가 필요합니다. 다음 예제에서는 open_notification_page라는 커스텀 키-값 페어를 통해 딥링크에서 앱 설정 페이지를 엽니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
BrazeDeeplinkHandler.setBrazeDeeplinkHandler(new IBrazeDeeplinkHandler() {
@Override
public void gotoUri(Context context, UriAction uriAction) {
final Bundle extras = uriAction.getExtras();
if (extras.containsKey("open_notification_page")) {
Intent intent = new Intent();
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//for Android 5-7
intent.putExtra("app_package", context.getPackageName());
intent.putExtra("app_uid", context.getApplicationInfo().uid);
// for Android 8 and later
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
context.startActivity(intent);
}
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
BrazeDeeplinkHandler.setBrazeDeeplinkHandler(object : IBrazeDeeplinkHandler {
override fun gotoUri(context: Context, uriAction: UriAction) {
val extras = uriAction.extras
if (extras.containsKey("open_notification_page")) {
val intent = Intent()
intent.action = "android.settings.APP_NOTIFICATION_SETTINGS"
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
//for Android 5-7
intent.putExtra("app_package", context.packageName)
intent.putExtra("app_uid", context.applicationInfo.uid)
// for Android 8 and later
intent.putExtra("android.provider.extra.APP_PACKAGE", context.packageName)
context.startActivity(intent)
}
}
})
WebView 활동 커스텀하기
Braze가 앱 내에서 웹사이트 딥링크를 열면 딥링크는 BrazeWebViewActivity.
커스텀 HTML 인앱 메시지의 경우 target="_blank" 로 구성된 링크는 기기의 기본값 웹 브라우저에서 열리며 BrazeWebViewActivity 에서는 처리되지 않습니다.
이를 변경하려면:
com.braze.Constants.BRAZE_WEBVIEW_URL_EXTRA키를 사용하여Intent.getExtras()에서 대상 URL을 처리하는 새 활동을 생성합니다. 예를 보려면BrazeWebViewActivity.kt.- 해당 활동을
AndroidManifest.xml에 추가하고exported를false로 설정합니다.1 2 3
<activity android:name=".MyCustomWebViewActivity" android:exported="false" />
BrazeConfig빌더 객체에서 사용자 지정 활동을 설정합니다. 빌더를 구축한 후 빌더를Braze.configure()에 전달하고Application.onCreate().
1
2
3
4
5
BrazeConfig brazeConfig = new BrazeConfig.Builder()
.setCustomWebViewActivityClass(MyCustomWebViewActivity::class)
...
.build();
Braze.configure(this, brazeConfig);
1
2
3
4
5
val brazeConfig = BrazeConfig.Builder()
.setCustomWebViewActivityClass(MyCustomWebViewActivity::class.java)
...
.build()
Braze.configure(this, brazeConfig)
제트팩 컴포지트 사용
NavHost와 함께 젯팩 컴포즈를 사용할 때 딥링크를 처리합니다:
- 디링크를 처리하는 활동이 Android 매니페스트에 등록되어 있는지 확인하세요.
1 2 3 4 5 6 7 8 9 10 11
<activity ... <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.DEFAULT" /> <data android:host="articles" android:scheme="myapp" /> </intent-filter> </activity>
- NavHost에서 처리할 딥링크를 지정합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
composableWithCompositionLocal( route = "YOUR_ROUTE_HERE", deepLinks = listOf(navDeepLink { uriPattern = "myapp://articles/{${MainDestinations.ARTICLE_ID_KEY}}" }), arguments = listOf( navArgument(MainDestinations.ARTICLE_ID_KEY) { type = NavType.LongType } ), ) { backStackEntry -> val arguments = requireNotNull(backStackEntry.arguments) val articleId = arguments.getLong(MainDestinations.ARTICLE_ID_KEY) ArticleDetail( articleId ) }
- 앱 아키텍처에 따라 현재 활동으로 전송되는 새로운 의도도 처리해야 할 수 있습니다.
1 2 3 4 5 6 7
DisposableEffect(Unit) { val listener = Consumer<Intent> { navHostController.handleDeepLink(it) } addOnNewIntentListener(listener) onDispose { removeOnNewIntentListener(listener) } }
필수 조건
이 기능을 사용하려면 먼저 Swift Braze SDK를 통합해야 합니다.
딥링크 처리하기
1단계: 계획 등록
딥링킹을 처리하려면 Info.plist 파일에 사용자 정의 스키마를 명시해야 합니다. 탐색 구조는 사전의 배열로 정의됩니다. 이러한 각 사전에는 문자열 배열이 포함되어 있습니다.
Xcode를 사용하여 Info.plist 파일을 편집합니다:
- 새 키(
URL types)를 추가합니다. Xcode는 자동으로Item 0사전을 포함하는 배열로 만듭니다. Item 0에서URL identifier키를 추가합니다. 값을 커스텀 스키마로 설정합니다.Item 0에서URL Schemes키를 추가합니다. 그러면 자동으로Item 0문자열을 포함하는 배열이 됩니다.URL Schemes»Item 0을 사용자 지정 구성표로 설정합니다.
또는 Info.plist 파일을 직접 편집하려면 다음 사양을 따를 수 있습니다.
1
2
3
4
5
6
7
8
9
10
11
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>YOUR.SCHEME</string>
<key>CFBundleURLSchemes</key>
<array>
<string>YOUR.SCHEME</string>
</array>
</dict>
</array>
2단계: 스키마 허용 목록 추가
앱의 Info.plist 파일에 LSApplicationQueriesSchemes 키를 추가하여 canOpenURL(_:)에 전달할 URL 스키마를 선언해야 합니다. 이 허용 목록에 없는 스키마를 호출하려고 시도하면 시스템에서 기기 로그에 오류를 기록하고 딥링크가 열리지 않습니다. 이 오류의 예는 다음과 같습니다:
1
<Warning>: -canOpenURL: failed for URL: "yourapp://deeplink" – error: "This app is not allowed to query for scheme yourapp"
예를 들어, 인앱 메시지에서 Facebook 앱을 탭하여 열려면 앱의 허용 목록에 Facebook 커스텀 스키마(fb)가 있어야 합니다. 그렇지 않으면 시스템이 딥 링크를 거부합니다. 앱 내부의 페이지나 보기로 연결되는 딥링크는 여전히 앱의 Info.plist에 앱의 커스텀 스키마가 나열되어야 합니다.
허용 목록의 예는 다음과 같습니다:
1
2
3
4
5
6
<key>LSApplicationQueriesSchemes</key>
<array>
<string>myapp</string>
<string>fb</string>
<string>twitter</string>
</array>
자세한 내용은 Apple 설명서에서 LSApplicationQueriesSchemes 키를 참조하세요.
3단계: 핸들러 구현
앱을 활성화한 후 iOS는 application:openURL:options: 메서드를 호출합니다. 중요한 인수는 NSURL 객체입니다.
1
2
3
4
5
6
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
let path = url.path
let query = url.query
// Insert your code here to take some action based upon the path and query.
return true
}
1
2
3
4
5
6
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
NSString *path = [url path];
NSString *query = [url query];
// Insert your code here to take some action based upon the path and query.
return YES;
}
앱 전송 보안(ATS)
Apple의 정의에 따르면, “앱 전송 보안은 앱과 웹 서비스 간의 연결 보안을 향상시키는 기능입니다. 이 기능은 보안 연결을 위한 모범 사례를 준수하는 기본 연결 요구 사항으로 구성되어 있습니다. 앱은 이 기본 동작을 재정의하고 전송 보안을 해제할 수 있습니다.”
ATS는 기본적으로 적용됩니다. 모든 연결은 HTTPS를 사용해야 하며, 순방향 비밀성을 지원하는 TLS 1.2를 사용하여 암호화해야 합니다. 자세한 내용은 ATS를 사용하여 연결하기 위한 요구 사항을 참조하세요. Braze가 최종 기기에 제공하는 모든 이미지는 TLS 1.2를 지원하고 ATS와 호환되는 콘텐츠 전송 네트워크(‘CDN’)에서 처리됩니다.
애플리케이션의 Info.plist 에서 예외로 지정하지 않는 한 이러한 요구 사항을 따르지 않는 연결은 다음과 유사한 오류와 함께 실패합니다.
오류 예시 1:
1
2
CFNetwork SSLHandshake failed (-9801)
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred, and a secure connection to the server cannot be made."
예제 오류 2:
1
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
ATS 규정 준수는 모바일 앱 내에서 열린 링크(클릭된 링크에 대한 기본 처리)에 대해 적용되며 웹 브라우저를 통해 외부에서 열린 사이트에는 적용되지 않습니다.
ATS로 작업하기
다음 중 한 가지 방법으로 ATS를 처리할 수 있지만, ATS 요구 사항을 준수하는 것이 좋습니다.
예를 들어 인앱 메시지 및 푸시 캠페인을 통해 사용자를 유도하는 기존 링크가 ATS 요건을 충족하는지 확인하여 Braze 통합을 통해 ATS 요건을 충족할 수 있습니다. ATS 제한을 우회하는 방법이 있지만, 링크된 모든 URL이 ATS 규정을 준수하는 것이 좋습니다. Apple은 애플리케이션 보안을 점점 더 강조하고 있기 때문에 다음과 같은 ATS 예외 허용에 관한 접근 방식은 Apple에서 지원되지 않습니다.
특정 도메인 또는 스키마가 있는 링크의 하위 집합을 ATS 규칙의 예외로 취급하도록 허용할 수 있습니다. Braze 메시징 채널에서 사용하는 모든 링크가 ATS를 준수하거나 예외를 통해 처리되는 경우, Braze 통합은 ATS 요구 사항을 충족합니다.
ATS의 예외로 도메인을 추가하려면 앱의 Info.plist 파일에 다음을 추가합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>example.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
자세한 내용은 Apple의 앱 전송 보안 키 관련 문서를 참조하세요.
ATS를 완전히 끌 수 있습니다. 보안 보호 기능이 손실되고 향후 iOS 호환성이 저하될 수 있으므로 권장되지 않는 방법입니다. ATS를 비활성화하려면 앱의 Info.plist 파일에 다음을 삽입하세요:
1
2
3
4
5
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
URL 디코딩
SDK는 링크를 퍼센트 인코딩하여 유효한 URL을 생성합니다. 유니코드 문자와 같이 올바르게 형성된 URL에서 허용되지 않는 모든 링크 문자는 퍼센트 기호로 이스케이프 처리됩니다.
인코딩된 링크를 디코딩하려면 String 속성 removingPercentEncoding을 사용합니다. 또한 BrazeDelegate.braze(_:shouldOpenURL:)에서 true를 반환해야 합니다. 앱에서 URL 처리를 트리거하려면 콜투액션이 필요합니다. For example:
1
2
3
4
5
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
let urlString = url.absoluteString.removingPercentEncoding
// Handle urlString
return true
}
1
2
3
4
5
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
NSString *urlString = [url.absoluteString stringByRemovingPercentEncoding];
// Handle urlString
return YES;
}
앱 설정에 대한 딥링킹
UIApplicationOpenSettingsURLString 을 활용하여 사용자를 Braze 푸시 알림 및 인앱 메시지에서 앱 설정으로 딥링크할 수 있습니다.
앱에서 iOS 설정으로 사용자를 이동합니다:
- 먼저, 애플리케이션이 스키마 기반 딥링크 또는 유니버설 링크를 사용하도록 설정되어 있는지 확인합니다.
- 설정 페이지로 딥링킹할 URI를 결정합니다(예:
myapp://settings또는https://www.braze.com/settings). - 사용자 정의 구성표 기반 딥링크를 사용하는 경우
application:openURL:options:메서드에 다음 코드를 추가하세요:
1
2
3
4
5
6
7
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
let path = url.path
if (path == "settings") {
UIApplication.shared.openURL(URL(string:UIApplication.openSettingsURLString)!)
}
return true
}
1
2
3
4
5
6
7
8
9
10
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
NSString *path = [url path];
if ([path isEqualToString:@"settings"]) {
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:settingsURL];
}
return YES;
}
커스텀 옵션
기본 WebView 사용자 지정
Braze.WebViewController 클래스는 일반적으로 웹 딥링크에 대해 ‘앱 내에서 웹 URL 열기’를 선택한 경우 SDK에 의해 열린 웹 URL을 표시합니다.
BrazeDelegate.braze(_:willPresentModalWithContext:) 위임 메서드를 통해 Braze.WebViewController를 사용자 지정할 수 있습니다.
링크 처리 사용자 지정
BrazeDelegate 프로토콜을 사용하여 딥링크, 웹 URL, 유니버설 링크 등의 URL 처리를 사용자 지정할 수 있습니다. Braze 초기화 중에 위임을 설정하려면 Braze 인스턴스에서 위임 오브젝트를 설정합니다. 그러면 Braze는 URI를 처리하기 전에 위임의 shouldOpenURL 구현을 호출합니다.
유니버설 링크
Braze는 푸시 알림, 인앱 메시지, 콘텐츠 카드에서 유니버설 링크를 지원합니다. 유니버설 링크 지원을 사용하려면 configuration.forwardUniversalLinks를 true로 설정해야 합니다.
활성화하면 Braze는 application:continueUserActivity:restorationHandler: 메서드를 통해 앱의 AppDelegate로 유니버설 링크를 전달합니다.
또한 유니버설 링크를 처리하도록 애플리케이션을 설정해야 합니다. 애플리케이션이 유니버설 링크에 맞게 올바르게 구성되었는지 확인하려면 Apple의 설명서를 참조하세요.
유니버설 링크를 전달하려면 애플리케이션 권한에 대한 액세스 권한이 필요합니다. 시뮬레이터에서 애플리케이션을 실행할 때는 이러한 권한을 직접 사용할 수 없으며 유니버설 링크가 시스템 핸들러에 전달되지 않습니다.
시뮬레이터 빌드에 지원을 추가하려면 번들 리소스 복사 빌드 단계에 애플리케이션 .entitlements 파일을 추가하면 됩니다. 자세한 내용은 forwardUniversalLinks 설명서를 참조하세요.
SDK는 도메인의 apple-app-site-association 파일을 쿼리하지 않습니다. 도메인 이름만 보고 유니버설 링크와 일반 URL을 구분합니다. 따라서 SDK는 지원되는 관련 도메인당 apple-app-site-association에 정의된 제외 규칙을 따르지 않습니다.
예시
BrazeDelegate
다음은 BrazeDelegate 을 사용한 예제입니다. 자세한 내용은 Braze Swift 소프트웨어 개발 키트 참조를 참조하세요.
1
2
3
4
5
6
7
8
func braze(_ braze: Braze, shouldOpenURL context: Braze.URLContext) -> Bool {
if context.url.host == "MY-DOMAIN.com" {
// Custom handle link here
return false
}
// Let Braze handle links otherwise
return true
}
1
2
3
4
5
6
7
8
- (BOOL)braze:(Braze *)braze shouldOpenURL:(BRZURLContext *)context {
if ([[context.url.host lowercaseString] isEqualToString:@"MY-DOMAIN.com"]) {
// Custom handle link here
return NO;
}
// Let Braze handle links otherwise
return YES;
}
필수 조건
Flutter 앱에 딥링킹을 구현하려면 먼저 기본 Android 또는 iOS 레이어에서 딥링킹을 설정해야 합니다.
딥링킹 구현
1단계: Flutter의 기본 제공 처리 설정
- Xcode 프로젝트에서
Info.plist파일을 엽니다. - 새 키-값 쌍을 추가합니다.
- 키를
FlutterDeepLinkingEnabled로 설정합니다. - 유형을
Boolean로 설정합니다. - 값을
YES으로 설정합니다.
- Android Studio 프로젝트에서
AndroidManifest.xml파일을 엽니다. activity태그에서.MainActivity을 찾습니다.activity태그 안에 다음meta-data태그를 추가합니다:1
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
2단계: Dart 레이어로 데이터 전달(선택 사항)
사용자를 앱의 특정 위치로 보내거나 특정 함수를 호출하는 등 복잡한 사용 사례에 기본, 퍼스트파티 또는 서드파티 링크 처리를 사용할 수 있습니다.
예시: 알림 대화 상자로 딥 링크하기
다음 예제에서는 추가 패키지에 의존하지 않지만 유사한 접근 방식을 사용하여 기본, 퍼스트파티 또는 서드파티 패키지(예: go_router)를 구현할 수 있습니다. 추가 Dart 코드가 필요할 수 있습니다.
먼저 기본 레이어에서 메서드 채널을 사용하여 딥링크의 URL 문자열 데이터를 Dart 레이어로 전달합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
extension AppDelegate {
// Delegate method for handling custom scheme links.
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
forwardURL(url)
return true
}
// Delegate method for handling universal links.
override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL else {
return false
}
forwardURL(url)
return true
}
private func forwardURL(_ url: URL) {
guard let controller: FlutterViewController = window?.rootViewController as? FlutterViewController else { return }
let deepLinkChannel = FlutterMethodChannel(name: "deepLinkChannel", binaryMessenger: controller.binaryMessenger)
deepLinkChannel.invokeMethod("receiveDeepLink", arguments: url.absoluteString)
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
handleDeepLink(intent)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleDeepLink(intent)
}
private fun handleDeepLink(intent: Intent) {
val binaryMessenger = flutterEngine?.dartExecutor?.binaryMessenger
if (intent?.action == Intent.ACTION_VIEW && binaryMessenger != null) {
MethodChannel(binaryMessenger, "deepLinkChannel")
.invokeMethod("receivedDeepLink", intent?.data.toString())
}
}
}
다음으로, 이전에 전송된 URL 문자열 데이터를 사용하여 경고 대화 상자를 표시하기 위해 Dart 레이어에서 콜백 함수가 사용됩니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MethodChannel('deepLinkChannel').setMethodCallHandler((call) async {
deepLinkAlert(call.arguments, context);
});
void deepLinkAlert(String link, BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Deep Link Alert"),
content: Text("Opened with deep link: $link"),
actions: <Widget>[
TextButton(
child: Text("Close"),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
GitHub 에서 이 페이지를 편집합니다.