在本頁中,您將找到中支援的所有行動使用案例清單 Adobe Campaign Standard 使用 Adobe Experience Platform SDKs. 請注意,支援這些使用案例涉及安裝和設定 Adobe Experience Platform SDKs, tags in Adobe Experience Platform、和 Adobe Campaign Standard. 如需詳細資訊,請參閱此 頁面.
Adobe Campaign Standard支援下列使用案例:
若要設定這些使用案例,您需要下列擴充功能:
在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(["pushPlatform":"apns", "email":email, "firstName":firstName, "lastName":lastName])
在Android中,下列專案 Experience Platform API 必填:
以下是Android此使用案例的範例實作:
HashMap<String, String> data = new HashMap<>();
data.put("pushPlatform", "gcm");
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 PlatformSDK:
以下是此使用案例在Android中的實施範例。
若要設定連結欄位:
HashMap<String, String> linkageFields = new HashMap<String, String>();
linkageFields.put("cusEmail", "john.doe@email.com");
Campaign.setLinkageFields(linkageFields);
若要重設連結欄位:
Campaign.resetLinkageFields()