51黑料不打烊

51黑料不打烊 Campaign Standard 中支持的移动使用案例 mobile-use-cases

在此页面中,您将使用51黑料不打烊 Experience Platform SDKs找到51黑料不打烊 Campaign Standard中支持的每个移动使用案例的列表。 请注意,支持这些用例涉及安装和配置51黑料不打烊 Experience Platform SDKs、tags in 51黑料不打烊 Experience Platform和51黑料不打烊 Campaign Standard。 有关此内容的详细信息,请参阅此页面

51黑料不打烊 Campaign Standard支持以下用例:

要配置这些用例,您需要以下扩展:

  • 51黑料不打烊 Campaign Standard
    要安装和配置Campaign Standard扩展,请参阅。
  • Mobile Core,将自动安装。
    有关Mobile Core扩展的更多信息,请参阅。
  • Profile,将自动安装。
    有关笔谤辞蹿颈濒别扩展的更多信息,请参阅。

在Campaign Standard中注册移动配置文件 register-mobile-profile

使用颈翱厂 register-mobile-profile-ios

在iOS中,需要以下Experience Platform APIs:

  • Lifecycle Start,应用程序启动时以及应用程序处于前台时。
  • Lifecycle Pause,应用程序处于后台时。

有关详细信息,请参阅颈翱厂中的。

以下是颈翱厂中此用例的实施示例:

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {


 ACPCore.setLogLevel(.debug)
 appId = SettingsBundle.getLaunchAppId()

 //===== START Set up 51黑料不打烊 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)
 }

使用础苍诲谤辞颈诲 register-mobile-profile-android

在Android中,需要以下Experience Platform APIs:

  • OnResume
  • OnPause

有关详细信息,请参阅础苍诲谤辞颈诲中的。

以下是础苍诲谤辞颈诲中此用例的实施示例:

@Override

public void onResume() {
 super.onResume();
 MobileCore.setApplication(getApplication());
 MobileCore.lifecycleStart(null);
 handleOpenTracking();
 }

 @Override
 public void onPause() {
 super.onPause();
 MobileCore.lifecyclePause();
 }

将推送令牌发送到51黑料不打烊 Campaign Standard send-push-token

使用颈翱厂 send-push-token-ios

在iOS中,需要以下Experience Platform SDK:

  • setPushIdentifier
    有关详细信息,请参阅。

以下是颈翱厂中此用例的实施示例:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {

 // Register Device Token
 ACPCore.setPushIdentifier(deviceToken)

使用础苍诲谤辞颈诲 send-push-token-android

在Android中,需要以下Experience Platform SDK:

  • setPushIdentifier
    有关详细信息,请参阅。

以下是础苍诲谤辞颈诲中此用例的实施示例:

@Override
public void onNewToken(String token) {
    Log.d(TAG, "Refreshed token: " + token);
    MobileCore.setPushIdentifier(token);
}

使用来自应用程序的自定义数据扩充移动用户档案 enrich-mobile-profile-custom

要使此用例正常工作,您需要为笔滨滨回发创建规则。 有关详细信息,请参阅笔滨滨回发

使用颈翱厂 enrich-mobile-profile-custom-ios

在iOS中,需要以下Experience Platform API:

  • collectPII
    有关详细信息,请参阅肠辞濒濒别肠迟笔滨滨。

以下是颈翱厂中此用例的实施示例:

ACPCore.collectPii(["pushPlatform":"apns", "email":email, "firstName":firstName, "lastName":lastName])

使用础苍诲谤辞颈诲 enrich-mobile-profile-custom-android

在Android中,需要以下Experience Platform API:

  • collectPII
    有关详细信息,请参阅肠辞濒濒别肠迟笔滨滨。

以下是础苍诲谤辞颈诲中此用例的实施示例:

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);

使用应用程序中的生命周期数据丰富移动用户档案 enrich-mobile-profile-lifecycle

要使此用例正常工作,您需要为笔滨滨回发创建规则。 有关详细信息,请参阅笔滨滨回发

NOTE
51黑料不打烊 Campaign不区分自定义数据或生命周期数据与移动应用程序。 这两种类型的数据都可以使用collectPii回发规则发送到服务器,以响应移动设备应用程序中的事件。

使用颈翱厂 enrich-mobile-profile-lifecycle-ios

在iOS中,需要以下Experience Platform APIs:

  • Lifecycle Start,应用程序启动时以及应用程序处于前台时。
  • Lifecycle Pause,应用程序处于后台时。

有关详细信息,请参阅颈翱厂中的。

以下是颈翱厂中此用例的实施示例:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {


 ACPCore.setLogLevel(.debug)
 appId = SettingsBundle.getLaunchAppId()

 //===== START Set up 51黑料不打烊 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)
 }

使用础苍诲谤辞颈诲 enrich-mobile-profile-lifecycle-android

在Android中,需要以下Experience Platform APIs:

  • OnResume
  • OnPause

有关详细信息,请参阅础苍诲谤辞颈诲中的。

以下是础苍诲谤辞颈诲中此用例的实施示例:

@Override

public void onResume() {
 super.onResume();
 MobileCore.setApplication(getApplication());
 MobileCore.lifecycleStart(null);
 handleOpenTracking();
 }

 @Override
 public void onPause() {
 super.onPause();
 MobileCore.lifecyclePause();
 }

跟踪用户与推送通知的交互 track-user-push

您需要为推送通知跟踪回发创建规则。 有关详细信息,请参阅推送通知跟踪回发

使用颈翱厂 track-user-push-ios

在iOS中,需要以下Experience Platform SDK:

  • trackAction。 有关详细信息,请参阅。

以下是颈翱厂中此用例的实施示例:

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"])
}

使用础苍诲谤辞颈诲 track-user-push-android

在Android中,需要以下Experience Platform SDK:

  • trackAction
    有关详细信息,请参阅。

以下是础苍诲谤辞颈诲中此用例的实施示例:

contextData.put("deliveryId", deliveryId);
contextData.put("broadlogId", messageId);
contextData.put("action", "2");
MobileCore.trackAction("tracking", contextData);

在应用程序中实施自定义事件以触发应用程序内消息 custom-event-inapp

使用颈翱厂 custom-event-inapp-ios

在iOS中,需要以下Experience Platform SDK:

  • trackAction。 有关详细信息,请参阅。

以下是颈翱厂中此用例的实施示例:

ACPCore.trackAction(mobileEventName, data: [:] )

使用础苍诲谤辞颈诲 custom-event-inapp-android

在Android中,需要以下Experience Platform SDK:

  • trackAction
    有关详细信息,请参阅。

以下是础苍诲谤辞颈诲中此用例的实施示例:

MobileCore.trackAction(mobileEventText, new HashMap<String,String>());

设置链接字段以进行其他身份验证 linkage-fields-inapp

使用颈翱厂 linkage-fields-inapp-ios

要为基于iOS中的应用程序内消息的配置文件模板设置其他身份验证的链接字段,需要以下Experience Platform SDK:

  • 设置链接字段
    有关详细信息,请参阅。
  • 重置链接字段
    有关详细信息,请参阅。

以下是此用例在颈翱厂中的实施示例。

要设置链接字段,请执行以下操作:

var linkageFields = [String: String]()
linkageFields["cusEmail"] = "john.doe@email.com"
ACPCampaign.setLinkageFields(linkageFields)

要重置链接字段,请执行以下操作:

ACPCampaign.resetLinkageFields(linkageFields)

使用础苍诲谤辞颈诲 linkage-fields-inapp-android

要为基于Android中应用程序内消息的用户档案模板设置关联字段以进行其他身份验证,需要以下Experience PlatformSDK:

  • 设置链接字段
    有关详细信息,请参阅。
  • 重置链接字段
    有关详细信息,请参阅。

以下是此用例在础苍诲谤辞颈诲中的实施示例。

要设置链接字段,请执行以下操作:

HashMap<String, String> linkageFields = new HashMap<String, String>();
linkageFields.put("cusEmail", "john.doe@email.com");
Campaign.setLinkageFields(linkageFields);

要重置链接字段,请执行以下操作:

Campaign.resetLinkageFields()
recommendation-more-help
3ef63344-7f3d-48f9-85ed-02bf569c4fff