Difference between revisions of "Android Promotion"

From AdLocus
Jump to: navigation, search
(Created page with "適地性優惠通知服務是依據全區定向或特定地理位置定向提供與您的使用者最適合的主動式訊息。 啟動優惠通知服務,請將相關程...")
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
−
適地性優惠通知服務是依據全區定向或特定地理位置定向提供與您的使用者最適合的主動式訊息。
+
== 前言 ==
 +
適地性優惠通知服務是依據全區定向或特定地理位置定向,提供您的使用者最適合的主動式訊息,同時具有高額的分潤收益。
  
 
啟動優惠通知服務,請將相關程式碼加在整個程式的進入點(例如:Application 的 onCreate )
 
啟動優惠通知服務,請將相關程式碼加在整個程式的進入點(例如:Application 的 onCreate )
  
−
*如欲使用新型態優惠通知服務啟動方式請使用10.2步驟啟動
+
== 自我檢查 ==
 +
* Library Project 與 AndroidManifest.xml 是否已[[Android_AddSDK|設定]]完成
  
−
10.新型態優惠通知服務
+
== 啟用優惠通知服務 ==
−
10.1AndroidManifest.xml 的 Application 底下加入下列程式碼。
+
=== 新版 ===
−
背景Activity 需填入主畫面Activity,如:”.MainAcitvity” 或 “com.example.ExampleApp”
+
* 設定 AndroidManifest.xml
−
10.2啟動優惠通知服務。
+
<syntaxhighlight lang="java">
−
背景Activity 需填入與10.1步驟相同的主畫面Activity,如:MainActivity.class
+
<activity android:name="com.adlocus.AdActivity"
 +
          android:parentActivityName="YourActivity"
 +
          android:theme="@style/AdLocusDialogTheme"
 +
          android:launchMode="singleTask"
 +
          android:excludeFromRecents="true" >
 +
          <meta-data android:name="android.support.PARENT_ACTIVITY"
 +
                    android:value="YourActivity" />
 +
</activity>
 +
</syntaxhighlight>
 +
* "YourActivity" 填入發送優惠通知時的主畫面 Activity.
 +
* 在該 Activity 加入下列程式碼
 +
<syntaxhighlight lang="java">
 +
Intent promotionIntent = new Intent(this, YourActivity.class);
 +
PushAd.enablePush(this, "your app key", promotionIntent );
 +
</syntaxhighlight>
  
−
*與9.5請擇一使用
+
=== 傳統 ===
 +
<syntaxhighlight lang="java">
 +
PushAd.enablePush(this, "your app key"); // 請填入 app key
 +
</syntaxhighlight>
  
 +
== 停用優惠通知服務 ==
 +
<syntaxhighlight lang="java">
 +
PushAd.disablePush(this);
 +
</syntaxhighlight>
  
−
== 新型優惠通知服務 ==  
+
== 使用者調整個人化優惠服務 ==
 +
<syntaxhighlight lang="java">
 +
PushAd.showSettingPage(this, "your app key");
 +
</syntaxhighlight>
  
−
關閉優惠通知服務請使用下列程式碼
+
== 單元測試 ==
−
 
+
<syntaxhighlight lang="java">
−
9.6可加入按鈕讓使用者開啟個人化優惠通知的設定頁面
+
PushAd.test(this);
−
 
+
</syntaxhighlight>
−
9.7測試優惠通知服務是否成功整合
+
−
 
+
−
如果整合成功將出現測試優惠通知,如下圖所示。
+
−
 
+
−
如果未出現請重新檢查。
+

Latest revision as of 18:03, 27 January 2016

前言

適地性優惠通知服務是依據全區定向或特定地理位置定向,提供您的使用者最適合的主動式訊息,同時具有高額的分潤收益。

啟動優惠通知服務,請將相關程式碼加在整個程式的進入點(例如:Application 的 onCreate )

自我檢查

  • Library Project 與 AndroidManifest.xml 是否已設定完成

啟用優惠通知服務

新版

  • 設定 AndroidManifest.xml
<activity android:name="com.adlocus.AdActivity"
          android:parentActivityName="YourActivity"
          android:theme="@style/AdLocusDialogTheme"
          android:launchMode="singleTask"
          android:excludeFromRecents="true" >
          <meta-data android:name="android.support.PARENT_ACTIVITY"
                     android:value="YourActivity" />
</activity>
  • "YourActivity" 填入發送優惠通知時的主畫面 Activity.
  • 在該 Activity 加入下列程式碼
Intent promotionIntent = new Intent(this, YourActivity.class);
PushAd.enablePush(this, "your app key", promotionIntent );

傳統

PushAd.enablePush(this, "your app key"); // 請填入 app key

停用優惠通知服務

PushAd.disablePush(this);

使用者調整個人化優惠服務

PushAd.showSettingPage(this, "your app key");

單元測試

PushAd.test(this);