在本頁中,您將會找到Adobe Campaign Standard中使用Adobe Experience Platform SDKs支援的每個行動使用案例清單。 請注意,支援這些使用案例需要安裝和設定Adobe Experience Platform SDKs、Adobe Experience Platform Launch和Adobe Campaign Standard。 有關此問題的詳細資訊,請參閱此頁。
Adobe Campaign Standard支援下列使用案例:
若要設定這些使用案例,您需要Experience Platform Launch的下列擴充功能:
在iOS中,需要下列Experience Platform APIs:
如需詳細資訊,請參閱iOS中的生命週期擴充功能。
以下是iOS中此使用案例的範例實作:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ACPCore.setLogLevel(.debug)
appId = SettingsBundle.getLaunchAppId()
//===== START Set up Adobe SDK =====
ACPCore.configure(withAppId: appId)
ACPCampaign.registerExtension()
ACPIdentity.registerExtension()
ACPLifecycle.registerExtension()
ACPUserProfile.registerExtension()
ACPSignal.registerExtension()
ACPCore.start()
ACPCore.lifecycleStart(nil)
return true
}
func applicationDidEnterBackground(_ application: UIApplication) {
ACPCore.lifecyclePause()
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Workaround until jira AMSDK-7411 is fixed.
sleep(2)
ACPCore.lifecycleStart(nil)
}
在Android中,需要下列Experience Platform APIs:
如需詳細資訊,請參閱Android中的生命週期擴充功能。
以下是Android的此使用案例實作範例:
@Override
public void onResume() {
super.onResume();
MobileCore.setApplication(getApplication());
MobileCore.lifecycleStart(null);
handleOpenTracking();
}
@Override
public void onPause() {
super.onPause();
MobileCore.lifecyclePause();
}
在iOS中,需要下列Experience Platform SDK:
以下是iOS中此使用案例的範例實作:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Register Device Token
ACPCore.setPushIdentifier(deviceToken)
在Android中,需要下列Experience Platform SDK:
以下是此Android使用案例的範例實作:
@Override
public void onNewToken(String token) {
Log.d(TAG, "Refreshed token: " + token);
MobileCore.setPushIdentifier(token);
}
若要使用此使用案例,您必須建立PII回傳的規則。 如需詳細資訊,請參閱PII回傳。
在iOS中,需要下列Experience Platform API:
以下是iOS中此使用案例的範例實作:
ACPCore.collectPii(["email":email, "firstName":firstName, "lastName":lastName])
在Android中,需要下列Experience Platform API:
以下是Android的此使用案例實作範例:
HashMap<String, String> data = new HashMap<>();
data.put("firstName", firstNameText);
data.put("lastName", lastNameText);
data.put("email", emailText);
MobileCore.collectPii(data);
若要使用此使用案例,您必須建立PII回傳的規則。 如需詳細資訊,請參閱PII回傳。
Adobe Campaign不會區分自訂資料或行動應用程式的生命週期資料。 這兩種資料都可以使用collectPii回傳規則,以回應行動應用程式中的事件,傳送至伺服器。
在iOS中,需要下列Experience Platform APIs:
如需詳細資訊,請參閱iOS中的生命週期擴充功能。
以下是iOS中此使用案例的範例實作:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ACPCore.setLogLevel(.debug)
appId = SettingsBundle.getLaunchAppId()
//===== START Set up Adobe SDK =====
ACPCore.configure(withAppId: appId)
ACPCampaign.registerExtension()
ACPIdentity.registerExtension()
ACPLifecycle.registerExtension()
ACPUserProfile.registerExtension()
ACPSignal.registerExtension()
ACPCore.start()
ACPCore.lifecycleStart(nil)
return true
}
func applicationDidEnterBackground(_ application: UIApplication) {
ACPCore.lifecyclePause()
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Workaround until jira AMSDK-7411 is fixed.
sleep(2)
ACPCore.lifecycleStart(nil)
}
在Android中,需要下列Experience Platform APIs:
如需詳細資訊,請參閱Android中的生命週期擴充功能。
以下是Android的此使用案例實作範例:
@Override
public void onResume() {
super.onResume();
MobileCore.setApplication(getApplication());
MobileCore.lifecycleStart(null);
handleOpenTracking();
}
@Override
public void onPause() {
super.onPause();
MobileCore.lifecyclePause();
}
您需要建立推播通知追蹤回傳的規則。 如需詳細資訊,請參閱推播通知追蹤回傳。
在iOS中,需要下列Experience Platform SDK:
以下是iOS中此使用案例的範例實作:
let deliveryId = userInfo["_dId"] as? String
let broadlogId = userInfo["_mId"] as? String
if (deliveryId != nil && broadlogId != nil) {
ACPCore.trackAction("tracking", data: ["deliveryId": deliveryId!, "broadlogId": broadlogId!, "action":"2"])
}
在Android中,需要下列Experience Platform SDK:
以下是Android的此使用案例實作範例:
contextData.put("deliveryId", deliveryId);
contextData.put("broadlogId", messageId);
contextData.put("action", "2");
MobileCore.trackAction("tracking", contextData);
在iOS中,需要下列Experience Platform SDK:
以下是iOS中此使用案例的範例實作:
ACPCore.trackAction(mobileEventName, data: [:] )
在Android中,需要下列Experience Platform SDK:
以下是Android的此使用案例實作範例:
MobileCore.trackAction(mobileEventText, new HashMap<String,String>());
若要針對以iOS中的應用程式內訊息為基礎的描述檔範本,設定連結欄位以進行其他驗證,請填寫下列Experience Platform SDK:
以下是iOS中此使用案例的範例實作。
要設定連結欄位,請執行以下操作:
var linkageFields = [String: String]()
linkageFields["cusEmail"] = "john.doe@email.com"
ACPCampaign.setLinkageFields(linkageFields)
要重置連結欄位:
ACPCampaign.resetLinkageFields(linkageFields)
若要設定連結欄位,以針對以Android中應用程式內訊息為基礎的描述檔範本進行其他驗證,必須具備下列Experience Platform SDK:
以下是此使用案例在Android中的範例實作。
要設定連結欄位,請執行以下操作:
HashMap<String, String> linkageFields = new HashMap<String, String>();
linkageFields.put("cusEmail", "john.doe@email.com");
Campaign.setLinkageFields(linkageFields);
要重置連結欄位:
Campaign.resetLinkageFields()