다음은 iOS 앱에서 인앱 메시지를 사용하는 데 유용한 정보입니다.
인앱 메시지를 사용하려면 반드시 SDK 버전 4.2 이상이 있어야 합니다.
기억해야 할 정보:
메시지가 표시되는 시기를 정의하는 메시지 및 규칙이 Adobe Mobile Services에서 만들어집니다. 자세한 내용은 인앱 메시지 만들기를 참조하십시오.
인앱 메시지를 표시하려면 이 섹션에 설명된 업데이트를 SDK에 적용해야 합니다.
메시지가 정의되지 않은 경우에도 이 단계를 완료할 수 있습니다. 메시지를 정의하면 앱스토어를 업데이트하지 않아도 메시지가 앱에 동적으로 전달되어 표시됩니다.
프로젝트에 라이브러리를 추가하고 라이프사이클을 구현합니다.
자세한 내용은 핵심 구현 및 라이프사이클에서 프로젝트에 SDK 및 구성 파일 추가를 참조하십시오.
라이브러리를 가져옵니다:
#import "ADBMobile.h"
ADBMobileConfig.json
파일에 인앱 메시지에 대한 필수 설정이 포함되어 있는지 확인합니다.
시작 시 인앱 메시지를 동적으로 업데이트하려면 remotes
개체가 존재하고 올바르게 구성되어 있어야 합니다.
"messages": [
{
"messageId": "de45c43c-37bf-441f-8cbd-cc3ba3469ebe",
"template": "fullscreen",
"showOffline": false,
"showRule": "always",
"endDate": 2524730400,
"startDate": 0,
"audiences": [],
"triggers": [],
"payload": { // contents change depending on template
"html": "<html>html code goes here</html>"
},
},
…
]
"remotes" : {
"analytics.poi": "https://assets.adobedtm.com/…/yourfile.json",
"messages": "https://assets.adobedtm.com/…/yourfile.json"
}
messages
또는 remotes
는 필수입니다.
이러한 개체가 구성되어 있지 않으면 업데이트된 ADBMobileConfig.json
파일을 Adobe Mobile Services에서 다운로드합니다. 자세한 내용은 핵심 구현 및 라이프사이클을 참조하십시오.
iOS Mobile Services SDK는 인앱 메시지에 대해 다음 지표를 추적합니다.
전체 화면 및 경고 스타일의 인앱 메시지:
사용자 지정 전체 화면 in-app 메시지의 경우 메시지에서 HTML 컨텐츠에 다음 단추에 대한 SDK 추적을 알리는 올바른 코드를 포함해야 합니다.
adbinapp://confirm/?url=https://www.yoursite.com
adbinapp://cancel
로컬(원격) 알림의 경우:
다음은 열린 추적을 포함하는 방법에 대한 예입니다.
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// handle local notification click-throughs for iOS 10 and older
NSDictionary *localNotificationDictionary = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
if ([localNotificationDictionary isKindOfClass:[NSDictionary class]]) {
[ADBMobile trackLocalNotificationClickThrough:localNotificationDictionary];
}
}
- (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[ADBMobile trackLocalNotificationClickThrough:notification.userInfo];
}
Adobe Mobile Services에서 전체 화면 메시지를 만들 때 선택적으로 대체 이미지를 지정할 수 있습니다. 메시지에서 웹에서 의도한 이미지를 검색할 수 없는 경우 SDK는 애플리케이션 번들의 이름과 동일한 이름으로 이미지를 로드합니다. 따라서 사용자가 오프라인 상태이거나 미리 결정된 이미지에 연결할 수 없는 경우에도 메시지를 원래 양식으로 표시할 수 있습니다.
대체 이미지 자산 이름은 Adobe Mobile Services에서 메시지를 구성할 때 지정됩니다.
지정된 리소스가 사용 가능한지 확인해야 합니다.