Difference between revisions of "Android Promotion"
From AdLocus
| Line 4: | Line 4: | ||
== 自我檢查 == | == 自我檢查 == | ||
| − | |||
* Library Project 與 AndroidManifest.xml 是否已[[http://wiki.adlocus.com/index.php?title=Android_SDK_Getting_Start§ion=3#.E6.BA.96.E5.82.99.E5.B0.87_SDK_.E5.8A.A0.E5.85.A5.E5.88.B0.E6.82.A8.E7.9A.84.E5.B0.88.E6.A1.88 設定]]完成 | * Library Project 與 AndroidManifest.xml 是否已[[http://wiki.adlocus.com/index.php?title=Android_SDK_Getting_Start§ion=3#.E6.BA.96.E5.82.99.E5.B0.87_SDK_.E5.8A.A0.E5.85.A5.E5.88.B0.E6.82.A8.E7.9A.84.E5.B0.88.E6.A1.88 設定]]完成 | ||
| − | |||
| − | * | + | == 啟用優惠通知服務 == |
| + | === 新版 === | ||
| + | * 設定 AndroidManifest.xml | ||
| + | <syntaxhighlight lang="java"> | ||
| + | <activity android:name="com.adlocus.AdActivity" | ||
| + | android:parentActivityName="YourActivity" | ||
| + | android:theme="@style/AdLocusDialogTheme" > | ||
| + | <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> | ||
| − | + | === 傳統 === | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | PushAd.enablePush(this, "your app key"); // 請填入 app key | |
| − | == | + | == 停用通知服務 == |
| + | PushAd.disablePush(this); | ||
| − | |||
| − | + | == 呼叫設定頁面讓使用者自行調整優惠服務個人化選項 == | |
| + | PushAd.showSettingPage(this, "your app key"); | ||
| − | + | == 單元測試 == | |
| − | + | PushAd.test(this); | |
| − | + | ||
| − | + | ||
| − | + | ||
Revision as of 21:23, 2 October 2014
適地性優惠通知服務是依據全區定向或特定地理位置定向提供與您的使用者最適合的主動式訊息。
啟動優惠通知服務,請將相關程式碼加在整個程式的進入點(例如:Application 的 onCreate )
自我檢查
- Library Project 與 AndroidManifest.xml 是否已[設定]完成
啟用優惠通知服務
新版
- 設定 AndroidManifest.xml
<activity android:name="com.adlocus.AdActivity" android:parentActivityName="YourActivity" android:theme="@style/AdLocusDialogTheme" > <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);